Home » Developer & Programmer » Forms » Transaction Data which should store temporarily in database (Oracle Forms 6i, Windows 7)
icon5.gif  Transaction Data which should store temporarily in database [message #596013] Tue, 17 September 2013 07:02 Go to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
Hi Oracle Experts,

This is a clarification that
a question been asked by an interviewer
in an technical interview session;

i am posting this question below which i need a answer in your point of view;

I have a Data entry form which is a multirecord block;

Question: for example that form has 10 to 25 fields or columns more than that
all the data has been entered, but before committing or saving that form
i need to cross check the the data with a select query,
whether the data entered is correct or not but before committing, that data it should be posted into that table if i find that one data is entered wrongly then i will modify that
and again cross check and save the transaction permanently into the database table?

how to achieve it?

i have answered the question but i like to know you guys answers too...

pls reply?


Re: Transaction Data which should store temporarily in database [message #596014 is a reply to message #596013] Tue, 17 September 2013 07:26 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
1. What was your answer?
2. While accepting the values, isn't it possible to keep a validation, and accpet only the correct values.
3. Or else, if point 2 is not possible, then a piece of code that would modify the input values in the format you want to store into the DB.
Re: Transaction Data which should store temporarily in database [message #596022 is a reply to message #596014] Tue, 17 September 2013 07:43 Go to previous messageGo to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
hi lalit,

no validation is required to check the data while data entering,
may be a piece of code may be needed but i didnt tried that yet.

I answered like;

we can have 2 tables one as a temporary table and another one is the
transaction table, while entering data it should be saved in that
temporary table after committing the form the temp table values got
deleted or rollback and the cross checked data can be stored permanently into the
tranasaction table.

this was my answer but is't a correct solution or anyother way u can?
Re: Transaction Data which should store temporarily in database [message #596024 is a reply to message #596022] Tue, 17 September 2013 07:57 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
To provide a generic answer would be impossible unless we know the requirements. There could be multiple solutions.

If a code is used, it should be robust enough to cover all the possible scenarios that might come up in production. If temp/staging table is used, then it increases the overhead to maintain them. Alos, the Normalization should not be violated at any stage. And so on....

So, one can arrive at a solution, only after the requirements are clear and freezed.
Re: Transaction Data which should store temporarily in database [message #596025 is a reply to message #596024] Tue, 17 September 2013 08:04 Go to previous messageGo to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
yes to this we should write code to acheive, my idea is
to create two blocks one is a database block and another is a
control block where we can use copy command to copy all the data into the
column of a database block and save it in that temp table(a non database block) and rollback it while the form is saved.

other any idea?


[EDITED by LF: removed unnecessary quote of the whole previous message]

[Updated on: Tue, 17 September 2013 10:52] by Moderator

Report message to a moderator

Re: Transaction Data which should store temporarily in database [message #596038 is a reply to message #596025] Tue, 17 September 2013 11:07 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Stalin4d, I have difficulties in understanding what you are asking. Why? Because you use no punctuation (but commas, and they are placed in the most unusual places so they don't help either). If possible, try to write in sentences. Terminate every sentence with a dot (full stop). If you manage to write your messages that way, that would be really nice.

From what I managed to understand, here's what I think: the principle you described is wrong. Validation, in a Forms application, should be done within WHEN-VALIDATE-ITEM trigger (on an item level) and/or WHEN-VALIDATE-RECORD trigger (on a record level). I believe that it is useless to let users enter (for example) 10 records, each consisting of 10 to 25 items (as you said) and then fail the whole action because something was wrong.

Quote:

If i find that one data is entered wrongly then i will modify that
Well, that would be some fancy code. How exactly will you modify it? If user enters 1, how do you know that it is wrong and modify it to 2. Why 2 and not 3 or 300?
What would you do with data you can't fix? Rollback everything?

If you insist on your approach, then why do you need two blocks? One would suffice, and it would be a data block created on the top of a global temporary table. You'd let users enter data into it, commit, perform that complex check & fix action, and - finally, when you are satisfied with the result, simply copy contents of the GTT table into the transaction table.
Re: Transaction Data which should store temporarily in database [message #596133 is a reply to message #596038] Wed, 18 September 2013 04:09 Go to previous messageGo to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
Quote:
If you insist on your approach, then why do you need two blocks? One would suffice, and it would be a data block created on the top of a global temporary table. You'd let users enter data into it, commit, perform that complex check & fix action, and - finally, when you are satisfied with the result, simply copy contents of the GTT table into the transaction table.


That is the point u have catched, i got the idea too, we need to first insert that data into a Global Temporary table and then if satisfied with then we can copy or insert the contents into the Transaction Table and rollback after inserting into transaction table.
Re: Transaction Data which should store temporarily in database [message #596135 is a reply to message #596133] Wed, 18 September 2013 04:13 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
stalin4d

... and rollback after inserting into transaction table

Rollback what? You don't do any rollback, you - eventually - DELETE data from the GTT.
Re: Transaction Data which should store temporarily in database [message #596136 is a reply to message #596133] Wed, 18 September 2013 04:14 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
why is a rollback needed?
icon7.gif  Re: Transaction Data which should store temporarily in database [message #596154 is a reply to message #596136] Wed, 18 September 2013 06:15 Go to previous messageGo to next message
stalin4d
Messages: 226
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
Yes no rollback needed, i mean to delete the data from the GTT.

[Updated on: Wed, 18 September 2013 06:16]

Report message to a moderator

Re: Transaction Data which should store temporarily in database [message #596156 is a reply to message #596154] Wed, 18 September 2013 06:25 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
ON COMMIT DELETE...and that's it.
Re: Transaction Data which should store temporarily in database [message #596157 is a reply to message #596156] Wed, 18 September 2013 06:30 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Right (unless, for some reason, rows on commit should be preserved).
Previous Topic: Form Builder 6i Crashes
Next Topic: Web.Show_Document Bring to Focus
Goto Forum:
  


Current Time: Mon Jul 01 10:34:48 CDT 2024