.......... Dynamic Table selection [message #164864] |
Mon, 27 March 2006 03:28 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
orcl_dba
Messages: 84 Registered: March 2005
|
Member |
|
|
Hi all
I am facing a bit of problem in my application.
The application consists of 30 tables, and each table has different number of columns from 14-30 each .
Every column is a parameter whose value are viewed by user.
I want my user to select a parameter from LOV
and press button, and my application will show the users, the values for a certain parameter agains each record.( primary key);
Suppose Height is a parameter.
If my user selects Height, the application should list all the heights of teachers in the school.
This is quite simple..but the only problem is that user is unaware that parameter is stored in which table.
One wy of doing it is to use 25 IF statements.
suppose
IF :text_Parameter IN ('Height','Complexion','Hair COLOR') then
cursor c1 is select :text_parameter from Physical_appearnace
where ..........
end if;
The other way of doing it is
cursor c1 is select :text_parameter from :text_table
wehre .......
Text_table is a text box which is automatically fills in when a parameter is selected. through LOV...( i have gathers the parameter name and the table name in a seperate table, and use LOV to extract parameter name from that table. ).
Now the 2nd query is more dynamic but it is giving me compilation error..
It says that table name.. the identified must be ......
it shows that it is not accepting the table name at run time. , while the same query works well in sqllplus using bind variable concept.
ANy body who can help out .. so that i can select the t able dynamicaly as well
Regards
|
|
|
Re: .......... Dynamic Table selection [message #165003 is a reply to message #164864] |
Tue, 28 March 2006 00:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Your use of the word 'parameter' conflicts with Oracle's definition for a Forms parameter. I don't understand what you have done but search this forum for 'query data source'. I am confident that someone else has done the same thing before.
David
|
|
|