Hi,
I am trying to write synchronization script for ST_GEOMETRY column to synchronize between HANA and SQL Anywhere.
My download script is as follows :
col35 is the ST_GEOMETRY column.
CALL ml_add_table_script ( 'v1', 'TEST_CHAR_TYPES_TABLE', 'download_cursor', '' );
CALL ml_add_table_script ( 'v1', 'TEST_CHAR_TYPES_TABLE', 'download_cursor', 'SELECT TEST_CHAR_TYPES_TABLE.pkey, TEST_CHAR_TYPES_TABLE.col35.ST_AsBinary(), TEST_CHAR_TYPES_TABLE.col35.ST_SRID()
FROM TEST_CHAR_TYPES_TABLE
INNER JOIN TEST_CHAR_TYPES_TABLE_upserted
ON TEST_CHAR_TYPES_TABLE_upserted.pkey
= TEST_CHAR_TYPES_TABLE.pkey
WHERE TEST_CHAR_TYPES_TABLE_upserted.upserted_timestamp
>= {ml s.last_table_download}' );
And download from HANA to SQLA works!!
But I couldnot write Upload script and make it work.
I tried with this :
CALL ml_add_table_script ( 'v1', 'TEST_CHAR_TYPES_TABLE', 'upload_insert', '' );
CALL ml_add_table_script ( 'v1', 'TEST_CHAR_TYPES_TABLE', 'upload_insert', '
INSERT INTO TEST_CHAR_TYPES_TABLE
( pkey,
col35 )
VALUES ( {ml r.pkey},
ST_Geometry::ST_GeomFromBinary({ml r.col35:data},{ml r.col35:srid}) )' );
It does not work.
also INSERT INTO test VALUES( {ml r.c1}, GeometryFromWKB({ml r.c2:data},{ml r.c2:srid}) ) did not work. Can someone please help me out in this?
Do we have a document somewhere to write these scripts ?
Regards,
Subhankar