Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 622775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:01:15+00:00 2026-05-13T19:01:15+00:00

Lets say i have: create type address as object ( line1 varchar2(50), city varchar2(50),

  • 0

Lets say i have:

create type address as object (
   line1 varchar2(50),
   city varchar2(50),
   member procedure insert_address(line1 varchar2, city varchar2)
)
/

create table address_table of address;

create type body address as
   member procedure insert_address(line1 varchar2, city varchar2) is
   begin
       insert into address_table values (line1, city);
       commit;
   end insert_address;
end;
/

How do i call insert_address?

By doing the following i get invalid number or types of arguments

begin
   address.insert_address('123 my road','london');
end;

i can do this and it works, but seems like a bad idea:

declare
  v_address address := new address(null,null);
begin
  v_address.insert_address('123 my road','london');
end;

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:01:15+00:00Added an answer on May 13, 2026 at 7:01 pm

    As you have built it (which is bizarrely), the procedure insert_address can only be called in the context of an object of type address, and must be called with parameters line1 and city, with values that have no connection with the object you called it “for”. This is how I would build the table and code, and use it:

    create table address_table (line1 varchar2(50), city varchar2(50));
    
    create package address_pkg as
       procedure insert_address(p_line1 varchar2, p_city varchar2);
    end;
    /
    
    create package body address_pkg as
       procedure insert_address(p_line1 varchar2, p_city varchar2) is
       begin
          insert into address_table (line1, city) values (p_line1, p_city);
       end;
    end;
    /
    
    exec address_pkg.insert_address ('123 my road', 'london');
    

    With your funkier model, it seems that the insert_address procedure should insert “the address object itself” into the table. Something like:

    create type address as object (
       line1 varchar2(50),
       city varchar2(50),
       member procedure insert_address
    )
    /
    
    create table address_table of address;
    
    create type body address as
       member procedure insert_address is
       begin
           insert into address_table values (line1, city);
           commit;
       end insert_address;
    end;
    /
    

    Then the insert would be like:

    declare
      v_address address := new address('123 my road','london');
    begin
      v_address.insert_address;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10)
So lets say I have TABLE1 and TABLE2. CREATE TABLE TABLE1 ( first_id int
Let's say we have the following table: CREATE TABLE T ( ID INT, String1
I have a simple table in Sybase, let's say it looks as follows: CREATE
Lets say I have a eventhandler like so: public SomethingHappended_Handler(object sender, EventArgs e) {
Lets say I have a table in a sql server 2000 database called TransactionType:
lets say, i have two tables, one for object records and one for activity
Lets say I have a generic class: class Foo { // protected Type t;
Lets say I have collection of documents with specified longitude and latitude. type is
Lets say I have a recursive function that creates lists within lists. It return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.