سؤال

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)
);
هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top