Home » Developer & Programmer » Forms » Batch creation at 10 records [merged by jd] (Oracle10G)
Batch creation at 10 records [merged by jd] [message #535373] Tue, 13 December 2011 14:16 Go to next message
Llagi
Messages: 2
Registered: December 2011
Junior Member
Hi,
Would appreciate help with my request.
I'm working on a Self assessment project regarding our tax returns. Currently, this is how it works - a return lodged generates a return number, but is batched later. In the change proposed, they want the same process whereby a return is generated still, but at a count of 10 returns generated on the same screen, a batch is to be created and these 10 returns will have to be added to that batch. We are on Oracle 10G and work with Forms, Reports10G and TOAD/SQL Plus as tools so I was thinking of changing it on Post-Query but suggestions are to add on to System Parameter table.
Any help is highly appreciated...
Thanks.
Re: Batch creation at 10 records [merged by jd] [message #535403 is a reply to message #535373] Wed, 14 December 2011 01:02 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
My problem is that I don't understand the problem (most probably because I'm not that good in English). Someone else might know better, but - if you wish, could you explain it once again (you know, as if I was a 5 years old child), possibly with your current form screenshot and similar stuff that would illustrate the problem.

I'm not sure what would POST QUERY trigger do here, and what is a "System Parameter table".
Re: Batch creation at 10 records [merged by jd] [message #536411 is a reply to message #535403] Tue, 20 December 2011 15:14 Go to previous messageGo to next message
Llagi
Messages: 2
Registered: December 2011
Junior Member
OK, will try and simplify it.
I have a form that when a tax return is lodged and saved, it generates a return number. Now the same process is done, but how users want it is when 10 returns are lodged by an individual user,it automatically generates a batch number and and all these returns are now reflected on the database table with the batch number assigned to each of the 10returns.

Currently, they go to another form where they create a new batch. What can i do to automatically assign these 10 returns with a new batch number?

There are 3 tables, one is Tax_Returns table where all returns are reflected, one is Tax_Return_Batches table where all batches created are reflected and the other table is a sequence table, so every batch assigned increments a value by 1 on this table.

I hope this is clear enough.
Re: Batch creation at 10 records [merged by jd] [message #536465 is a reply to message #536411] Wed, 21 December 2011 01:20 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I think I understand now; thank you for the explanation.

You said that 10 returns make 1 batch. If you want to do that automatically, I can think of two options.

Step 0 (zero): create a stored procedure which will do the "smart" part of the job - count returns per an individual user and - if there are 10 returns, generate a new batch number and assign it to these returns.

The first option means that you should create a database trigger which would fire AFTER INSERT into the TAX_RETURNS table. It would call the procedure (created in step 0) which would do the rest of the job.

Another one is to schedule step 0 procedure to run as a job (you'd use DBMS_SCHEDULER package to do that). How frequently? I don't know, it most probably depends on how many returns you have. If there are 2 returns a day, you could schedule it daily. If there are 2 returns per hour, you'd schedule it every 10 minutes or so. If there are far too many returns (such as CSV file load via SQL*Loader), option 1 is probably a better choice, unless you don't really care WHEN a batch number is set, so you could schedule a job once a day (for example, at 2 AM, when nobody is working).

[Updated on: Wed, 21 December 2011 01:21]

Report message to a moderator

Previous Topic: Oracle 9i
Next Topic: How to pass parameter from critaria form to report
Goto Forum:
  


Current Time: Mon Jul 15 17:58:58 CDT 2024