marwest98
10th April 2008, 23:21
For some reason, my other thread closed, so I will try again.
Here is the code I am trying to execute
Keep in mind I am brand new to BAAN (only a week). I have created a new table, and now another session will be inserting records into it. It is sort of an audit table with Before and After changes. there should not be a record in the table that matches - based on timestamp
When I get to the actual db.insert, I get a 205 out of range error. Here is the code for the area where the db.insert occurs. I am running in debug, and I can see that the fields are being filled in correctly. What am I missing?
{
string todaysdate(12)
todaysdate = dte$()
select tccom130.*
from tccom130
where tccom130._index1 = {:tccom100.cadr}
selectdo
endselect
select tccom910.*
from tccom910
where tccom910._index1 = {:tccom100.bpid}
and tccom910.trns.dat > :todaysdate
selectdo
selectempty
tccom910.mcs.user = logname$
tccom910.trns.dat = dte$()
tccom910.activity = "Before"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom100.cadr
tccom910.namc = tccom130.namc
tccom910.namd = tccom130.namd
db.insert(ttccom910, db.retry)
commit.transaction()
endselect
}
When it runs, I get a 205 out of range error. All the fields look correct when I display them in the debugger. I have only been working on BAAN for 1 week and have not had any classes, so I can't figure out what I am doing wrong.
Help.
dharam.dv
11th April 2008, 08:18
Hello,
Please specify the version of BaaN.
Regards
Dharam
bdittmar
11th April 2008, 10:21
For some reason, my other thread closed, so I will try again.
Here is the code I am trying to execute
Keep in mind I am brand new to BAAN (only a week). I have created a new table, and now another session will be inserting records into it. It is sort of an audit table with Before and After changes. there should not be a record in the table that matches - based on timestamp
When I get to the actual db.insert, I get a 205 out of range error. Here is the code for the area where the db.insert occurs. I am running in debug, and I can see that the fields are being filled in correctly. What am I missing?
{
string todaysdate(12)
todaysdate = dte$()
select tccom130.*
from tccom130
where tccom130._index1 = {:tccom100.cadr}
selectdo
endselect
select tccom910.*
from tccom910
where tccom910._index1 = {:tccom100.bpid}
and tccom910.trns.dat > :todaysdate
selectdo
selectempty
tccom910.mcs.user = logname$
tccom910.trns.dat = dte$()
tccom910.activity = "Before"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom100.cadr
tccom910.namc = tccom130.namc
tccom910.namd = tccom130.namd
db.insert(ttccom910, db.retry)
commit.transaction()
endselect
}
When it runs, I get a 205 out of range error. All the fields look correct when I display them in the debugger. I have only been working on BAAN for 1 week and have not had any classes, so I can't figure out what I am doing wrong.
Help.
Hello,
if tccom910.activity is an ENUM you can't use a string.
You have to use it like:
tccom910.activity = activity.before
Regards
ks_ks_
11th April 2008, 11:57
Hi,
Please check the tables field with datatypes anf retry?
Or you can make use of 'e'( this is a pre defined variable in Baan which checks the error) which would be 1 if there is no error in db.insert else 0.
Check the value of e and proceed.
Thanks,
KS
marwest98
11th April 2008, 15:31
I'm not sure about the 'e' do you mean the eflag? If so, since the table is empty and I am getting a 205 out of range error I am not sure which one to use.
The BAAN version we are using is BAAN ERP the version says 7.1d.02.153.
activity is a string field. I specifically did not make it an enum because we were not sure exactly what we would place in the field.
ks_ks_
12th April 2008, 06:17
please specify the datatype of the table fields.
rahul.kolhe22
12th April 2008, 09:50
Hi,
Please check the domains of all the fields in tccom910 i.e. in the table u are trying to insert the record and the domain of the variables whoes value u r assigning to the table field. The domain should be same. If the domain of "activity" is not an issue, check the domain for date field i.e. tccom910.trns.dat, because dte$() function return current date & time in the string format.
saumya
16th April 2008, 12:54
Plz put db.retry.point()
before select statement.
marwest98
17th April 2008, 15:44
I have tried everything suggested, BAAN support has determined that we actually have a problem with one of indexes on either our tccom100 or tccom130 table. We are now going to try to fix the indexes. They suggest dumping and rebuilding the tables to fix the indexes. Under Database Management there is an option to Convert / Recover tables, on the tables tab, what is it looking for in the target database area? I am assuming that I must click the convert tables field which then wants something in the target database field. I've only been working in BAAN for two weeks, so, I'm kind of lost right now. Help :confused:
mark_h
17th April 2008, 17:24
Typically I just use reorganize tables - enter the table and click on repair reference counter, then continue. I am not sure if it is does the same type thing as the session you refer to, but that is how I have solved the type problem.
From running the help I do not think you want to check convert tables - that moves the tables from database type to another.
marwest98
17th April 2008, 17:57
I do not have a type problem anymore, BAAN support gave me the following to do which I do not clearly understand:
bdbpre6.2 -Ntccom100 -p <package combination> -t"|" -E <error file name> -o <output directory> -M -C100 <company>
followed by: bdbpost6.2 -kmnf -1 dump -C100
If I understand it basically it is going to dump and rebuild a table and recreate indexes.
Just reorging - which I tried before they gave me this did not work.
I'm lost here.
mark_h
17th April 2008, 18:44
Yes - the first exports it and the second will import it. Never done anything like this before, not manually at least. I believe this is the same as exporting and importing a table - I use sessions. You might want to wait for someone more knowledgable than me, but I think for bdbpre you enter the package combination to export, the name of the error file(if there are errors then they go into this file), the output directory for the exported data, -t"|" uses the pipe delimiter and then the -c followed by company number. On the bdbpost you probably need to be in the directory where the exported file is, then when you execute this command it will find all the .S files in that directory. At least that is how the session works - I point it to a directory and it imports all the data files ( extension .S). So good luck!
marwest98
17th April 2008, 19:58
On the sessions that are used to convert/recover tables ttaad4228m000, on the tables tab when I click convert tables, what would go into target database? I am assuming then I would click Delete Existing, Create Rows before Index. I've asked a couple of other people, and no one uses the sessions. I would rather use the sessions.
pvandyk
22nd April 2008, 00:44
Infor Support (Tools Support) can walk you right through this. Mark_H is essentially correct, those commands are the manual equivalent of running session "Reorganize Tables" (ttaad4225m000). I'd start with the session, myself. Try it out on a development server/environment first, before messing with your production environment. If you don't have a development environment, I'd definitely suggest talking to Support again.
Kind Regards,
pvanyk
marwest98
22nd April 2008, 17:16
Well gang, I've tried to reorganize and rebuild the tables. I've gone thru all the documentation, and worked with BAAN support. Unfortunately, I cannot get the correct number of records into the table. Of the 4400 records I should be building, I can only get 44 that is with the db.skip.dupl statement after the db.retry statement. If I don't use that, shich Baan support says I shouldn't need, but someone else said I did, I get the SQL errors that BAAN support said was actually due to corrupt indexes. I am still trying to get them to help me. At this point I am lost. This should be very simple to do.
mark_h
22nd April 2008, 18:41
Have you checked the actual indexes to make sure that there are not two competing unique indexes? Have you checked the data to make sure that none of it is corrupt? I have seen two situations that sound like this - in one the two unique indexes did not let the records reload to the table - at least not all of them. Then the second situation the export got some garbarge in a few of the datafields and stopped the re-import.
marwest98
28th April 2008, 17:36
I got it figured out, and all my sessions are now working as they should. This one is complete.:D