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 -> Problem with stored procedure and ProC

Problem with stored procedure and ProC

From: Alan Barclay <barclaya_at_NO-SPAM.aberdeen.geoquest.slb.com>
Date: Wed, 08 Apr 1998 12:13:45 +0100
Message-ID: <352B5BE9.89AF63DB@NO-SPAM.aberdeen.geoquest.slb.com>


Hi,

I would appreciate some help from anybody who is familiar will calling stored procedures from ProC.

The problem for me is that the stored procedure which I need to call takes 3 IN arguments (easy) and 1 OUT argument (hard). Below is the code

which I am using, but always it complains about the OUT variable either not being bound or there being no SELECT. This all seems so simple but neither of the two versions of code works!

Thank in advance for any ideas.

// TRY 1

   EXEC SQL BEGIN DECLARE SECTION;

        char *bla;
        char *start;
        char *end;
        varchar op[ 1024 ];

    EXEC SQL END DECLARE SECTION; bla = "bla";
start = "01-APR-98";
end = "01-APR-98";

    EXEC SQL EXECUTE

        BEGIN
            sp_tv( :bla, :start, :end, :op );
        END;

    END-EXEC; sqlca.sqlerrm.sqlerrmc[ sqlca.sqlerrm.sqlerrml - 1 ] = '\0'; printf("%s\n", sqlca.sqlerrm.sqlerrmc );

printf("[%s] %d\n", op, sqlca.sqlcode );

// TRY 2

sprintf( sql, "BEGIN sp_tv( 'bla', '01/01/1990 00:00:00', '02/01/1990 00:00:00', :op ); END;" );

EXEC SQL DECLARE CD STATEMENT;
EXEC SQL PREPARE CD FROM :sql;
EXEC SQL EXECUTE CD USING :op;

--
Alan Barclay
Schlumberger GeoQuest
barclaya_at_aberdeen.geoquest.slb.com Received on Wed Apr 08 1998 - 06:13:45 CDT

Original text of this message

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