Link to home
Start Free TrialLog in
Avatar of Lawrence Avery
Lawrence AveryFlag for United States of America

asked on

making a message body variable from an oracle select statement

I am looking to create a message body variable in a stored procedure by assigning results of a select statement to it.

Can I do that?
In other words, something like:

Declare message_body  varchar2

message_body = select * from table1;
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lawrence Avery

ASKER

I am sending the results of the select statement to another procedure but I want the results to have column headings followed by the data.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>but I want the results to have column headings followed by the data.

That is a sqlplus thing.  In PL/SQL if/when you are dealing with a cursor, you don't get column headings.

>>I am sending the results of the select statement to another procedure

When I see message_body, I think email.  If you are just passing data around, I wouldn't do it as a CLOB.  I would use a cursor, XML or some other PL/SQL collection object.
Good solution