Using Queries with Forms [message #163712] |
Sat, 18 March 2006 12:11 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
pam_W_85@yahoo.co.uk
Messages: 4 Registered: March 2006 Location: Manchester
|
Junior Member |
|
|
Hello,
I am trying to link a query that will run in an oracle form but the user will need to enter the criteria for the search. I have the code to run this query in islq and it works. The code is:
SELECT * from members
WHERE member_name = '&Enter_name';
I think the code should be:
CREATE VIEW existingmember AS (
SELECT * from members
WHERE member_name = '&Enter_name');
I just don't know how to do the last part '&Enter_Name' I think I need to use a PARAMETER?
Pam
|
|
|
|
Re: Using Queries with Forms [message #163740 is a reply to message #163719] |
Sun, 19 March 2006 04:59 ![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) |
pam_W_85@yahoo.co.uk
Messages: 4 Registered: March 2006 Location: Manchester
|
Junior Member |
|
|
Sounds simple! Could you explain how to do this? When I create the form I use the data block wizard.. should I select the tables I need for the query? Where should I put the code for the query? Can I make a button to run the query?
Pam
|
|
|
|
|
Re: Using Queries with Forms [message #163764 is a reply to message #163740] |
Sun, 19 March 2006 15:17 ![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) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
OK, so you followed the Data Block Wizard and created a default form. That's all you've been supposed to do, nothing more and nothing less to make it work.
One of the simplest forms could be the one created on 'dept' table of Scott's schema (you know, 'scott/tiger'?). When such a form is created, run it.
To enter query mode, click on "Enter query" button on the toolbar (or, alternatively, click on "Help - Show keys" menu to find out which (combination of) key(s) enters query mode - could be F7, for example).
Now you're in query mode and database waits for you to enter query condition. Enter, for example, value of 10 into the 'deptno' field.
To execute query, click on "Execute query" button (or, also in "Help - Show keys" menu, find out key(s) to do it - might be F8). Now you'll see the whole record containing data about department number 10.
That should be all.
|
|
|
|