I am literaly following the SAP documentation 1st example on UPSERT a record in ASE: https://help.sap.com/viewer/cbed2190ee2d4486b0bbe0e75bf4b636/16.0.3.2/en-US/faf583d9adc547ad8a164bb3f41ea6cd.html
1> select @@version
2> go
Adaptive Server Enterprise/16.0 SP03 PL06/EBF 28334 SMP/P/x86_64/SLES 11.1/ase1
60sp03pl06x/3457/64-bit/FBO/Mon Nov 26 04:33:30 2018
(1 row affected)
1> select * from t1
2> go
a b c
----------- ----------- -----------
1 2 3
(1 row affected)
1> upsert t1(a,b,c) values(1,2,3)
2> go
Msg 102, Level 15, State 181:
Server 'NPL', Line 1:
Incorrect syntax near 'a'.
Does anyone know why am I getting this "Incorrect syntax" error in the UPSERT statment? Thanks
If the sole intent is to implement
upsertcapability inASEthen what you want to look at is the merge command.If the intent is to utilize (a subset of) HANA's
SQLScript(in this case theupsertcommand) for some sort of interoperability requirement, and keeping in mind you may need to modify existing code to work with dual (and incompatible) parsers, then ...To use (a limited version of) HANA's
SQLScriptin ASE you first need to create a database that supports theSQLScriptparser (see Creating a SQLScript database), eg:Running
sp_helpdb(from a non-SQLScript db) to verify db status:You should now be able to use the
upsertstatement in this new database:NOTE: verified on
ASE 16.0 SP04 GAVerifying
SQLScript/upsertdoes not work in a non-SQLScript database: