show all records. [message #605033] |
Tue, 07 January 2014 01:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 625 Registered: August 2002
|
Senior Member |
|
|
Master Table Structure: Student (Class, Section, stuid, name, f_name,mob)
Detail Table Structure: Student (class,section,stuid,name,f_name,mob)
please see the attached file.i want to show all records based on the combo value. if the class value is prep then it shows me the only record of "Prep". please advised. i have used cusor.but show nothing.in this picture the combo values or query only. and in detail table is display items.
please advised.
|
|
|
|
|
|
Re: show all records. [message #605066 is a reply to message #605056] |
Tue, 07 January 2014 04:30 ![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) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The reason you got nothing in your form is the error caused in code you wrote. It raises (unhandled) TOO-MANY-ROWS error (see the status line at the bottom of the screenshot, it says ORA-01422). Therefore, you should first fix that. How? Copy that code into SQL*Plus, debug it, fix the error. Then copy/paste it back into a form trigger.
Besides, what kind of a data model is that? The first message you posted suggests that both master and detail tables are exactly the same. What's the purpose of such a decision? Sounds VERY strange to me.
Finally, I'd also suggest you to use standard, built-in Forms functionality which enables you to easily perform query operations - in that case, you need only one block and no code at all.
|
|
|
Re: show all records. [message #605070 is a reply to message #605056] |
Tue, 07 January 2014 04:39 ![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) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
shahzad-ul-hasan wrote on Tue, 07 January 2014 10:07pls advised me the trigger how i can write...
You don't need any triggers for standard forms query functionality
|
|
|
Re: show all records. [message #605071 is a reply to message #605066] |
Tue, 07 January 2014 04:41 ![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) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Littlefoot wrote on Tue, 07 January 2014 10:30The reason you got nothing in your form is the error caused in code you wrote. It raises (unhandled) TOO-MANY-ROWS error (see the status line at the bottom of the screenshot, it says ORA-01422). Therefore, you should first fix that. How? Copy that code into SQL*Plus, debug it, fix the error. Then copy/paste it back into a form trigger.
I suspect the select will work just fine in sqlplus.
I suspect its a select to get all rows data and fetchs into a single set of datablock items.
|
|
|
Re: show all records. [message #605073 is a reply to message #605066] |
Tue, 07 January 2014 04:48 ![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) |
shahzad-ul-hasan
Messages: 625 Registered: August 2002
|
Senior Member |
|
|
DECLARE
A VARCHAR2(200);
B VARCHAR2(22);
BEGIN
SELECT DISTINCT CLASS,SECTION INTO A,B FROM STUDENT;
IF :CL=A AND :SEC=B THEN
EXECUTE_QUERY;
ELSE
GO_BLOCK('STUDENT');
END IF;
END;
Please see the attached code..
select distinct stuid,mob from student
where class='PREP' and Section='A';
....
15 Rows Selected.
[Updated on: Tue, 07 January 2014 04:50] Report message to a moderator
|
|
|
Re: show all records. [message #605079 is a reply to message #605073] |
Tue, 07 January 2014 04:56 ![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) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You're selecting multiple values into scaler variables - that'll always result in ORA-1422.
Again - why are you not using default query functionality?
|
|
|
|
|
|