Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread How to make a create table script with many 'create tables'?
Wed, Aug 7 2019 7:34 AMPermanent Link

Polywick Studio

My script is:

(note - this is an example)

CREATE TABLE "customers"
(
"id" VARCHAR(38) COLLATE "UNI" NOT NULL,
"code" VARCHAR(20) COLLATE "UNI",
}

CREATE TABLE "vendor"
(
"id" VARCHAR(38) COLLATE "UNI" NOT NULL,
"code" VARCHAR(20) COLLATE "UNI",
}

I get error.
ElevateDB Error #700 An error was found in the statement at line 5 and column 1 (Expected column name but instead found })

What's wrong?
I want to create a SQL script that executes multiple create table statements.
Wed, Aug 7 2019 8:25 AMPermanent Link

Raul

Team Elevate Team Elevate

On 8/7/2019 7:34 AM, Polywick Studio wrote:
> My script is:
>
> (note - this is an example)
>
> CREATE TABLE "customers"
> (
> "id" VARCHAR(38) COLLATE "UNI" NOT NULL,
> "code" VARCHAR(20) COLLATE "UNI",
> }
>
> CREATE TABLE "vendor"
> (
> "id" VARCHAR(38) COLLATE "UNI" NOT NULL,
> "code" VARCHAR(20) COLLATE "UNI",
> }
>
> I get error.
> ElevateDB Error #700 An error was found in the statement at line 5 and column 1 (Expected column name but instead found })
>
> What's wrong?
> I want to create a SQL script that executes multiple create table statements.
>

How are you running this exactly ?

Assuming you simply want to run this in EDBManager you need to separate
the statements. Default in EDBManager is ! so this should work.
in this example you also have extra commas


Something like this should work - it does for me

CREATE TABLE "customers"
(
"id" VARCHAR(38) COLLATE "UNI" NOT NULL,
"code" VARCHAR(20) COLLATE "UNI"
)
!
CREATE TABLE "vendor"
(
"id" VARCHAR(38) COLLATE "UNI" NOT NULL,
"code" VARCHAR(20) COLLATE "UNI"
)

Another easy way for this is create the table (al alter or whatever) in
EDBManager and then Explorer->SQL History shows you actual SQL that was
generated

Raul
Wed, Aug 7 2019 12:11 PMPermanent Link

Terry Swiers

> CREATE TABLE "customers"
> (
> "id" VARCHAR(38) COLLATE "UNI" NOT NULL,
> "code" VARCHAR(20) COLLATE "UNI",
> }
> <snip>
>
> I get error.
> ElevateDB Error #700 An error was found in the statement at line 5 and column 1 (Expected column name but instead found })
>
> What's wrong?

The error message is spot on.   EDB is expecting a ) at the end of the column definitions but it found a close brace " } "  instead.
Image