Home » Developer & Programmer » Forms » Insert into form first then into the database
Insert into form first then into the database [message #660773] Mon, 27 February 2017 01:00 Go to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
/forum/fa/13466/0/
1st insert Multiple record into form then into the DB
  • Attachment: TEST.JPG
    (Size: 26.15KB, Downloaded 1923 times)
Re: Insert into form first then into the database [message #660774 is a reply to message #660773] Mon, 27 February 2017 01:32 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You don't need any of those buttons.

If it is a datablock (and yes, it should be), just enter values into it. Once you're done, commit changes you've made - there's the "Save" button in the toolbar, or you can use a keyboard shortcut.
Re: Insert into form first then into the database [message #660775 is a reply to message #660774] Mon, 27 February 2017 01:43 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
Its just a example... i need it because too many calculation made before inserting record like this.. like Vat Sale.tax Discount etc.
Re: Insert into form first then into the database [message #660776 is a reply to message #660775] Mon, 27 February 2017 01:53 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What's the purpose of an example which doesn't show what you really need? It's completely useless.

Anyway, I still think that you don't need to do anything. If you need to compute certain values, do that in WHEN-VALIDATE-ITEM (or WHEN-VALIDATE-RECORD) triggers. Storing values into the database isn't related to these computations.
Re: Insert into form first then into the database [message #660781 is a reply to message #660776] Mon, 27 February 2017 04:15 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
/forum/fa/13467/0/
when entry on column block 1 and insert button pressed, same data float on block 2 and clear the block 1.. then insert again on block 1 n its float on block 2 second row...
How to do like this, just 1 clue needed
or some test .fmb file
  • Attachment: TEST1.JPG
    (Size: 16.13KB, Downloaded 1901 times)
Re: Insert into form first then into the database [message #660782 is a reply to message #660781] Mon, 27 February 2017 04:29 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why would you want to do that? You are making simple things complicated. An ordinary tabular layout form would do.
Re: Insert into form first then into the database [message #660783 is a reply to message #660781] Mon, 27 February 2017 04:31 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You'd need to go to the 2nd block, use next_record to go to an empty record at the end (if necessary), assign the values, go back to block 1 and clear it.
All those steps are very straight forward.
Re: Insert into form first then into the database [message #660785 is a reply to message #660783] Mon, 27 February 2017 04:47 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
True, they are.

In my opinion:
- benefits: 0
- drawbacks: as many as you want
Re: Insert into form first then into the database [message #660786 is a reply to message #660785] Mon, 27 February 2017 04:49 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm not sure that there's any need for this either
Re: Insert into form first then into the database [message #660787 is a reply to message #660783] Mon, 27 February 2017 05:26 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
needed some script
when-button-pressed trigger :block1.col1,:block1.col2 into go_block ('block2'); :block2.col1,:block2.col1;
next_record; go_block ('block1') cler_item ('col1,col2');
this is example not proper coding you all know better Razz

needed script or some link where i get any clue about this
Re: Insert into form first then into the database [message #660789 is a reply to message #660787] Mon, 27 February 2017 05:35 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
We do know better, you don't - this isn't a code writing service. We're not here to do your job for you.

And when I say this is very straight forward - I really mean it.
So try and actually write some code based on what I said. If you get stuck, post what you tried here and we'll show you where you're going wrong.
Re: Insert into form first then into the database [message #660797 is a reply to message #660789] Mon, 27 February 2017 07:36 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
BEGIN
	:BLOCK2.IN1 := :ENT1;
	:BLOCK2.IN2 := :ENT2;
	CLEAR_BLOCK;
END;

when inserting another row it replace on row1
Re: Insert into form first then into the database [message #660800 is a reply to message #660797] Mon, 27 February 2017 08:17 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
I described five steps, you've got 2 of them.
Add the missing ones.
Re: Insert into form first then into the database [message #660837 is a reply to message #660800] Mon, 27 February 2017 11:46 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
DECLARE
	X VARCHAR (10) := :ENT1;
	Y VARCHAR (10) := :ENT2;
BEGIN
	GO_BLOCK('BLOCK2');
	NEXT_RECORD;
	:BLOCK2.IN1 := X;
	:BLOCK2.IN2 := Y;
	GO_BLOCK('BLOCK1');
	CLEAR_RECORD;
END;
It's work as expected
Thank you very much.... cookie Razz

[Updated on: Mon, 27 February 2017 11:53]

Report message to a moderator

Re: Insert into form first then into the database [message #660838 is a reply to message #660837] Mon, 27 February 2017 11:54 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
Nothing is Impossible....
Re: Insert into form first then into the database [message #660860 is a reply to message #660838] Mon, 27 February 2017 15:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
sr8464 wrote on Mon, 27 February 2017 09:54
Nothing is Impossible....
try lighting a safety match using a bar of Ivory soap
Re: Insert into form first then into the database [message #660869 is a reply to message #660860] Mon, 27 February 2017 22:45 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
Surprised
Re: Insert into form first then into the database [message #660878 is a reply to message #660869] Tue, 28 February 2017 03:57 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You don't need the variables.
Also when declaring variables that hold data the corresponds to database columns use <table_name>.<column_name>%type instead of declaring the datatype explicitly.
That way, if you change the size of the column the variables are resized automatically.
e.g.
x emp.emp_id%type;

And you should get in the habit of always including the block name when referring to forms items.
Re: Insert into form first then into the database [message #660882 is a reply to message #660878] Tue, 28 February 2017 05:40 Go to previous messageGo to next message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
ok
Re: Insert into form first then into the database [message #661003 is a reply to message #660882] Sat, 04 March 2017 07:46 Go to previous message
sr8464
Messages: 82
Registered: February 2017
Location: India
Member
SOLVED...
Previous Topic: Calculation mode need closing value as shown in image (3 merged)
Next Topic: Forms 11g
Goto Forum:
  


Current Time: Fri Mar 29 09:17:34 CDT 2024