Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 26th June 2003, 14:32
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Exchange - Only need to import date for a couple of table fields

Hello,

I want to update a couple of fields in the tiitm001 table.

I have created an Exchange scheme detailing the two fields that I want to update/overwrite. But each time I run the Exchange Import I get 606 errors. When checking the logs I can see that these errors are related to tiitm001 fields that I'm not importing.

At first I thought my exchange scheme needs to include ALL table fields but if you read the help for tuxch0122m000 it says: -

"All TRITON fields which must be filled from ASCII file fields must be specified as individual relations. Fields which are not defined will remain empty when the new record is added, and old values will be retained in case of overwriting. At least all the fields of the primary index of the TRITON table must be defined."

One of my relations is the primary index(item) of the itm001 table.

I have tried creating field relations just for the two fields that I wish to update linking them to the fields in my ASCII file. I've also included all other fields from the itm001 table telling Exchange to use the default value.

Can somebody please point me in the right direction on how to get my update to work?

thanks

PJ
Reply With Quote
  #2  
Old 26th June 2003, 14:56
kbartelds kbartelds is offline
Senior Member
 
Join Date: Feb 2003
Location: Netherlands
Posts: 264
kbartelds is on a distinguished road
Baan: B40c4 - DB: Oracle 7 - OS: Sun Solaris
Hi,

If you're seeing reference errors in logfile, and manual change of the item table does not give any problem, you will be inserting records instead of update/overwrite. Might be item alignment? Set insert to false, only use update. If no records are being updated you have an alignment problem, which can be solved be using a field script with shiftl$ or shiftr$.

Regards,
Klaas
Reply With Quote
Sponsored Links
  #3  
Old 26th June 2003, 14:58
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 573
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hi PJ,

you are right. In your case you have only to include the item field (key field) and the fields that you wants to overwrite/update in your table field definition.

So it seems for me that the settings in "Maintain Table Relations (Import)" and/or "Maintain Field Relations (Import)" are not correct. Maybe you can post the settings you made.

Rgds,
Juergen
Reply With Quote
  #4  
Old 26th June 2003, 15:12
NvanBeest's Avatar
NvanBeest NvanBeest is offline
Guru
 
Join Date: May 2003
Location: South Africa
Posts: 521
NvanBeest is on a distinguished road
Baan: BaanIVc4 - DB: Oracle, TBase, SQL Server - OS: AIX, Linux, Window$
If I read it correctly, all you want to do is update date fields for existing record. I presume your ASCII file has the format:
Code:
item(16 chars, aligned correctly)|date1 (format dd/mm/yyyy)|date2 (format dd/mm/yyyy)
Then the easiest would be to point the Exchange scheme to tuxch005 instead of tiitm001. For the first couple of fields you should assign fixed values, and on the field newv create a condition with the following:
Code:
string  dat(12)
string  msg(30)
string  path(128)
string  line(256)
string  item(16)
string  date1(10)
string  date2(10)
long    ftxt
long    cntr
long    rslt

path = getenv$("HOME") | Or whatever...
cntr = 0

ftxt = seq.open(path & "<i>filename</i>", "r")
if (ftxt < 1) and (ftxt <> -2) then
  msg = sprintf$("Error %d opening file", ftxt)
  return(msg)
endif
if ftxt = -2 then
  return("File not found")
endif

db.retry.point()
while seq.gets(line, 256, ftxt) = 0
  rslt = string.scan(line, "%s|%s|%s", item, date1, date2)

  if rslt = 3 then
    select  tiitm001.<b>date1</b>, tiitm001.<b>date2</b>
    from    tiitm001 for update
    where   tiitm001._index1 = {:item}
    selectdo
      tiitm001.<b>date1</b> = date.to.num(lval(date1(7;4)),
                                          lval(date1(4;2)),
                                          lval(date1(1;2)))
      tiitm001.<b>date2</b> = date.to.num(lval(date2(7;4)),
                                          lval(date2(4;2)),
                                          lval(date2(1;2)))
      db.update(ttiitm001, db.retry)
    endselect
  endif

  cntr = cntr + 1
endwhile
commit.transaction()

|* If you want to delete the file after the update, use this:
seq.unlink(path & "<i>filename</i>")
|* else, just close the file
seq.close(ftxt)

dat = dte$()
return(sprintf$("Updated %d items at ", cntr) &
        dat(1;2) & "/" & dat(3;2) & "/20" & dat(5;2) & " " &
        dat(7;2) & ":" & dat(9;2) & ":" & dat(11;2))
Just fix the date1 and date2 fields, and the filename, and it should work the way you want it!
__________________
Regards,
Nico
Reply With Quote
  #5  
Old 26th June 2003, 16:06
ssbaan's Avatar
ssbaan ssbaan is offline
Member
 
Join Date: Jan 2002
Location: Ohio, USA
Posts: 91
ssbaan is on a distinguished road
Baan: 4c2 - DB: Oracle - OS: Unix
exchange scheme problem

exchange scheem 606 err problem
We have done exactly what you wnat to do many of times using exchange. You might want to check what you have for the session tuxch0122m000 (Maintain field relations) and on form 2
your entry should be as follows

Triton field overwrite update

item no no
usab (or some other yes yes
field)


Tour table realtions should have overwite only for the table tiitm001.
Reply With Quote
  #6  
Old 26th June 2003, 18:50
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Thanks for your replies

ssbaan - I tried your suggestion but it made no difference.

Juergen - As requested I have attached settings for table and field relations.

Hope this helps

Thanks

PJ
Attached Files
File Type: doc bb.doc (55.0 KB, 89 views)
Reply With Quote
  #7  
Old 27th June 2003, 08:54
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 573
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hi PJ,

please set the Field Update Record in "Maintain Table Relations (Import)" to no . For field "item in "Maintain Field Relations (Import)" Update and Overwrite must be set to no as ssbaan suggest.

Juergen
Reply With Quote
  #8  
Old 27th June 2003, 10:06
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Thumbs up

Thanks Juergen it's working now.

If I had read ssbaan's post properly I would solved the problem a bit quicker!

Thanks to all for your assistance.

Have good weekends!

Regards

PJ
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CODE: Validate Import Exchange Scheme Data gfasbender Code & Utilities 10 18th November 2009 00:19
copy records c_siek Tools Development 9 18th June 2004 16:43
How to delete child table if the parent table has only 1 index with 3 fields? juhiasg Tools Development 4 12th February 2004 05:51


All times are GMT +2. The time now is 02:50.


©2001-2017 - Baanboard.com - Baanforums.com