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

hdbsql fails when used with file but works interactively for same commands

$
0
0

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


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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