Thread: Missing SQL Syntax & Problem with Create Table

Missing SQL Syntax & Problem with Create Table

From
Fredrick Meunier
Date:
Hi,
    I have a database design tool under windows, and it has a
feature where you can store varoius metadata about your database
in an ODBC database. I would like to use PostgreSQL as the
repository. The product goes and creates it's own schema in a
datasource, but has problems with the following DDL:

CREATE VIEW ALL_TEXT (TEXTIDTF,TEXTNSEG)
AS SELECT B.BLBJ,B.NSEG FROM BLBJ B WHERE B.BTYP = 1
ERROR from backend during send_query: 'ERROR:  parser: parse error at or
near "("'

What are the chances of getting view creation syntax like the above
accepted?

The other problem is:
CREATE TABLE MPDREFR
( REFR int4 NOT NULL,
  SRCE int4 NOT NULL,
  TRGT int4 NOT NULL,
  LABL varchar(254) ,
  URUL int2 ,
  DRUL int2 ,
  MAND int2 ,
  CPRT int2 ,
  TOBJ int2 ,
  COBJ varchar(80) ,
  SOID int4 ,
  FKCN varchar(64) ,
  CMIN varchar(10) ,
  CMAX varchar(10) ,
  NGEN int2 )'
ERROR from backend during send_query: 'ERROR:  create: system attribute
named "cmin"'

Can the system attribute limitation be removed, or can the system
attributes be renamed to not conflict with legal SQL92 column names?

Thanks for any help you can offer,
Fred
--
To have no errors
Would be life without meaning
No struggle, no joy            -- Brian M. Porter

Re: [GENERAL] Missing SQL Syntax & Problem with Create Table

From
"Jose' Soares Da Silva"
Date:
On Mon, 8 Jun 1998, Fredrick Meunier wrote:

> Hi,
>     I have a database design tool under windows, and it has a
> feature where you can store varoius metadata about your database
> in an ODBC database. I would like to use PostgreSQL as the
> repository. The product goes and creates it's own schema in a
> datasource, but has problems with the following DDL:
>
> CREATE VIEW ALL_TEXT (TEXTIDTF,TEXTNSEG)
> AS SELECT B.BLBJ,B.NSEG FROM BLBJ B WHERE B.BTYP = 1
> ERROR from backend during send_query: 'ERROR:  parser: parse error at or
> near "("'
PostgreSQL doesn't support the above syntax. Try this instead:

CREATE VIEW ALL_TEXT
AS SELECT B.BLBJ AS TEXTIDTF, B.NSEG AS TEXTNSEG
FROM BLBJ B WHERE B.BTYP = 1
>
>
> What are the chances of getting view creation syntax like the above
> accepted?
>
> The other problem is:
> CREATE TABLE MPDREFR
> ( REFR int4 NOT NULL,
>   SRCE int4 NOT NULL,
>   TRGT int4 NOT NULL,
>   LABL varchar(254) ,
>   URUL int2 ,
>   DRUL int2 ,
>   MAND int2 ,
>   CPRT int2 ,
>   TOBJ int2 ,
>   COBJ varchar(80) ,
>   SOID int4 ,
>   FKCN varchar(64) ,
>   CMIN varchar(10) ,
>   CMAX varchar(10) ,
>   NGEN int2 )'
> ERROR from backend during send_query: 'ERROR:  create: system attribute
> named "cmin"'

cmin and cmax are reserved words, try to rename to C_MIN C_MAX for example.

>
> Can the system attribute limitation be removed, or can the system
> attributes be renamed to not conflict with legal SQL92 column names?
>
> Thanks for any help you can offer,
> Fred
> --
> To have no errors
> Would be life without meaning
> No struggle, no joy            -- Brian M. Porter

                                                            Ciao, Jose'