Question

I am trying to create a table in Sybase and i get getting the same syntax error. Which is ASA Error -131: Syntax error near '(' on line 1

Here is my create table script:

CREATE TABLE tablename
(NUM_PO BIGINT DEFAULT AUTOINCREMENT,
MNT NUMERIC(9) NULL,
QTY_PROD NUMERIC(9) NULL,
NUMERIC(14) NULL
PRIMARY KEY (NUM_PO)
);
Was it helpful?

Solution

It appears you are trying to specify the database the table should be created in. In SQL-server, sometimes it would nag if you didn't put the owner of the table creating it within the database. I looked at SyBase's create table, and I think you just need to make a slight shift

create table IDW.tablename
to
create table IDW..tablename

The "IDW" appears to be your database. the extra period via ".." would imply that whoever you are connected as is the table owner, or just goes to default owner value, THEN the table name.

Hope this helps.

OTHER TIPS

Unless I am missing something the definition of the last column is incomplete. Only the data type is provided.

See if the error disappears once you fix this. Otherwise the table DDL looks perfect. I verified with the Sybase manual too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top