cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Syntax error on executing a script in Sybase database

Former Member
14,063

I created a Sybase database emp_details using SQL Anywhere and Sybase Central. I had given emp/emp as dba username/password while creating.

The db got created and the files were generated in the given folder.

When I tried running the below script using Ineractive SQL:

use master
go

if exists (select 1 from master..sysdatabases where name='emp_details')
    checkpoint emp_details
go

It threw the following exception

Could not execute statement.
Syntax error near 'checkpoint' on line 2
SQLCODE=-131, ODBC 3 State="42000"
Line 4, column 1

Haven't been able to figure out what exactly the syntax issue is and have been stuck up with this for a while.

Any ideas?


Edit: Issue got resolved by installing Sybase ASE. Was able to run the script as it is.

View Entire Topic
VolkerBarth
Contributor

FWIW, ASE (as MS SQL Server) uses an architecure where each database server instance has one particular master database and as many "attached" databases as one likes, and one can list any database via the master's sysdatabases table. - That's what the script seems to try to, and so I would conclude you're using ASE.

In contrast, a SQL Anywhere database server can run several databases, too, but does not use a particular master database, so each database is managed on its own, and there is no general sysdatabases table. Of course, there are other means to list all databases running on a SQL Anywhere server.