Hi
I am trying to execute some sql using hdbsql. When I use it interactively, it works. Same commands used in an input file file.
Interactive mode, with shell EOF
hdbadm@hanaserver /tmp/testdir $ hdbsql -i 00 -U MYNAME -z <<EOF
> CREATE PROCEDURE proc2() LANGUAGE SQLSCRIPT AS BEGIN SELECT 1 as "A", 22 AS "B" FROM dummy; END;
> CALL proc2()
> EOF
Welcome etc....
0 rows affected (overall time 90.440 msec; server time 81.152 msec)
A,B
1,22
1 row selected (overall time 37.783 msec; server time 33.551 msec)
Now I drop the procedure proc2 manually and try using an input sql file.
With an input file that already exists
hdbadm@hanaserver /tmp/testdir $ cat p3.sql
CREATE PROCEDURE proc2() LANGUAGE SQLSCRIPT AS BEGIN SELECT 1 as "A", 22 AS "B" FROM dummy; END;
CALL proc2()
hdbadm@hanaserver /tmp/testdir $ hdbsql -i 00 -U MYNAME -z -I p3.sql -o p3.sqlout -g NULL -C -a
* 257: sql syntax error: line 1 col 86 (at pos 86) SQLSTATE: HY000
* 328: invalid name of function or procedure: PROC2: line 1 col 6 (at pos 5) SQLSTATE: HY000
Why do the two outcomes differ? Would appreciate your help. I am using Rev 66 on HANA ONE.
Regards
Dinesh