Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get return string value from ADO

Status
Not open for further replies.

vicky2003

Programmer
May 27, 2003
22
0
0
CA
Hi,pals,
I met a problem when I tried to get output string by calling a oracle stored procedure by ADO. The stored procedure is right by testing. Following is asp code,please help me check what's wrong with it.

cmd.ActiveConnection = objConn
cmd.CommandText = "AGENCY_BACK.sp_getDollarRecovered"
cmd.CommandType = adCmdStoredProc
in1 = "1234"
in2 = "agency1"
out1 =" out1"
out2 =" out2 "

cmd.Parameters.Append cmd.CreateParameter("I_Account_No", adVarChar, adParamInput, len(in1)+1,in1)
cmd.Parameters.Append cmd.CreateParameter("I_Agency_Code", adVarChar, adParamInput, len(in2)+1,in2)
cmd.Parameters.Append cmd.CreateParameter("O_Dollar_Recovered", adVarChar, adParamOutput, len(out1)+1, out1)
cmd.Parameters.Append cmd.CreateParameter("O_Reason_Code", adVarChar, adParamOutput, len(out2)+1, out2)

on error resume next
cmd.Execute
if objConn.errors.count <> 0 then
response.write &quot;error&quot;
else
response.write out1
response.write out2

end if


The result is :
out1 out2
That means command executed normally,but output parameter isn't set.
Anyone knows why?
Thanks,
 
At an untested guess the variables aren't automatically repopulated with the output values. To test, try:

Response.write cmd.Parameters.Item(2).Value
Response.write cmd.Parameters.Item(3).Value

... after running the proc.

codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
Yes,you are right. I can get the value through this way.
But another problem happened,the value is a string which is mixture of correct result and some other string such as &quot;BPPA&(*7(*%&^%*&^*(&quot; . It should be &quot;BPPA&quot;
Do you know what's wrong with it?
Tks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top