Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing array of structure to Oracle Procedure (PL/SQL Table)

503 views
Skip to first unread message

Raman

unread,
Mar 25, 2004, 9:56:26 AM3/25/04
to
I am using PB8, Oracle9.

1) I have a Oracle package
CREATE OR REPLACE PACKAGE TEST AS
TYPE task_columns_rec IS RECORD (
column_name VARCHAR2(30),
column_value VARCHAR2(2000));
TYPE task_updated_columns_array IS
TABLE OF task_columns_rec INDEX BY
BINARY_INTEGER;
END TEST;

2) a Oracle procedure which uses this
CREATE OR REPLACE PROCEDURE TESTSP (key in number, str
in
task_updated_columns_array, status out number)
as begin
......code....
end;

3) In PB, I created a structure
global type str_test_update from structure
string column
string column_value
end type

4) the folloiwng line of code in transaction object
subroutine TESTSP ( double key, str_test_update lstr,
ref integer stat)RPCFUNC ALIAS FOR "TESTSP"

5) Call the procedure in PB code
str_test_update lstr[]
integer li_stat
lstr[1].column = 'col1'
lstr[1].column_value = 'xx'
sqlca.TESTSP (20, lstr, li_stat)

6) All the above pieces of code compile successfully in PB
and
Oracle.

7) Now when I run the PB application and PB gives me the
following error when I step out of the lin "sqlca.TESTSP
(20,
lstr, li_stat)"
Powerbuilder application execution error (R0010)
Application Terminated. Error: Unsupported argument type
in
DDL function

Please help

Raman

Bruce Armstrong [TeamSybase]

unread,
Mar 25, 2004, 10:16:27 AM3/25/04
to
You might want to check out the section of the PowerBuilder help
called "Supported features when using Oracle stored procedures". It
notes that neither method (RPCFUNC or DECLARE) supports a record as an
argument. You might consider passing an array instead, or delimiting
the data (e.g., XML) and passing it in as a single string.

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

Techcast - What's New in PowerBuilder 10.0 - March 16 & March 18
http://crm.sybase.com/sybase/www/IPG/PowerBuilder10Regbn.jsp

Techcast - New Features and Benefits of Sybase EAServer 5.0 - March 23
http://crm.sybase.com/sybase/www/IPG/EAServer50TechcastReg.jsp

Sixth Annual Sybase Tools Seminar - April 19 - Minneapolis, MN
http://www.powerobjects.com/seminar/?source=newsgroups

Two new books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

ISUG Enhancement Requests
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

0 new messages