Where clause problem [message #438041] |
Wed, 06 January 2010 23:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
mahmud732
Messages: 82 Registered: October 2009 Location: Dhaka
|
Member |
|
|
Dear all,
I have a table named test(A VARCHAR2(10),B VARCHAR2(10),C VARCHAR2(10));
Now i want to select all from table test with where clause:
I would like to use where clause like in the form.
select * from test where :x=100;
Here x will be A=100 OR B=100 OR C=100
That is when i pass vallue for x=A then this will return
all the rows according to column A=100;
when i pass vallue for x=B then this will return
all the rows according to column B=100;
when i pass vallue for x=C then this will return
all the rows according to column C=100;
How does it possible.
Its recomended that i have done it using Report builder.
Now i need it to Oracle Developer 10g forms.
It is very urgent.
Regards
Mahmud.
|
|
|
|
Re: Where clause problem [message #438133 is a reply to message #438060] |
Thu, 07 January 2010 04:11 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
mahmud732
Messages: 82 Registered: October 2009 Location: Dhaka
|
Member |
|
|
Dear Mr. Martin,
This is a solution of one type.
But I need the following:
I have a form with two text field field1 and field2 with a button.
field1 gives month as field2 gives column name
and the button containing following code:
insert into x(a,b,c)
select a,b,c from test where month=:month and
field2=100;
here field2 will be a or b or c;
this return null;
How does it possible to recover,Please...........
Regards
Mahmud
|
|
|
|
Re: Where clause problem [message #438716 is a reply to message #438133] |
Mon, 11 January 2010 23:29 ![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 |
|
|
I really, really hope that this is a student design and not a real world production application.
I believe that you need to rethink your design as expecting a user to know the names of table columns is not realistic.
David
|
|
|