Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from Pierre_Richer on Jan 23 at 11:48 AM Hi andchi, Here is an example on how I use Native SQL with SQL Server. 1 - Define the SQL DB in table DBCON 2 - Be sure that your SAP Server can access the SQL Server 3 - Define a user + pw on SQL Server DB to be use with DBCON 4 - Be sure you have the right component on you SAP server that can handle a connection with SQL Server (???.dll if you are on Windows) check with you Basis. 5 - Don't forget your commit. I don't remember if there is an implicit one at the end of the program with Native SQL How to connect method connect try. EXEC SQL. CONNECT TO 'MSSQL-TEST' AS :HANDLE ENDEXEC. EXEC SQL. SET CONNECTION :HANDLE ENDEXEC. connect_status = connected. catch cx_sy_native_sql_error. connect_status = not_connected. endtry. endmethod. Update Code snipet if connect_status = connected. EXEC SQL. UPDATE tblHU SET tblHU.STATUS = :IM_STATUS, tblHU.ERDAT = :ls_hu- erdat, tblHU.ERZET = :ls_hu-erzet WHERE tblHU.EXIDV = :IM_EXIDV ENDEXEC. EXEC SQL. commit ENDEXEC. endif.
| | | ---------------Original Message--------------- From: andchi Sent: Wednesday, January 23, 2013 11:02 AM Subject: How to Update a Database Table Field (Type Integer) Using NATIVE SQL Hi Horacio Thanks for the reply. All the cases mentioned are okay . 1. the database server is Microsoft sql server. 2. I am connecting to the database via excec sql 3. yes,the user i use has the rights to update 4. yes the database table has update right granted for the user 5. the value i want exists . 6. There is no other exec sql statement after this update So,i still have problem. | | Reply to this email to post your response. __.____._ | _.____.__ |