on 10-26-2015 8:44 AM
what is the way to import an array to store procedure , i tried the following but its giving a syntax error that statement not valid
PROCEDURE "ZTESTDEV"."ztest_development.search::proc" ( in it_pid VARCHAR(10) ARRAY)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
--DEFAULT SCHEMA <default_schema_name>
READS SQL DATA AS
BEGIN
Hi Karthikeyan,
If you are trying to pass multiple values into a procedure, you can try using table type variable.
Regards,
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nithin,
1. When you create an .procedure file to create a procedure, you can create a local table type which can be used inside that procedure alone to input/output multiple values. Below screenshot shows one such table type.
In the table type tab next to SQLScript, you can create a local table type by adding code
CREATE TYPE tt_test AS TABLE ( col1 VARCHAR(4), col2 DECIMAL, col3 INTEGER);
CREATE TYPE tt_test2 AS TABLE(out1 INTEGER);
You can use it as input or output as below :
CREATE PROCEDURE test (IN tt_test_in tt_test, OUT tt_out tt_test2) ...
This acts as an array locally to that procedure.
2. If you want to declare global table types, you can go for CDS approach. You can create a .hdbdd file with below sample code:
namespace sap.hana.practice.tabletype;
@Schema: 'SOME_SCHEMA'
context GlobalTypes {
type tt_test
{ col1: String(10);
col2: String(40);
col3: Decimal(15,2);}; };
Upon saving and activating, this table type is available under corresponding schema -> procedures -> tabletypes section. You can drag and drop and use it in the required procedure as array globaly.
Regards,
Anil
User | Count |
---|---|
77 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.