Issue with SPs returning name-value pairs

Issue with SPs returning name-value pairs

Post by radhakrishna srimanthul » Sat, 28 Jul 2001 20:43:22



Hi,

I have written an test SP, which returns me a
character field, and a numeric field. When I execute
the SP using dbaccess, the fields have a heading
"(expression)".

I would like to have the return from SP in a name
value format. something like "Name  Radha Krishna"
"Age 24", instead of "(expression) Radha Krishna"
"(expression) 24".

Can someone help??

Radha krishna,


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

 
 
 

Issue with SPs returning name-value pairs

Post by keit » Sun, 29 Jul 2001 03:14:43



> Hi,

> I have written an test SP, which returns me a
> character field, and a numeric field. When I execute
> the SP using dbaccess, the fields have a heading
> "(expression)".

> I would like to have the return from SP in a name
> value format. something like "Name  Radha Krishna"
> "Age 24", instead of "(expression) Radha Krishna"
> "(expression) 24".

> Can someone help??

> Radha krishna,


> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/

Try this:

Create procedure abc() retunring char(20);
return ("John Doe");
end procedure;

Create procedure xyz() retunring int;
return 999;
end procedure;

select abc() name,
       xyz() age
from   systables
where  tabid = 1

Output:

name        age
John Doe    999

You probably want have only one SP to do this. I don't think you can
without adding some additional logic to it. Well, may be you can
experiment with it.

Keith

 
 
 

Issue with SPs returning name-value pairs

Post by Jonathan Leffle » Sun, 29 Jul 2001 07:15:29



> I have written an test SP, which returns me a
> character field, and a numeric field. When I execute
> the SP using dbaccess, the fields have a heading
> "(expression)".

> I would like to have the return from SP in a name
> value format. something like "Name  Radha Krishna"
> "Age 24", instead of "(expression) Radha Krishna"
> "(expression) 24".

> Can someone help??

Feature Request (PTS Bug Number) 112961, under consideration for IDS
9.40.
Requires changes to SPL syntax.
Ask your Tech Support contact to add you to the list of people wanting
the feature.

--
Yours,

Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
     "I don't suffer from insanity; I enjoy every minute of it!"