hmliang
13th November 2006, 08:26
hi All,

i want to know insert/update/delete use method,can you help me?

thanks!

george7a
13th November 2006, 09:02
Hi,

Do you mean insert/update/delete data from a table?
Read here about Baan SQL (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_baan_sql)

You also can use AFS to do so you will find allot of information in the AFS/DDC/OLE: Function servers Forum (http://www.baanboard.com/baanboard/forumdisplay.php?f=59).

If you give us more info I am sure you will get more help.

- George

hmliang
13th November 2006, 09:53
hi George,

yes,i have a Purchase Requisitions,within add text info,when i submit after,Approver can not see text info in tdpur2516m000 session.

so i want to add new session,when i run this session thant text info transfer to tdpur206 table from tdpur200 table.

i define a function:
function to.line()
{
select rqno from tdpur206 where txta = 0
selectdo

select txta from tdpur200 where rqno = :rqno

selectdo

stpapi.synchronize.dialog("tdpur2203m000","add",error)

stpapi.put.field("tdpur2203m000","tdpur206.txta",tdpur200.txta)

ret=stpapi.update("tdpur2203m000",1,error)

if ret=0 then
message(error)
endif
endselect
endselect
}

but when i complete it that found errors,can you help me check error?

thanks!

george7a
13th November 2006, 11:50
What are the errors that you found?

hmliang
13th November 2006, 14:37
hi,

sorry,my program is error,i update it:

|****************************** DECLARATION SECTION ***************************
declaration:
table ttdpur200 | Purchase Requestion
table ttdpur206 | Purchase Appove

long ret

|****************************** PROGRAM SECTION ***************************
functions:
function main()
{
ret = 0

select tdpur206.txta,tdpur200.txta
from tdpur206 for update,tdpur200
where tdpur206.txta = 0
and tdpur206.rqno = tdpur200.rqno
selectdo

tdpur206.txta = tdpur200.txta

db.update(ttdpur206,db.retry)

ret = ret + 1

endselect
}

Error:Function 'main' already declared.

Hiba_t
13th November 2006, 16:07
Hi,

You need to change the name of "main" function since it's this name for the main function for 3gl programs..

Regards,
Hiba

en@frrom
14th November 2006, 10:28
Indeed, the naming of your function caused the error. Don't forget however to add a commit.transaction() after your updates...