Previous Topic

Next Topic

Book Contents

Book Index

Sybase

Message "Stored procedure 'sp_odbc_tables' not found"

You will get this message if your Sybase server hasn't been configured fully. Part of the configuration of a Sybase server is the step that creates a lot of stored procedures in the sybsystemprocs database. If this step has not been done, AQT will not operate and you will get the above message.

The solution is to have your DBA run the configuration step for the Sybase server.

Parameterised Queries

If you wish to run queries with parameters (such as Select * from table where column=?) then your ODBC Driver must be configured for a non-default value of PrepareMethod. This is described in Sybase unable to display tables in Database Explorer.

Numeric Parameters in Parameterised Queries

Sybase has difficulty dealing with numeric parameters in parameterised queries. For instance if you run a query such as:

Select * from table where numeric_column=?

you will get the following error message:

Implicit conversion from datatype 'CHAR' to 'INT' is not allowed. Use the CONVERT function to run this query

The solution to this is to change your query to:

Select * from table where numeric_column=convert(int,?)

The datatype in the convert function must match the data type of numeric_column.

Cancel Queries

In order to cancel queries with Sybase, you need to set Options > Cancel Queries > AQT Cancel Task. This runs a cancel task in a separate thread, which allows an active query or update to be cancelled.

Use of Rowcount

Performance of queries, particularly those accessing large tables, can be improved by having AQT set the rowcount option. This is discussed in more detail in the section Rowcount for SQL Server and Sybase.

Compute Clause

If you use this, you may get the error:

COMPUTE clause can not be used in the declaration of a cursor

To solution to this is to change the ODBC Configuration of your Sybase database to use a Select Method of 1-Direct.

Truncate Table

This can give you message:

TRUNCATE TABLE command not allowed within multi-statement transaction

The resolution to this is to go to Options > Technical, and check Use SQLExecDirect.