|
|
Re: how to use desc inside pl sql block? [message #518062 is a reply to message #518059] |
Mon, 01 August 2011 02:39   |
 |
Littlefoot
Messages: 21826 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The same way you'd use ASC in PL/SQL block, I suppose.
What does your question mean? Where would you want to use DESC? In a SELECT statement? You'd use it as described in documentation. Otherwise, explain what you mean.
[EDIT] So you, Michel, actually understood the question? Wow.
[Updated on: Mon, 01 August 2011 02:40] Report message to a moderator
|
|
|
|
|
|
|
|
Re: how to use desc inside pl sql block? [message #518081 is a reply to message #518079] |
Mon, 01 August 2011 03:33   |
 |
vino06cse57
Messages: 131 Registered: July 2011 Location: chennai
|
Senior Member |
|
|
create or replace procedure t_name_column(abc in char)
as
t_name varchar2(30);
t_column_name varchar2(300);
begin
select table_name ,column_name into t_name,t_column_name
from user_tab_columns where table_name like abc;
end;
begin
t_name_column('CUSTOMER');
end;
will it works
[Updated on: Mon, 01 August 2011 03:35] by Moderator Report message to a moderator
|
|
|
|
|
Re: how to use desc inside pl sql block? [message #518092 is a reply to message #518083] |
Mon, 01 August 2011 03:55   |
 |
vino06cse57
Messages: 131 Registered: July 2011 Location: chennai
|
Senior Member |
|
|
create or replace procedure t_name_column(table_start in char)
as
t_name varchar2(30);
t_column_name varchar2(300);
begin
for c5 in (select table_name ,column_name
into t_name,t_column_name
from user_tab_columns where table_name like 'table_start||%')
loop
dbms_output.put_line(t_name ||t_column_name);
end loop;
end;
begin
t_name_column('ACCOUNT');
end;
Its not going through loop
[Updated on: Mon, 01 August 2011 04:06] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: how to use desc inside pl sql block? [message #518130 is a reply to message #518078] |
Mon, 01 August 2011 08:14  |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
vino06cse57 wrote on Mon, 01 August 2011 04:25I need to get the table name and their corresponding column name,to export into MS-Excel
Just for shits and giggles, even if DESCribe did work in PL/SQL, how would you use what it returned?
|
|
|