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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming return values in Stored Procedures

Status
Not open for further replies.

TimMcOwan

IS-IT--Management
Apr 6, 2005
1
GB
Hi All,

I'm new to stored procedures in Informix, but I've written one that does the job I need it to do...except one thing.

When the stored proc returns values, it doesn't assign a name to the values it returns. The stored proc I'm talking about returns multiple values (for the purposes of this thread, lets just say they're "CustomerID" and "OrderID") and, when I run it in dbaccess, it just outputs:
Code:
(expression) ABBE03
(expression) 928378

I need to somehow label the return values so that it will show
Code:
CustomerID ABBE03
OrderID 928378

Please help folks, I'm nearly there!
 
Unfortunately, Informix stored procedure return values are returned ordinally and not by name. You just have to know that expression 1 is the customerid, and expression 2 is the orderid.

I wish there was a ready solution, but I don't know of one. If you find a solution, I'd be interested in knowing about it.

Regards,

Ed
 
Hi there!

You do not say which Informix-Version you are using, but in my current environment (9.40UC2X3) there IS a solution for that.

The code would look like this:

Code:
create procedure myproc()
returning integer [b]as CustomerID[/b], 
          integer [b]as OrderID[/b]

return 1000,100;

end procedure;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top