Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to get the table of record from stored proc. in C program

How to get the table of record from stored proc. in C program

From: Yazilim <yazilim_at_gmx.N.E.T>
Date: 15 Mar 2005 17:34:39 GMT
Message-ID: <Xns961ABCFC76641yaziiiiilimgmxnetttt@213.180.128.20>


Hello,
I've got the stored procedure, which returns as result the so called 'table of records'. I must call this procedure in my C program and I use the Pro*C precompiler from Oracle, but unfortunately I have no idea, how to manage and how to get and transform (to which C type) the return table.
Here is description of stored procedure:

create or replace package pa_tools is   

  function fc_get_tool_information

       (p_modul_nr in varchar2) 
     return tool_tab;

end pa_tool;

And here is what I tried to do in C program:

   EXEC SQL BEGIN DECLARE SECTION;

   VARCHAR         sql_vMODS_MODUL_NR[11];
   char            modules[100][10];

   EXEC SQL END DECLARE SECTION;    CopyCStringToVARCHAR(strModNr, sql_vMODS_MODUL_NR);

   EXEC SQL EXECUTE
    BEGIN
    :modules := PA_TOOLS.FC_GET_TOOL_INFORMATION(:sql_vMODS_MODUL_NR);     END;
   END-EXEC; Unfortunately the ProC precompiler stops with such error:

:modules := PA_TOOLS.FC_GET_TOOL_INFORMATION(:sql_vMODS_MODUL_NR); ...........1
(1) PCC-S-02382, expression is of wrong type

(..and it should theoretically read the table to the array 'modules'). How can I then force the C program to read the table of records from the stored procedure?
Thanks in advance for your help,
Yazilim. Received on Tue Mar 15 2005 - 11:34:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US