tags:

views:

83

answers:

1

I have the following (I can't change it, it is provided for me to use):

TYPE Person_Rec IS RECORD(
ID NUMBER(10),
Name VARCHAR2(30),
Age Number(10));

PROCEDURE Modify_Person(rec IN Person_rec, option IN NUMBER)
IS
BEGIN
...
END;

How would I call Modify_Person externally, using some SQL statement - from an SQL console or C++, etc? How Do I wrap parameters into a Person_Rec?

+2  A: 

I don't see any easy way of doing it from C++ or from an SQL console. I recommend you create a wrapper package, and add a procedure like so:

    PROCEDURE MyPackage.Modify_Person(id IN NUMBER, 
                                      name IN VARCHAR2, 
                                      age IN NUMBER, 
                                      option IN NUMBER)

and call the original procedure from within the wrapper.

Nuno G
I was hoping I could do something like 'call modify_person(Person_Rec(123,'john',30),99999)'
John
@John: iirc, You can only do that if the Type (and Type Body) was defined with a constructor.
R. Bemrose