Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle, Refresh or Update while SQL Executing

Status
Not open for further replies.

MrStiffler

Programmer
Jan 7, 2004
25
CH
I have a Series of object which i test to be present in a Oracle Table.
In the Serie there could be more then one of a object, so there could be 1000 of the same object.
Normaly the object is present in the DB, but if there i a new object in the serie, i write a record to the database with that record. But because the object occures several times, the card with a (s) will run s-Times, so there will be 1000 new record in the DB, but i only need one.

During one looping Serie of SQL statements, how can in update the datebase, so that the next loop detect the presents of the object and don't write it again to the DB.

The SQL Serie looks like this:

=IF(objectX(s)=objectY(s), NONE,

+DBLOOKUP("INSERT INTO TABLE ..... )
+DBLOOKUP("INSERT INTO TABLE ..... )
+DBLOOKUP("INSERT INTO TABLE ..... )

+DBLOOKUP("COMMIT WORK",....)
)
Here i tried it with a commit work to accualize the records.
Do you have a idea why it don't work. Maybe you have another better statement for that thing.
thank you
stiff....
 
You can't have in insert (or update) in the same rule where you check for the result of that insert. You can do one insert in output card 1 (with a commit by statement), then in the next element have another DBLOOKUP, scope of card should be card also. Might be a better idea to have stored proc do this.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top