Problem with embedded dynamic pl/sql in/out parameters
OK. I really tried to follow the example for method 4 for
embedded sql (Oracle version 7). And it works, up to a point. But I still
have some questions.
I am trying to call a stored procedure from C, using embedded
sql. My program goes something like this:
- I do the EXE SQL PREPARE, with 'begin :rc := (pl/sql function call)end;'
and get back a SQLDA * called bind_dp, which tells me the names
and lengths of the placeholders. Note that the stored procedures
have output and (sometimes) in/out parameters.
- I call EXEC SQL DECLARE to set up a cursor
- I put the values for the placeholders in the bind_dp->V[i], and
lengths in bind_dp->L[i].
- I call EXE SQL OPEN C USING DESCRIPTOR bind_dp; which should
execute my stored procedure. Sometimes it does, sometimes I
get a value conversion error.
- Do a CLOSE
My questions are:
- When setting up the bind descriptor WHAT SHOULD THE LENGTH (bind_dp->L[i])
fields be? If they are set to the length of the input variable, the
output variable (if longer) gets truncated (or I get a conversion
error). If i set it to the actual length of the buffer, does my
input variable get padded with spaces? If it is padded with
spaces, does oracle care?
How can I tell, for an arbitrary stored procedure call, if the
parameters are input, output, or in/out?
Thanks In Advance
Cary O'Brien
cobrien_at_access.digex.net
Received on Mon Sep 19 1994 - 15:00:10 CEST
Original text of this message