User login
|
|
|
Frontpage Sponsor
|
|
|
Poll
|
Would you like to see a separate forum on Baanboard for the ION product? No 13% Yes 87% Total votes: 90 |
Baanboard at LinkedIn
|

|
|
|
 |

9th January 2009, 22:17
|
 |
Member
|
|
Join Date: Aug 2007
Posts: 44
|
|
|
Baan: LN, Baan IV -
DB: SQL Server -
OS: Windows 7
|
Updating a record via the DAL(2)
Baan: ERP LN 6.1 C/S: Server
Hi All,
I am attempting to update a table using data from a flat file via the DAL.
My code reads:
Code:
error.found = dal.change.object("tiedm110")
if error.found then
error.mess = "Could not do 'change object' for refdes line"
error.mess = dal.error.file
endif
dal.set.field("tiedm110.eitm", mitm)
dal.set.field("tiedm110.revi", revi)
dal.set.field("tiedm110.pono", pono)
dal.set.field("tiedm110.rdsp", rdsp)
error.found = dal.save.object("tiedm110")
if error.found then
while dal.get.first.error.message( msg, code) >= 0
message(msg)
endwhile
error.mess = "Could not save REFDES line"
error.mess = dal.error.file
else
commit.transaction()
endif
When the script try to execute the dal.save.object() function it throws the error that the record is not locked.
I would think that the dal.save.object() function would lock or delay lock the record prior to saving the object.
How can I lock the record so that the record can be modified and then committed to the database?
Thanks for your time,
Ben
|

12th January 2009, 06:58
|
|
Senior Member
|
|
Join Date: Jan 2007
Posts: 139
|
|
|
Baan: Baan 5 -
DB: Oracle 9i -
OS: Win NT
|
|
could you debug this and find out which line is the script throwing the error.
|

12th January 2009, 07:53
|
|
Senior Member
|
|
Join Date: May 2002
Location: Belgium
Posts: 158
|
|
|
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 -
DB: Oracle, informix, DB400 -
OS: unix, As400, windows 2003
|
|
Hi,
If you are using dal to update a record you need first to read this record via
select tablename.*
from tablename for update
where ....
Regards
Philippe
|

12th January 2009, 10:04
|
 |
Guru
|
|
Join Date: May 2006
Location: Mumbai
Posts: 331
|
|
|
Baan: BAAN4C4 , BAAN 5c , LN 6.1 -
DB: MS SQL SERVER, ORACLE, Informix, HP Unix, AIX -
OS: Windows, UNIX
|
|
Hello Ben,
If you want to directly insert a new record , you can use the same code with a small change "dal.new.object("tiedm110")" and it will work ,
but here in this case you get a "record not locked error" , this is because while trying to update , the system do not find the record which you are trying to update so as Pconde suggested you will need to select the record for updating ....
Regards,
Niraj
|

12th January 2009, 14:13
|
 |
Member
|
|
Join Date: Aug 2007
Posts: 44
|
|
|
Baan: LN, Baan IV -
DB: SQL Server -
OS: Windows 7
|
|
Thanks, Niraj, Philippe.
That solved my problem.
Thanks a million!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|