what is wrong with this SQL?

Started by Nonameover 24 years ago9 messagesgeneral
Jump to latest
#1Noname
kornale@zdnetmail.com

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

#2Vladimir Konrad
vladimir@wit.uklinux.net
In reply to: Noname (#1)
Re: what is wrong with this SQL?

USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,

There is not varchar2 type!

regards...

Alex K. <kornale@zdnetmail.com> wrote in message
news:99fb7937.0109201418.7ff032a2@posting.google.com...

Show quoted text

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

#3Doug McNaught
doug@wireboard.com
In reply to: Noname (#1)
Re: what is wrong with this SQL?

kornale@zdnetmail.com (Alex K.) writes:

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

PostgreSQL DECIMAL doesn't take a size argument. Take out the sizes
and you'll be good.

-Doug
--
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm. -Dylan

#4Doug McNaught
doug@wireboard.com
In reply to: Noname (#1)
Re: what is wrong with this SQL?

kornale@zdnetmail.com (Alex K.) writes:

USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

My previous mail was wrong, its the "varchar2" that's messing things
up--PG has no such type. The error message isn't too helpful.

Change it to "text" or regular "varchar" and you should be OK.

-Doug
--
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm. -Dylan

#5Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Noname (#1)
Re: what is wrong with this SQL?

On 20 Sep 2001, Alex K. wrote:

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

What is varchar2? It's probably complaining that it has a type that
isn't there followed by a () size spec and gets confused at that point.

#6zammon@libero.it
zammon@libero.it
In reply to: Noname (#1)
Re: what is wrong with this SQL?

Hi Alex,
You are using the non standard VARCHAR2 data type, only Oracle uses
this data type I wonder to know
the difference between VARCHAR and VARCHAR2, anyway try to change it to
VARCHAR.

I hope this help you.
Jose

Alex K. wrote:

Show quoted text

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#7Keary Suska
hierophant@pcisys.net
In reply to: Noname (#1)
Re: what is wrong with this SQL?

Is 'varchar2' a proper user-defined type?

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

Show quoted text

From: kornale@zdnetmail.com (Alex K.)
Organization: http://groups.google.com/
Date: 20 Sep 2001 15:18:46 -0700
To: pgsql-general@postgresql.org
Subject: [GENERAL] what is wrong with this SQL?

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#8Thomas Lockhart
lockhart@fourpalms.org
In reply to: Noname (#1)
Re: what is wrong with this SQL?

...

PostgreSQL DECIMAL doesn't take a size argument. Take out the sizes
and you'll be good.

That doesn't seem to be a problem:

lockhart=# create table t1 (d decimal(19) not null);
CREATE

- Thomas

#9Andy Hallam
ahm@exel.co.uk
In reply to: zammon@libero.it (#6)
Re: what is wrong with this SQL?

The difference between VARCHAR and VARCHAR2 in ORACLE is that VARCHAR2 is
ORACLE's UNICODE character data type - equiv to NCHAR in PostgreSQL.

Andy.

<zammon@libero.it> wrote in message news:3BB380F9.7000106@libero.it...

Show quoted text

Hi Alex,
You are using the non standard VARCHAR2 data type, only Oracle uses
this data type I wonder to know
the difference between VARCHAR and VARCHAR2, anyway try to change it to
VARCHAR.

I hope this help you.
Jose

Alex K. wrote:

create table USERS (
ID decimal(19) CONSTRAINT primary_usr_oid PRIMARY KEY,
WRITE_COUNT decimal(19) NOT NULL,
CLASS decimal(10) NOT NULL,
STATUS decimal(3) NOT NULL,
USR_LOGIN_USER_ID varchar2(16) ,
USR_PASSWORD varchar2(16) ,
USR_PERSON_FIRST_NAME varchar(32) ,
USR_PERSON_MIDDLE_NAME varchar(32) ,
USR_PERSON_LAST_NAME varchar(32) ,
USR_PERSON_SALUTATION varchar(32) ,
USR_PERSON_SUFFIX varchar(32)
);

when i am in psql and i do: \i createUsersTable.sql i get this error:
psql:createUsersTable.sql:13: ERROR: parser: parse error at or near "("

What is this?

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html