Questions tagged [isql]

The isql utility is a command-line Interactive SQL utility that uses the Adaptive Server Enterprise Open Client API.

isql is a utility that is being provided by Sybase to connect to the Sybase server. The isql utility can be invoked from the Windows command prompt or in Unix machine. The basic command to connect to a Sybase server via the isql utility is as follows -

isql -SSERVER_NAME -DDATABASE_NAME -ULOGIN_NAME -PPASSWORD

Once you enter this in the command prompt you will be visited with a blank command screen with a prompt -

>

You can now enter sql commands and create scripts with isql and execute them.

The isql utility is located at -

$SYBASE/$SYBASE_OCS/bin on UNIX machines and at C:\SYBASE\OCS-12_0\bin\ folder on Windows system.

Some basic problems that database users find with isql utility is that it provides console mode for working in with Sybase databases which is usually not very handy for many database users especially having experience working in Windows. With many handy GUI IDE's available for working with Sybase servers like ASEISQL(free tool), Embarcadero Rapid SQL, Quest TOAD etc the isql utility is lesser used in normal day work. However the utility has some basic characteristics of its own like a script not terminated by the go token can be easily identified while working with isql than any other IDE as isql does not execute a statement until it finds the delimiter token go at the end of the script.

To understand the isql utility more you can visit the Sybase knowledge center site @ -

Sybase Knowledge Center Link to Sybase ASE 15.0 isql utility

199 questions
1
vote
2 answers

How do I drop any constraint only if it exists in sybase?

I can drop a table, procedure, views if it exists using the following code but do not know how to do the same with a constraints(foreign key, check constraint): IF EXISTS (SELECT 1 FROM sysobjects WHERE user = 'owner' and name = 'tablename' AND type…
Geetanjali Jain
  • 402
  • 6
  • 19
1
vote
1 answer

ISQL - exporting column with very long text

I have a table in sybase database running on Solaris, which I like to export. The table contains a column which is of IMAGE type and it contains very long text ( 100000+ chars). I'm not able to export it properly, because isql splits the lines in…
taiko
  • 438
  • 1
  • 8
  • 20
1
vote
0 answers

can't capture output error from isql shell script

I am trying to capture output and errors throw from shell script executed via isql. I've tried with the following code, but it doesn't work: isql -q -i e:\test\script.sql e:\db\testdb.fdb -m -u sysuser -p xxx I am looking for example how to use…
carolyn
  • 21
  • 4
1
vote
2 answers

Count unique data within a category

I am looking for help in trying to solve an issue with a query. Query: SELECT distinct BRAND,(select count(distinct VIN) from STOCK) as STOCK ITEM COUNT from STOCK What I am trying to achieve is to display the brand and unique count of all VIN…
ITworldR
  • 65
  • 1
  • 1
  • 7
1
vote
1 answer

mariadb odbc throws invalid pointer error

I have MariaDB installed (as part of Fedora installation) on Fedora 21. ODBC is also installed. BUT, when I go to test the ODBC configuration (or when Asterisk attempts to use ODBC) I get an error in free():invalid pointer. odbcinst.ini [MySQL] …
SchroedingersCat
  • 487
  • 8
  • 21
1
vote
3 answers

In isql, is there a way for me to run several SQL statements from a file?

I have a file that contains several SQL queries. Can I somehow run them via isql (I'm doing the calls from Bash script, so no access to Perl DBI or JDBC) I tried piping them into isql command via echo /my/file | isql -my-other-parameters but that…
user25235
  • 13
  • 1
  • 3
1
vote
1 answer

how to get error messages in stderr for isql command in python

I'm using isql command in python for sybase databases, isql command by default returns zero as return code if the database query has failed, I want it to return some non zero value if the query has failed so that i could i know that my query is…
Bad_Coder
  • 1,019
  • 1
  • 20
  • 38
1
vote
2 answers

Converting a date format in sybase

I need to convert May 8 2014 to this format 08/05/2014. I tried using: convert(char(12),"May 8 2014",103) but it did not work. Kindly suggest a workaround.
Prateek Gupta
  • 135
  • 1
  • 2
  • 11
1
vote
1 answer

Committing and Rollback using Atomic Keyword

I am working on the sybase isql. I have a set of update statements that needs to be like either all updates are successful or hone. For that I am trying to execute using the atomic function of sybase . But it is showing error as "incorrect syntax…
10hero
  • 15
  • 8
1
vote
2 answers

Does Firebird have the ability to run system level commands?

Ive been playing around with Firebird and isql. I noticed it has the 'shell' command. However this shell drops you to a sub-process on the local system regardless if your connected to a remote DB. Is it possible to run system level commands on…
iNoob
  • 1,375
  • 3
  • 19
  • 47
1
vote
1 answer

How can I insert newlines in the correct places in isql output in a bash script?

I am querying a database (SQL Server) using isql in a bash script. For example: RESULT="$(${ISQL} -Q -U ${DB_USER} -S ${DB_SERVER} -D ${DB_NAME} << __END SELECT order_id % 5 as mod5, count(*) as count FROM orders GROUP BY order_id % 5 ORDER BY…
Jer
  • 5,468
  • 8
  • 34
  • 41
1
vote
2 answers

Capturing return codes from Sybase stored procedure in korn shell script

I am facing an issue in capturing the return code of a stored procedure. I am calling a sybase stored procedure in my korn shell script using isql statement as mentioned below. isql -U ${APPLID} -S{SERVER}> ${sqlMsg} << EOF use ${DATABASE} go exec…
user3259912
  • 11
  • 1
  • 2
1
vote
1 answer

SQL counting 1 table and merging information from table 2 into the results

I need help with SQL. I have a column in terminal and a column in table2 that match each other. (index) I want to display the count of terminals per index in table 'terminal', and merge it with table2 to include the index name in the output select…
1
vote
0 answers

How to set default numeric format to avoid showing exponential value?

I have a problem in ASE isql that it can't stop the execution when a negative exponential value is displayed. select -1.2218952178955078e-006 Does anyone know how I can avoid exponential value by default? Is there a setting available in session or…
Jason Ching
  • 1,991
  • 1
  • 19
  • 23
1
vote
5 answers

Replace doesn't work in Sybase

I tried following in Sybase SELECT ChrgAmt, REPLACE(convert(varchar(255),ChrgAmt), '.', '') AS Result FROM PaymentSummary But it gives below error in isql Incorrect syntax near the keyword 'REPLACE'. What could be the possible reason Thanks
Shabar
  • 2,617
  • 11
  • 57
  • 98