Need sybase sql command help


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Need sybase sql command help
# 1  
Old 01-27-2008
Need sybase sql command help

Guys,

My question is on the Sybase sql query, command 'sp_help' shows me list of all the tables. but I can not view them page by page. So is there any command to view them page by page as in our unix 'ls | less'.

and one more thing command/procedure to store output into the file.

Any help is highly appreciated.

Thanks and regards,
Jagdish Machhi
# 2  
Old 02-19-2008
RE: Need sybase sql command help

I assume you are using ISQL to connect to Sybase. However, there is a much more feature-rich utility called SQSH (Sqsh Home Page ) that among many other things, also allows you to pipe SQL commands to unix utilities (including 'less' ).

Example:
sqsh -U<user> -P<password>
> sp_helpdb
> go | more

Also, if have any need for cross-DB-platform command-line access, you might want to check out a newer project called JSQSH (JDBC DB compliant SQSH) at SourceForge.net: jsqsh » home.

My org has had years of success w/ SQSH and we are about to look at JSQSH. Smilie
# 3  
Old 02-19-2008
Thank you very much.....since I am eagerly wait for the reply for my thread....From the name come to know that are you from India?....
just asking for curiosity....

So it is totally impossible to do from an 'isql' utility?


Regards,
Jagdish Machhi
# 4  
Old 02-19-2008
Nasty hack is the closest I have:

Code:
#!/bin/sh 

PASSWD=$1;shift 
DSQUERY=$1;shift 
QUERY=$* 

isql -U sa -S $DSQUERY -w 1000 <<-Qend|more 
$PASSWD 
$QUERY 
go 
Qend

# 5  
Old 02-20-2008
If you always know the query in advance, then I would go with
isql -Usa -Ppassword -i query.sql -o output.file

where query.sql contains
use <DB>
go
sp_helpdb
go
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bcp command error in uploading data to Sybase

Hi All, I had an issue in executing bcp command to connect to Sybase from Unix script for uploading the data from file to table. I have a file called vrs_temp.txt (with two columns): 22055;20181001 21088;20181001 93840;20181001 30990;20181001 50990;20181001 50950;20181001Created a... (4 Replies)
Discussion started by: Suresh
4 Replies

2. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies

3. UNIX for Dummies Questions & Answers

Help Command in SQL LOADER

Which is the UNIX command to get the SQL Loader Help??:confused: (1 Reply)
Discussion started by: venkatesh sunil
1 Replies

4. Shell Programming and Scripting

Need to capture error of sybase sql in unix

Hi Gurus, I am very new in Unix, I have 1 script, in which I am truncating the table , then BCP the data in Sybase table, and then loading the data from sybase table to sybase table. every thing is working fine, but the problem is with Error. I made some hanges in my insert statement so... (1 Reply)
Discussion started by: aksar
1 Replies

5. SuSE

my SQL Info command

Is there a command that will output all mysql details. eg. host name, port etc? Cheers Paul (1 Reply)
Discussion started by: runnerpaul
1 Replies

6. Shell Programming and Scripting

Bourne shell script with embedded Sybase SQL

Hi, I need a simple (as possible) Bourne shell script that takes an input file of adminID's and spits out a list of adminID's and related tradeID's. Both adminID and tradeID are columns in a Sybase database table called "trades", in which they have a one-to-one relationship. adminID is a... (3 Replies)
Discussion started by: chatieremerrill
3 Replies

7. Shell Programming and Scripting

sql command question

Hi, Table1 ====== Code1 Field1 Table2 ====== Code1 Field1 Would anyone be able to help me know what's the best sql command to delete the entry in Table1 if its Code1-Field1 combination is already existing in Table2. I used this one - delete from Table1 where Code1 in (select... (1 Reply)
Discussion started by: gholdbhurg
1 Replies

8. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

9. Shell Programming and Scripting

sql insert command

Hi, sqlplus -s / <<EOF > /dev/null insert into table1 (a1, a2, a3) values ('a',1,'b'); commit; EOF in the above code can i pass the values to the insert command from shell script like this: insert into table1 (a1, a2, a3) values ('$a',$b,'$c'); If yes, how is it passed?? Any... (2 Replies)
Discussion started by: abey
2 Replies

10. Windows & DOS: Issues & Discussions

ms sql command reference

does somebody know where i can find command reference for mssql? i tried to search via google and it does help me that much. maybe someone can refer me a site. thank you very much. (2 Replies)
Discussion started by: inquirer
2 Replies
Login or Register to Ask a Question