on 07-24-2007 8:00 PM
How do I execute sql scripts from sqlcli that I need to parameters to the sql?
If I have a file called count.sql that contains:
select count (*) from $1
//
select count (*) from $2
//
quit
//
How do I execute the script with sqlcli and pass parameters?
Based on the maxdb documentation I thought I would be able to do this, but it doesn't work:
sqlcli \c -d MAXDB1 -u test,test -i 1.sql TABLEA TABLEB
Hi Jon,
Use -i option to run the sql script file in sqlcli.
I used sqlcli -d <dbname> -u <dbuser>,<password> -i <filename.sql> and succeeded.
And make sure to use // in delimiter after every query.
e.g
truncate table <tablename>
//
truncate table <tablename>
Regards,
Abhishek Kalra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
We are installing ERP2005 on solaris 10 with MAXDB7.6 with build 35. During installtaion the Import ABAP phase stucks and running for a so long time. As per the note SAPNOTE :848436 we have been trying to execute the statment
CHECK TABLE "/MAXDB/INDEXSTATEMENTS" WITH LONG CHECK.
which may free up the load for installation.
But we are unable to execute the above SQL statement.
It is very urgent since we are not able to complete the installation from past 3 days....
Could you please some one able to help us to finish the installation. I am very
much greatful to you all..
Regards,
Sankaranarayanan.G
SAPBASISCONSULTANT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Joe,
sorry, there is no such functionality in the sqlcli tool. You can only supply
some SQL already at the command line (for very simple usage scenarios).
Regards
Alexander Schröder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joe,
can you try:
sqlcli [<options>] -i <file>
The call options are explained here: http://maxdb.sap.com/currentdoc/12/b72640b32ce901e10000000a155106/frameset.htm
The file can be, for e.g.:
CREATE TABLE city
(zip CHAR (5) KEY CONSTRAINT zip BETWEEN '10000' AND '99999',
name CHAR(20) NOT NULL,
state CHAR(2) NOT NULL)
//
CREATE TABLE customer
(cno FIXED (4) KEY CONSTRAINT cno BETWEEN 1 AND 9999,
title CHAR (7) CONSTRAINT title IN ('Mr', 'Mrs', 'Company'),
firstname CHAR (10) ,
name CHAR (10) NOT NULL)
//
COMMIT
Thanks,
Ashwath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.