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 -> Help on implementing dynamic SQL on oracle

Help on implementing dynamic SQL on oracle

From: <matthew_so_at_my-dejanews.com>
Date: Mon, 26 Apr 1999 09:03:35 GMT
Message-ID: <7g1a56$tcf$1@nnrp1.dejanews.com>


I am now writing a application in Oracle Pro*C. It will accept the dynamic stored procedure call from the client.(i.e the client will give me the procedure name, no. of parameter, and parameter type and value). In my program, I use bind descriptors like below: EXEC SQL AT DB_NAME DECLARE A STATEMENT; EXEC SQL AT DB_NAME PREPARE A FROM :symsqlstate; EXEC SQL AT DB_NAME DECLARE B CURSOR FOR A; EXEC SQL AT DB_NAME DESCRIBE BIND VARIABLE FOR A INTO bind_dp; EXEC SQL OPEN B USING DESCRIPTOR bind_dp;

/****** stored procedure is as follow ****/ input value a:='1234'
old_cat (a in out varchar) /*** it is an in and out parameter***/  b:=a
 select abc into a: where field=b;

THE PROBLEM IS THAT:
I need to bind the input parameter as
bind_dp->V[0]='1234'/* input value*/
bind_dp->L[0]=4 /* input length*/
However, the in and out value is stored in the same parameter. If the output value is larger 4 => error result...
Moreover, if I set the bind_dp->L[0] to larger.. let's say bind_dp->L[0]=50 then no value return from procedure!!!!(Database really has record with field='1234'!!!!!)

Could anyone give me some hints????

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Apr 26 1999 - 04:03:35 CDT

Original text of this message

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