on 06-08-2018 3:33 PM
Hi All,
I am bulding a below dynamic sql in hana stored procedure, can some one help what is the issue on the below syntax
exec ( 'ALTER TABLE ' || schema_name || '."' || table_name || '" add (' || column_name ||'1' || col_type || ')');
It throws me
line 34 col 1 (at pos 1240): [257] (range 3) sql syntax error exception: sql syntax error: incorrect syntax near ")": line 1 col 54 (at pos 54)
Looks like you have missed that the variables need to have colons (:) in front of the variable name when you want to refer to their value.
Fix that and make sure that the col_type variable contains a valid definition for a column type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.