marwest98
14th October 2008, 16:56
I am trying to insert a record into a table. The record should not exist, but, I kept getting a 205 error, so, I decided to select first. We just converted from Oracle/Unix to SqlServer2005/Windows2003. I did not have this problem before converting in other programs. This is a new program, but, I copied everything from an existing program. I think it is the utc.num() that is causing the problem now. Any ideas on something else I could use?
function write.after.record()
{
select tccom100.cadr, tccom100.bpid, tccom100.nama
from tccom100
where tccom100.cadr = :tfacp202.cadr
order by tccom100.cadr
as set with 1 rows
selectdo
select.130.record()
selectempty
select.130.record()
selecteos
select.130.record()
endselect
}
function select.130.record()
{
select tccom130.namc, tccom130.hono, tccom130.pobn, tccom130.name,
tccom130.namf, tccom130.pstc, tccom130.cste, tccom130.cadr
from tccom130
where tccom130._index1 = {:tfacp202.cadr}
order by tccom130._index1
as set with 1 rows
selectdo
get.910.record()
selectempty
get.910.record()
selecteos
commit.transaction()
endselect
}
function get.910.record()
{
db.retry.point()
select * from tccom910
where tccom910.activity = "addrchg"
and tccom910.bpid = :tccom100.bpid
and tccom910.cadr = :tccom130.cadr
and tccom910.nama = :tccom100.nama
and tccom910.namc = :tccom130.namc
and tccom910.hono = :tccom130.hono
and tccom910.pobn = :tccom130.pobn
and tccom910.name = :tccom130.name
and tccom910.namf = :tccom130.namf
and tccom910.pstc = :tccom130.pstc
and tccom910.cste = :tccom130.cste
and tccom910.cbad = :tccom125.cbad
and tccom910.bano = :tccom125.bano
selectdo
update.910.record()
selectempty
insert.910.record()
endselect
}
function update.910.record()
{
tccom910.mcs.user = logname$
tccom910.trns.dat = utc.num()
tccom910.activity = "addrchg"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom130.cadr
tccom910.namc = tccom130.namc
tccom910.hono = tccom130.hono
tccom910.pobn = tccom130.pobn
tccom910.name = tccom130.name
tccom910.namf = tccom130.namf
tccom910.pstc = tccom130.pstc
tccom910.cste = tccom130.cste
tccom910.cbad = tccom125.cbad
tccom910.bano = tccom125.bano
db.update(ttccom910, db.retry)
commit.transaction()
}
function insert.910.record()
{
tccom910.mcs.user = logname$
tccom910.trns.dat = utc.num()
tccom910.activity = "addrchg"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom130.cadr
tccom910.namc = tccom130.namc
tccom910.hono = tccom130.hono
tccom910.pobn = tccom130.pobn
tccom910.name = tccom130.name
tccom910.namf = tccom130.namf
tccom910.pstc = tccom130.pstc
tccom910.cste = tccom130.cste
tccom910.cbad = tccom125.cbad
tccom910.bano = tccom125.bano
db.insert(ttccom910, db.retry)
commit.transaction()
}
|mew end
function write.after.record()
{
select tccom100.cadr, tccom100.bpid, tccom100.nama
from tccom100
where tccom100.cadr = :tfacp202.cadr
order by tccom100.cadr
as set with 1 rows
selectdo
select.130.record()
selectempty
select.130.record()
selecteos
select.130.record()
endselect
}
function select.130.record()
{
select tccom130.namc, tccom130.hono, tccom130.pobn, tccom130.name,
tccom130.namf, tccom130.pstc, tccom130.cste, tccom130.cadr
from tccom130
where tccom130._index1 = {:tfacp202.cadr}
order by tccom130._index1
as set with 1 rows
selectdo
get.910.record()
selectempty
get.910.record()
selecteos
commit.transaction()
endselect
}
function get.910.record()
{
db.retry.point()
select * from tccom910
where tccom910.activity = "addrchg"
and tccom910.bpid = :tccom100.bpid
and tccom910.cadr = :tccom130.cadr
and tccom910.nama = :tccom100.nama
and tccom910.namc = :tccom130.namc
and tccom910.hono = :tccom130.hono
and tccom910.pobn = :tccom130.pobn
and tccom910.name = :tccom130.name
and tccom910.namf = :tccom130.namf
and tccom910.pstc = :tccom130.pstc
and tccom910.cste = :tccom130.cste
and tccom910.cbad = :tccom125.cbad
and tccom910.bano = :tccom125.bano
selectdo
update.910.record()
selectempty
insert.910.record()
endselect
}
function update.910.record()
{
tccom910.mcs.user = logname$
tccom910.trns.dat = utc.num()
tccom910.activity = "addrchg"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom130.cadr
tccom910.namc = tccom130.namc
tccom910.hono = tccom130.hono
tccom910.pobn = tccom130.pobn
tccom910.name = tccom130.name
tccom910.namf = tccom130.namf
tccom910.pstc = tccom130.pstc
tccom910.cste = tccom130.cste
tccom910.cbad = tccom125.cbad
tccom910.bano = tccom125.bano
db.update(ttccom910, db.retry)
commit.transaction()
}
function insert.910.record()
{
tccom910.mcs.user = logname$
tccom910.trns.dat = utc.num()
tccom910.activity = "addrchg"
tccom910.bpid = tccom100.bpid
tccom910.nama = tccom100.nama
tccom910.cadr = tccom130.cadr
tccom910.namc = tccom130.namc
tccom910.hono = tccom130.hono
tccom910.pobn = tccom130.pobn
tccom910.name = tccom130.name
tccom910.namf = tccom130.namf
tccom910.pstc = tccom130.pstc
tccom910.cste = tccom130.cste
tccom910.cbad = tccom125.cbad
tccom910.bano = tccom125.bano
db.insert(ttccom910, db.retry)
commit.transaction()
}
|mew end