cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use parameters within HANA SQL

KlausRauer
Employee
Employee
0 Kudos

I want to cosume a column view which uses parameters using HANA SQL.

To do this I would expect a statement like:

select Count(*) from "_SYS_BIC"."sap.hba.ecc/SalesOrderItemNetAmountQuery"  WITH PARAMETERS ("P_SAPClient" = '004')

Unfortunately the statement is not executed.

Is this not possible at all?

Thanks,

Klaus

Accepted Solutions (1)

Accepted Solutions (1)

former_member184768
Active Contributor
0 Kudos

Hi Klaus,

Can you please try the below statement:

select Count(*) from "_SYS_BIC"."sap.hba.ecc/SalesOrderItemNetAmountQuery" 

WITH PARAMETERS ('placeholder' = ('$$p_sapclient$$' = '004'));

Regards,

Ravi

KlausRauer
Employee
Employee
0 Kudos
Hi Ravi,
first thanks.
I get the error message: : sql syntax error: incorrect syntax near "="
To make my example complete: I have to supply 3 parameters in total.
May be this causes the problem?
Tanks,
Klaus
former_member184768
Active Contributor
0 Kudos

You can have the statement modified as follows:

with parameters

(

   'placeholder' = ('$$v_store$$', 'US101'),

   'placeholder' = ('$$v_week_from$$', '201201'),

   'placeholder' = ('$$v_week_to$$', '201210')

);

Can you please provide your SQL statement.

Regards,

Ravi

KlausRauer
Employee
Employee
0 Kudos

Hi Ravi,

it works.

Thank you very much,

Klaus

Answers (0)