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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mercator w/Oracle - problem with relations 1

Status
Not open for further replies.

Zaldor

Programmer
Nov 25, 2003
6
US
Hi - i'm having a problem with inserting records properly into a relational database - I have EDI 850 input, and I am attempting to insert into multiple tables (Header, Detail, items, etc) - The problem I am havnig is when I insert into the database, the mercator map inserts all the headers, then all the detail, etc. This is causing the Key fields on the secondary level to all have the last header key. Example:
Header 1 - Detail 5
Header 2 - Detail 5
Header 3 - Detail 5
Header 4 - Detail 5

I need them to be as follows:
Header 1 - Detail 1
Header 2 - Detail 2
Header 3 - Detail 3
Header 4 - Detail 4

I am using Extract when pulling the data out of the 850, and the trees are created from the table directly.

Can anyone help? Thanks!

-Z-
 
I think your problem is that you areprocessing Headers in one card and Details in a secind card. What I have done in these circumstances is for each input record (or extracted record) have a functional map which runs a map which does the database update. That way you are just processing one set of database records for each input record.
Jan
 
Maybe I don't follow - how do I create an output card that references multiple database queries??
 
I figured it out - thanks for your help!!

What I needed to do what create a map that fires off another executable map via a RUN() function - And passes the data via the echo command "-IE1S"

Once I did that, it all fell into place!
 
OK - new problem, but similar situation - I need to insert records for one order's items, then the address where the order is shipped for that item. Then the next item in the order, then the same address for that item.

Is there any way to call a functional map from another functional map??
 
Zaldor
You are either going to have to run the map in burst mode for the header input data and use the DB settings on the output card OR use PUT("DB"....) instead to control when you write to the various tables.

To answer your question you can call a Func maps from within another Func map. If you look in the examples/xml folder for Mctr6.7 it has a sample.
Tim
 
Maybe I should have clarified, how to run a functional map when there are no group items remaining, such as from an item level?

What I need to do is write the output for the addresses after each item is written, it seems the burst mode is only for input?

Order>
Item1>Address1
Item2>Address1
Item3>Address1
End Order.

Is this possible?
 
I attempted the BURST method, but when I attempt to write to the detail tables, I get the error:

"Message: [Microsoft][ODBC driver for Oracle][Oracle]ORA-08002: sequence EDI_ID_SEQ.CURRVAL is not yet defined in this session"

Any clues?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top