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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL RECORD type used in Pro*C

Re: PL/SQL RECORD type used in Pro*C

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 29 Sep 1999 12:50:45 -0400
Message-ID: <N0PyN++CTLNVj29GnaS9UDP4ey8n@4ax.com>


A copy of this was sent to paul cluiss <paul_cluiss_at_intervoice.com> (if that email address didn't require changing) On Tue, 28 Sep 1999 12:38:36 -0500, you wrote:

>Hello everyone,
>
>I am trying to use in my Pro*C program a RECORD type which is defined in
>an Oracle package written in PL/SQL. I have defined the RECORD type
>like this:
>

you cannot do this. 3gls can only bind to SCALARS in plsql or TABLE of SCALARs - not to plsql record types.

>/* PL/SQL code */
>CREATE OR REPLACE PACKAGE myPkg
>AS
> TYPE myRowtype IS RECORD
> (
> id NUMBER(10),
> name VARCHAR(32)
> );
> PROCEDURE updateRow(newRow IN myRowtype);
>END myPkg;
>
>In my Pro*C program I would like to call myPkg.updateRow() passing it a
>parameter of myPkg.myRowtype, but I can't seem to come up with a way of
>typdefing the parameter type to the satisfaction of the Pro*C
>pre-compiler. EG, when I do something like this:
>
>/* Pro*C code */
>typedef struct myInfo myRowtype;
>EXEC SQL TYPE myRowtype IS myPkg.myRowtype;
>
>void update()
>{
> EXEC SQL BEGIN DECLARE SECTION;
> myRowtype myRow;
> EXEC SQL END DECLARE SECTION;
>
> myRow.id = 99;
> strcpy(myRow.name, "jake");
>
> EXEC SQL EXECUTE
> BEGIN
> myPkg.updateRow(:myRow);
> END;
> END-EXEC;
>
>I get the following pre-compiler error:
>
>PCC-S-02350, cannot equivalence this SQL type
> myPkg.updateRow(:myRow);
>............................1
>PLS-S-00422, no PL/SQL translation for the bindtype given for this bind
>variable
>
>Does anyone have any ideas how to use inside Pro*C programs record types
>which are declared inside PL/SQL packages? I've checked the demo
>modules, but didn't find anything.
>
>Thanks
>
>---
>Paul Cluiss
>Dallas, Texas
>
>
>

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Sep 29 1999 - 11:50:45 CDT

Original text of this message

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