Gaith1
26th November 2015, 18:46
Hi,
I'm pretty sure that's not possible but may be someone can confirm or suggest another way to do it
Can I use dynamic variables to do insertion in specific field
example below: variable test content field sagen901.user (custom table) and after in my selectempty I have test = user.i (to assign user.i to sagen901.user.
function void update.main.table()
{
domain tcmcs.str15 test
test = sagen901.user |************************
select sagen901.*
from sagen901 for update
where sagen901._index1 = { :dati.i, :user.i, :sess.i }
selectdo
if timi.i < sagen901.timi then
sagen901.timi = timi.i
endif
if dato.i >= sagen901.dato and timo.i > sagen901.timo then
sagen901.timo = timo.i
endif
if dato.i > sagen901.dato then
sagen901.dato = dato.i
sagen901.timo = timo.i
endif
sagen901.cntr = sagen901.cntr + 1
db.update(tsagen901, db.retry)
update.ctr.f = update.ctr.f + 1
selectempty
test = user.i |************************
sagen901.sess = sess.i
sagen901.dati = dati.i
sagen901.timi = timi.i
sagen901.dato = dato.i
sagen901.timo = timo.i
sagen901.comp = comp.i
sagen901.cntr = 1
db.insert(tsagen901, db.retry)
insert.ctr.f = insert.ctr.f + 1
endselect
rec.ctr.i = rec.ctr.i + 1
if rec.ctr.i > COMMITINT then
rec.ctr.i = 0
display("inctr.f")
display("insert.ctr.f")
display("update.ctr.f")
display("skip.ctr.f")
commit.transaction()
endif
}
thanks
I'm pretty sure that's not possible but may be someone can confirm or suggest another way to do it
Can I use dynamic variables to do insertion in specific field
example below: variable test content field sagen901.user (custom table) and after in my selectempty I have test = user.i (to assign user.i to sagen901.user.
function void update.main.table()
{
domain tcmcs.str15 test
test = sagen901.user |************************
select sagen901.*
from sagen901 for update
where sagen901._index1 = { :dati.i, :user.i, :sess.i }
selectdo
if timi.i < sagen901.timi then
sagen901.timi = timi.i
endif
if dato.i >= sagen901.dato and timo.i > sagen901.timo then
sagen901.timo = timo.i
endif
if dato.i > sagen901.dato then
sagen901.dato = dato.i
sagen901.timo = timo.i
endif
sagen901.cntr = sagen901.cntr + 1
db.update(tsagen901, db.retry)
update.ctr.f = update.ctr.f + 1
selectempty
test = user.i |************************
sagen901.sess = sess.i
sagen901.dati = dati.i
sagen901.timi = timi.i
sagen901.dato = dato.i
sagen901.timo = timo.i
sagen901.comp = comp.i
sagen901.cntr = 1
db.insert(tsagen901, db.retry)
insert.ctr.f = insert.ctr.f + 1
endselect
rec.ctr.i = rec.ctr.i + 1
if rec.ctr.i > COMMITINT then
rec.ctr.i = 0
display("inctr.f")
display("insert.ctr.f")
display("update.ctr.f")
display("skip.ctr.f")
commit.transaction()
endif
}
thanks