jcook331
13th December 2005, 00:40
I'm using the text.copy() function to copy text from one table into another. This works fine for some users, but doesn't for other. Has anyone ever had this problem?

beginer
13th December 2005, 06:21
Hi,

Check the Text Authorizations for the users ?

jcook331
13th December 2005, 16:39
I checked the authorizations for the user and he appears to have authorization for this text group. Is there some other authorization I need to check.

norwim
13th December 2005, 17:35
Hi there,

check the text groups assigned to the users. I guess you will find differences here.

hth

Norbert

jcook331
13th December 2005, 17:44
I checked that too. He was assigned to the proper text group. I even assigned him to all available text groups and it still would not copy the text. It's a very strange problem. There must be something I'm overlooking but I can't figure out what it is.

jcook331
14th December 2005, 00:01
The field that I am having problems with is the lflfa402.txta field. All other fields are being inserted or updated as they should be. The return value for the text.copy() function is -1 which I believe means permissions error. One other note is that the text.copy() function works for other tables for this user, but not the lfluf402 table. The code follows:

select lflfa402.*
from lflfa402 for update
where lflfa402._index1 = {:lflfa409.inft, :lflfa409.inid, :lflfa409.inrf}
selectdo
select lflfa360.*
from lflfa360
where lflfa360._index1 = {:lflfa409.inft, :lflfa409.cprj, :lflfa409.inid, :lflfa409.inrf, :lflfa409.revi}
selectdo
lflfa402.ccod = lflfa360.ccod
lflfa402.revi = lflfa360.revi
select lflfa363.*
from lflfa363
where lflfa363._index1 = {:lflfa409.inft, :lflfa409.cprj, :lflfa409.inid, :lflfa409.inrf, :lflfa409.revi, :lflfa409.comp}
selectdo
lflfa402.rvdt = lflfa363.rldt
selectempty
endselect
lflfa402.rvds = lflfa360.rvds
lflfa402.rvav = 0
lflfa402.infr = lflfa360.infr
lflfa402.dcod = lflfa360.dcod
lflfa402.kwse = lflfa360.kwse
lflfa402.desc = lflfa360.desc
lflfa402.comm = lflfa360.comm
|lflfa402.txta = lflfa360.txta
if lflfa360.txta > 0 then
ret = text.read("lflfa360.txta", language$, kw1, kw2, kw3, kw4, text.group, edit.option, tmp.file, 1)
ret = text.rewrite("lflfa402.txta", language$, kw1, kw2, kw3, kw4, text.group, edit.option, tmp.file) else
lflfa402.txta = 0
endif
lflfa402.fnam = lflfa360.fnam
lflfa402.expr = lflfa360.expr
lflfa402.shts = lflfa360.shts
lflfa402.drws = lflfa360.drws
lflfa402.dlab = lflfa360.dlab
lflfa402.expd = lflfa360.expd
lflfa402.fext = lflfa360.fext
selectempty
endselect
db.update(tlflfa402, db.retry)
commit.transaction()
selectempty
db.set.to.default(tlflfa402)
select lflfa360.*
from lflfa360
where lflfa360._index1 = {:lflfa409.inft, :lflfa409.cprj, :lflfa409.inid, :lflfa409.inrf, :lflfa409.revi}
selectdo
lflfa402.inft = lflfa360.inft
lflfa402.inid = lflfa360.inid
lflfa402.inrf = lflfa360.inrf
lflfa402.ccod = lflfa360.ccod
lflfa402.revi = lflfa360.revi
select lflfa363.*
from lflfa363
where lflfa363._index1 = {:lflfa409.inft, :lflfa409.cprj, :lflfa409.inid, :lflfa409.inrf, :lflfa409.revi, :lflfa409.comp}
selectdo
lflfa402.rvdt = lflfa363.rldt
lflfa402.rdat = lflfa363.cpdt
selectempty
endselect
lflfa402.rvds = lflfa360.rvds
lflfa402.rvav = 0
lflfa402.infr = lflfa360.infr
lflfa402.orig = lflfa360.orig
lflfa402.cuno = lflfa360.cuno
lflfa402.suno = lflfa360.suno
lflfa402.drst = lflfa360.drst
lflfa402.dcod = lflfa360.dcod
lflfa402.kwse = lflfa360.kwse
lflfa402.desc = lflfa360.desc
lflfa402.comm = lflfa360.comm
lflfa402.usid = lflfa360.usid
ret = text.copy("lflfa402.txta","lflfa360.txta","","","","","","")
|lflfa402.txta = lflfa360.txta
lflfa402.fnam = lflfa360.fnam
lflfa402.expr = lflfa360.expr
lflfa402.shts = lflfa360.shts
lflfa402.drws = lflfa360.drws
lflfa402.dlab = lflfa360.dlab
lflfa402.cwar = lflfa360.cwar
lflfa402.wloc = lflfa360.wloc
lflfa402.expd = lflfa360.expd
lflfa402.prev = ""
lflfa402.fext = lflfa360.fext
select lflfa359.*
from lflfa359
where lflfa359._index1 = {:lflfa409.inft}
selectdo
lflfa402.rvct = lflfa359.rvct
selectempty
endselect
selectempty
endselect
db.insert(tlflfa402)
commit.transaction()
endselect

beginer
14th December 2005, 06:49
Hi,

Checkout the read/write permission of the temp. file.
I hope the user has authorizations for the directory & the file which are created temporarily.

jcook331
14th December 2005, 20:16
I checked that too. I even made permissions wide open for the directories and file. It still wouldn't work.

mark_h
14th December 2005, 23:26
Check this thread (http://www.baanboard.com/baanboard/showthread.php?t=6458&highlight=text.copy) out. The last post may help. It looks like the -1 mean no permissions to the text group - you may want to specifiy a text group to copy into. I am not sure that is it, but something to try. Also check that there are no table permissions or maybe a restriction at the oracle level.