Hi Michael, > -----Original Message----- > From: Michael Schulte [mailto:[EMAIL PROTECTED] > Sent: Mittwoch, 12. Januar 2005 17:01 > To: [email protected] > Subject: sqlcli does not handle commands spread over more than 1 line > > Hey, > > I have Rel. 7.5.00.19 installed on my RedHat Enterprise 8 > Linux system. > > I have successfully run the "create_demo_db.sh". > > I have an sql-script ttt.sql: > $ cat ttt.sql > > create table t_sys_conf ( > db_hostname varchar(50), > fs_hostname varchar(50), > status smallint, > dbms varchar(50), > unique (db_hostname, fs_hostname) ); > > create table t_statistic ( > number_puts integer, > number_gets integer, > number_updates integer ); > > insert into t_sys_conf values ('A', 'B', 0, 'askfj'); > insert into t_statistic values (1,2,3); > > > When I run: > $ sqlcli -S ORACLE -m -y 0 -d TST -u dba,dba -c ';' -i ttt.sql > > I get: > * -3014: Invalid end of SQL statement SQLSTATE: 42000 > > My Question: > (Q1) Why?
Sqlcli will send all commands of the script together as one single command to database, what leads to the error. Why is sqlcli doing this? The parser of sqlcli is not very flexible and expect the delimiter (in your case ';') at the beginning of a line and not at the of the statement. That is conform to the syntax used by the scripts for the loader and for SQLStudio. But I agree it is not very convenient. I'll think about to change it. > (Q2) Is there anything like oerr -3014 (which is a tool that explains > the error message)? No, as far as I know. You need to have a look at the message handbook: http://dev.mysql.com/doc/maxdb/en/bf/e3c635d0998e4be10000009b38f839/cont ent.htm > (Q3) Which line in the above created the error? Is there a way > to find out from the error message? > (Q4) When I run the above commands "by hand" via > $ sqlcli -S ORACLE -m -y 0 -d TST -u dba,dba -c ';' > > sqlcli TST=> create table t_statistic ( > number_puts integer, > number_gets integer, > number_updates integer );* -3014: Invalid end of SQL statement > SQLSTATE: 42000 > > Then I enter "\r", and input the same command again > and it works. > > I have a "rule of thumb" , that it is necessary to execute > a "\r" after every command that I have run in sqlcli. This should be fixed in the current version 7.5.00.23. I will check this. > > This is a severe bug and it seems that this bug is present > since years (according to the mail archive of this news group). Nobody has reported this bug before. Also sqlcli is a really fresh tool and only one year old. > > (Q5) Do others have the same problems? > Regards, Marco --------------- SAP Labs Berlin -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
