Skip to content

Need help in this coding for replication database program !!!

yana sam

Asked Apr 2, 2008, 6:13 PM EDT2 answers
Share
LinkedInX

Hello...I'm doing a system about replication database from one server to another server..I've some problem with the coding..There's error appear after the execution..Hope anybody can help...here is the coding...

SQL = "INSERT INTO b_CODATxn(sIC,sSemester,sSeqNo,iTxnLineID,iLineID,dTxnDate,sTxnType,sAccNo, iDrCrInd,mAmt,sDesc,sFeeCode,iRecur,dProcessDate," + _

" iID,sModFlag,sPostUser, iPeriod,iYear,mAmtPart ,sDepositSlip,sDoccode,sDocnum,sPayMode,sLinkcode,sComments,iLinkRunNo,iJournal,dDocDate) VALUES " + _

"('" + myarray(i, 0) + "','" + myarray(i, 1) + "','" + myarray(i, 2) + "'," + myarray(i, 3) + "," + myarray(i, 4) + _

"," + myarray(i, 5) + ",'" + myarray(i, 6) + "','" + myarray(i, 7) + "'," + myarray(i, 8) + "," + myarray(i, 9) + _

",'" + myarray(i, 10) + "','" + myarray(i, 11) + "'," + myarray(i, 12) + "," + myarray(i, 13) + "," + myarray(i, 14) + _

",'" + myarray(i, 15) + "','" + myarray(i, 16) + "'," + myarray(i, 17) + "," + myarray(i, 18) + "," + myarray(i, 19) + _

",'" + myarray(i, 20) + "','" + myarray(i, 21) + "','" + myarray(i, 22) + "','" + myarray(i, 23) + "','" + myarray(i, 24) + _

"','" + myarray(i, 25) + "'," + myarray(i, 26) + "," + myarray(i, 27) + "," + myarray(i, 28) + ")"

 

 error after execution

PROCESS FAIL !!!System.Data.Odbc.OdbcException : ERROR [42000][DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Incorrect syntax near ','.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0
    parameter passing using ODBC can be tricky in different Insert statements.  Some dbs use ? marks for passing parameters, some @paramName.  You'll need to experiment to get the right one.  If you can avoid ODBC and use the direct provider, it will probably be a lot easier
    0
  • 0

    thanks..then this new error occur :-

    PROCESS FAIL !!!System.Data.Odbc.OdbcException : ERROR [22003][DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Arithmetic overflow during implicit conversion of VARCHAR value ‘13/03/2008’ to a DATETIME field .

    hope anyone can help..

    thanks..

    0