Home » Developer & Programmer » Forms » Oracle form Builder (10 g)
Oracle form Builder [message #673042] Sat, 03 November 2018 00:59 Go to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

Hello , this is what i want is that i want to copy one row means the selected rows from one table to another how to do this please any one write query for me
  • Attachment: formm.png
    (Size: 76.38KB, Downloaded 434 times)
Re: Oracle form Builder [message #673043 is a reply to message #673042] Sat, 03 November 2018 02:41 Go to previous messageGo to next message
Michel Cadot
Messages: 67850
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

My suggestion (as you post this in "Suggestions & Feedback" forum) is that you'd find for your topics titles more specific that the one you used: "oracle form", "FORM BUILDER", "Form Builder", "Oracle form Builder".

Re: Oracle form Builder [message #673045 is a reply to message #673043] Sat, 03 November 2018 06:21 Go to previous messageGo to next message
Littlefoot
Messages: 21671
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You can "copy" those values by inserting them into a table (and then perform execute query in the bottom block), or literally putting values into those items.

The first approach looks like
insert into bottom_table (col1, col2, ...)
values (:upper_block.item1, :upper_block.item2, ...);
go_block(:bottom_block);
execute_query;

The second one:
:bottom_block.item1 := upper_block.item1;
:bottom_block.item2 := upper_block.item2;
...
Re: Oracle form Builder [message #673050 is a reply to message #673045] Sat, 03 November 2018 13:45 Go to previous messageGo to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

the 2nd approach works but the approach does not work what is the reason
Re: Oracle form Builder [message #673051 is a reply to message #673050] Sat, 03 November 2018 13:46 Go to previous messageGo to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

The first approach is so simple but does not work what will be the problem , it gives me the following error
FRM:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-01400
kindly guide me what is the problem
My code
INSERT INTO PURCHASE_RETURN(BILL_NO, ITEM_NAME,QTY,RATE,DISCOUNT,AMOUNT)
VALUES (:PURCHASE.BILL_NO,:PURCHASE.ITEM_NAME,:PURCHASE.QTY,
:PURCHASE.RATE,:PURCHASE.DISCOUNT,:PURCHASE.AMOUNT);

EXECUTE_QUERY;

[Updated on: Sat, 03 November 2018 13:46]

Report message to a moderator

Re: Oracle form Builder [message #673052 is a reply to message #673051] Sat, 03 November 2018 13:50 Go to previous messageGo to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

how to put sequence number in insert statement
Re: Oracle form Builder [message #673062 is a reply to message #673052] Sun, 04 November 2018 04:20 Go to previous message
Littlefoot
Messages: 21671
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ORA-01400 means that you're trying to put NULL into a column that doesn't allow NULL values.

If it is some kind of an "ID" (as you mentioned a "sequence"), then you'd use something like this:
insert into purchase (id, bill_no, ...)
  values (sequence_name.nextval, :purchase.bill_no, ...);
Previous Topic: FORM BUILDER
Next Topic: POST firing DB triggers
Goto Forum:
  


Current Time: Fri May 14 18:56:48 CDT 2021