> When I pass a value back to a variable from a stored procedure in
> Oracle, the variable invariably takes on a value of 1 instead of
> whatever was determined in the stored procedure.
>
> For example, here is where the stored procedure is called:
>
> <cfstoredproc datasource="mydata" procedure="myproc" debug="yes">
> <cfprocparam type="in" dbvarname="myVar" value="12"
> cfsqltype="cf_sql_integer">
> <cfprocparam type="out" dbvarname="myVar2" variable="myResult"
> cfsqltype="cf_sql_integer">
> </cfstoredproc>
>
> ...and here is the stored procedure:
>
> CREATE OR REPLACE procedure myproc (
> myVar int,
> myVar2 out
> ) as begin
>
> myVar2 := 0;
> myVar2 := myVar * 2;
> end myproc;
> /
You might try something like "SELECT myVar AS backvalue" to get the
value out as a record set. I had a similar problem on SQL server a while
back and just fell back on to that. It seemed like the out would always
return the exit status of the store proc - This was quite a while ago
mind you and I could have been doing it totally wrong - but try
something along the lines of:
<cfstoredproc datasource="mydata" procedure="myproc" debug="yes">
<cfprocparam type="in" dbvarname="myVar" value="12"
cfsqltype="cf_sql_integer">
<cfprocresult name="dodad" resultSet="1">
</cfstoredproc>
<cfdump var="#dodad#">
and adjust the procedure to do a select at the end. Also you might try
turning debug off as that maybe whats casing it to be mean.
>
> Now, when I do something like:
>
> <cfoutput>#myResult#</cfoutput>
>
> I should see "24" displayed on the screen. Instead I see "1". Why is this?
--
Vale,
Rob
Luxuria immodica insaniam creat.
Sanam formam viatae conservate!
http://www.rohanclan.com
http://treebeard.sourceforge.net
http://ashpool.sourceforge.net
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

