Question on the table type definitions for variables.
From Rich's link here:
On HANA db version 1.00.097
Trying to declare the following table var within a SQLScript procedure:
declare lt_vw_rslts_tab table ( MANDT NVARCHAR(3), DOC_NUM NVARCHAR(10), GUID VARBINARY(16) CS_RAW);
SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "CS_RAW": line 7 col 29 (at pos 189)
This will compile but is not what I need
declare lt_vw_rslts_tab table ( MANDT NVARCHAR(3), DOC_NUM NVARCHAR(10), GUID VARBINARY(16) );
To test
create procedure hollas.crte_tabvar_tst LANGUAGE SQLSCRIPT AS BEGIN declare lt_vw_rslts_tab table ( MANDT NVARCHAR(3), DOC_NUM NVARCHAR(10), GUID VARBINARY(16) CS_RAW); lt_vw_rslts_tab = select top 10 client as mandt, object_id as doc_num, guid from sapsr3.crmd_orderadm_h; END;
These table create statements work fine
drop table hollas.tst_crte_tab; create global temporary column table hollas.tst_crte_tab ( MANDT NVARCHAR(3), DOC_NUM NVARCHAR(10), GUID VARBINARY(16) CS_RAW); drop table hollas.tst_crte_tab; create column table hollas.tst_crte_tab ( MANDT NVARCHAR(3), DOC_NUM NVARCHAR(10), GUID VARBINARY(16) CS_RAW);
I can create a global temporary table instead and do an insert for now, just wondering if I'm doing something wrong with table type definition above?