is it is it possible to display contents of a table through stored procedure?
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


is it is it possible to display contents of a... Expand / Collapse
Author
Message
Posted 5/25/2006 9:22:40 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 1/25/2007 11:21:00 AM
Posts: 25, Visits: 1
Hello everyone,
is it is it possible to display contents of a table through stored procedure?If yes then can some one provide me with the syntax

appreciate your help

Thanks
Regards
Post #4244
Posted 5/25/2006 9:56:50 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 1/25/2007 11:21:00 AM
Posts: 25, Visits: 1
I need to pass the table name as a parameter to the stored procedure
Post #4245
Posted 5/26/2006 2:54:52 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2 days ago @ 3:41:05 AM
Posts: 522, Visits: 264
You can't return an answerset through a SP, just a single line using SELECT INTO.

I don't understand, why you ever want to do that, but you could use dynamic sql within your SP, e.g.:

create procedure foo (myparam varchar(30);
begin
call dbc.sysexecsql(
'create volatile table bar as (select * from ' || :myparam
|| ') with data on commit preserve rows;')
end;

call foo('blabla');
select * from bar;

Dieter
Post #4254
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 5:47am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 7 queries. Compression Disabled.