Quantcast
Channel: SCN : Popular Discussions - SAP PowerBuilder
Viewing all articles
Browse latest Browse all 2135

RowsCopy not working

$
0
0

I am trying to copy rows from one datawindow to another.  The source window has 19 rows in it, but when I update the destination window it only produces 1 Insert statement.   Can anyone tell me why its not working or how to debug.

 

Here's the code:

 

uo_transaction  ltran_Transact
string ls_SQLAnyConnectString
ls_SQLAnyConnectString = "ConnectString = 'DSN=dbbasesqlany;UID=" + is_DbLogon + ";PWD=" + is_DbPwd + " ' "
ltran_Transact = CREATE uo_transaction
ltran_Transact.DBMS = "ODBC"
ltran_Transact.dbParm = ls_SQLAnyConnectString
CONNECT USING ltran_Transact;
IF  ltran_Transact.SQLError()  THEN
ltran_Transact.SetSQLError("Error connecting transaction to ~""+ltran_Transact.DBMS+"~"")
RETURN FAILED
END IF

uo_ds_base luo_dw_local_security_log
uo_ds_base luo_dw_central_security_log

luo_dw_local_security_log = CREATE uo_ds_base
luo_dw_central_security_log = CREATE uo_ds_base

luo_dw_local_security_log.dataobject = "d_security_log"
luo_dw_central_security_log.dataobject = "d_security_log"

 

integer err1, err2, err3, err4

err3 = luo_dw_central_security_log.SetTransObject(itran)
err4 = luo_dw_local_security_log.SetTransObject(ltran_Transact)
//err1 = luo_dw_central_security_log.Retrieve()  // Either retrieving or not retrieving yields only 1 insert statement
err2 = luo_dw_local_security_log.Retrieve()

 

integer li_CentralRowCount, li_LocalRowCount
li_CentralRowCount =luo_dw_central_security_log.RowCount()   //0 Records
li_LocalRowCount = luo_dw_local_security_log.RowCount() // 19 Records

 

luo_dw_local_security_log.RowsCopy(1, li_LocalRowCount , Primary!, luo_dw_central_security_log, 1, Primary! )


IF luo_dw_central_security_log.Update() <> 1 THEN  // Only 1 insert statement generated
    itran.SetSQLError( "Unable to copy security_log data from local to central database" )
    RETURN FAILED
END IF

COMMIT USING itran;


Viewing all articles
Browse latest Browse all 2135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>