springgirl
26th February 2004, 07:04
dear friends,

I meet a problem, I write the right code,but it does not work.
Can you help me ?
Thanks in advance.The code as follow:

choice.user.0:
on.choice:
select *
from tdpur909
where tdpur909.item = "111" and
tdpur909.clot = "S34A07510021 "
selectdo
mess("existed",1)
selectempty
db.set.to.default(ttdpur909)
tdpur909.item = "159"
tdpur909.clot = "123"
tdpur909.cwar = "001"
tdpur909.iqc = tcyesno.yes
tdpur909.orno = 110021
tdpur909.reno = 999999
db.insert(ttdpur909,db.retry)
endselect

NPRao
26th February 2004, 08:26
springgirl,

Refer to the link for more info about BaaN SQL and Transaction management.

Baan SQL (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_baan_sql)

You need to add - commit.transaction after db.insert()

en@frrom
26th February 2004, 11:14
Just for the clearity:

after db.insert(), write commit.transaction()
This does the actual writing of the record to the table.

nopadon
26th February 2004, 22:10
springgril,

You need to add "for update"

select *
from tdpur909 FOR UPDATE
....
....


and commit.transaction below db.insert()


Regard
Nopadon

nopadon
26th February 2004, 22:14
commit.transaction() below db.insert()

mgakhar
26th February 2004, 23:03
You dont need to write "from tdpur909 for update" as you arent updating the record but adding a new record.

As NPRao suggested, you just need to write a commit.transaction() after your db.insert stmt.

MG.

springgirl
1st March 2004, 12:27
It does work,thank you very much.

I am a new comer in baan,thanks your help.

B.R