Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

table type definitions for variables

$
0
0

Question on the table type definitions for variables.

 

From Rich's link here:

http://scn.sap.com/community/developer-center/hana/blog/2014/12/01/new-sqlscript-features-in-sap-hana-10-sps9

 

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?


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>