Need help in Oracle Form Check box [message #669138] |
Wed, 04 April 2018 14:40 |
Djpats
Messages: 17 Registered: January 2018
|
Junior Member |
|
|
Hi, Guys.
Need help in oracle forms checkbox...
I have Database databolck,having multiple records in it,
My current scenario is..
i have some user input fields and 2 more fields like revised invoice amount and credit amount in a datablock. These revised invoice amount and credit amount calculates amount dependns on procedure. Which i m calling in sibmit button.this means when i enter input values and press submit button credit amount and revised invoice amount calculated from procedure....this requirment is working fine for single record...
Now I have added check box to datablock,as non database item.
So,My requirment is like, When user check checkbox for multiple recods and press submit button, revised invoice amount and credit amount should be calculated for all the selected records....
how can i do this requirment.
Thanxxxx in advance... Any help will be appreciated..
|
|
|
|
Re: Need help in Oracle Form Check box [message #669147 is a reply to message #669145] |
Thu, 05 April 2018 05:45 |
Djpats
Messages: 17 Registered: January 2018
|
Junior Member |
|
|
Hi Thnxxx for reply,
I m using below code but its not working...
GO_BLOCK ('BLOCK_NAME');
IF :BLOCK_NAME.CURRENT_RECORD_FLAG = 'Y'
THEN
l_record := :SYSTEM.cursor_record;
FIRST_RECORD;
LOOP
IF :SYSTEM.cursor_record <> l_record
THEN
:BLOCK_NAME.CURRENT_RECORD_FLAG := 'N';
END IF;
pkg_name.revised_invoice_amount ( PARAMENTERS & DTAILS TO CALCULATE REVISED INVOICE AMOUNT);
IF :SYSTEM.LAST_RECORD = 'TRUE'
THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
END IF;
GO_RECORD (:SYSTEM.cursor_record);
|
|
|
Re: Need help in Oracle Form Check box [message #669148 is a reply to message #669147] |
Thu, 05 April 2018 05:50 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Your code checks if the record that's highlighted when the button is pressed has the checkbox checked and if so calls the procedure for all the other records in the block.
That doesn't match your requirements.
You need to ditch the initial IF - you should loop regardless of what the current record is.
The second if should be checking the value of the checkbox, not checking which row you're in.
|
|
|
|
|
|
Re: Need help in Oracle Form Check box [message #669152 is a reply to message #669151] |
Thu, 05 April 2018 08:57 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
ORA-01422 is "exact fetch returns more than requested number of rows"
You need a select statement (or insert/update/delete/merge with a sub-query) to throw that error.
Your posted code doesn't have anything like that so the error must have come from somewhere else - the procedure perhaps.
|
|
|
|
|
|
Re: Need help in Oracle Form Check box [message #669204 is a reply to message #669193] |
Sun, 08 April 2018 07:48 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Any SELECT (apart from the obvious ones) that can return more than a single row are candidates for the TOO-MANY-ROWS error, *including* the procedure code you didn't post. In my opinion - no, don't post it. 300 lines of a trigger is probably too much as well.
Which Forms version is it? You should debug it, either by including MESSAGE calls within that code so that you'd know where the execution currently is, so - once it fails - you'll know which SELECT you have to investigate. If you're on Forms 10g onwards, there's the Debug mode - set the breakpoint at the beginning of the trigger code and trace its execution.
This won't fix the error, but: all those SELECT ... FROM DUAL at the beginning could/should be rewritten, for example
No : SELECT TRUNC (SYSDATE, 'Month') INTO l_first_day FROM DUAL
Yes: l_first_day := trunc(sysdate, 'Month');
|
|
|
|
|