RECORDSET AND SPL
Posted in 2000
Topics: Stored Procedures & SPL
Hi, When an Informix Stored Procedure returns a bunch of values , Is it possible to return a label to the values being returned to as well,instead of just values ? Reason to ask is ,..., In MS-SQL server the Stored Procedure could , SELECT 'label1'=name , 'label2=salary' FROM employee Here the recordset object into which the results are retrieved into , hunts for 'label1' in the resultset and retrieves its values, then goes on to 'label2'. How could I do this/simulate this functionality in Informix SPL. (Informix 9.21 TC1 on WinNT4.0 SP5) TIA, Sathish S Sent via Deja.com http://www.deja.com/
sathish_sadagopan@my-deja.com wrote: > When an Informix Stored Procedure returns a bunch of values , Is it > possible to return a label to the values being returned to as > well, instead of just values? > Reason to ask is ,..., > > In MS-SQL server the Stored Procedure could , > SELECT 'label1'=name , 'label2=salary' > FROM employee > > Here the recordset object into which the results are retrieved into , > hunts for 'label1' in the resultset and retrieves its values, then goes > on to 'label2'. > How could I do this/simulate this functionality in Informix SPL. > (Informix 9.21 TC1 on WinNT4.0 SP5) There isn't a way to tag the result columns from a stored procedure. For a simple SELECT, you can certainly do it: SELECT (a + b) / c AS d, ... The AS is an optional noise word. If you are working in ESQL/C, you can simulate this by generating columns names instead of the ubiquitous '(value)'; SQLCMD (from the IIUG archives) does this. It is a nuisance not to be able to give names to the returned values, but nonetheless, you cannot do it fully automatically. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"