Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Help with EDB Script
Fri, Jul 31 2009 2:03 AMPermanent Link

"Adam H."
Hi Guys,

I am trying to execute my first EDB Script, and can't figure out where I've
gone wrong. I'm using a TEDBScript component, and calling the EXECSCRIPT
method after filling in the SQL parameters.

This is the SQL I'm trying to execute:

_______________________________________
SCRIPT
BEGIN
EXECUTE IMMEDIATELY '   CREATE TABLE "Temp" (
  "ID" VARCHAR(38),
  "Code" VARCHAR(10),
  "Company" VARCHAR(50),
  "Contact" VARCHAR(50),
  "Address" VARCHAR(50),
  "Address2" VARCHAR(50),
  "City" VARCHAR(50),
  "PostCode" VARCHAR(4),
  "ABN" VARCHAR(14),
  "Phone" VARCHAR(50),
  "Mobile" VARCHAR(50),
  "Fax" VARCHAR(50),
  "email" VARCHAR(100),
  "AgentID" VARCHAR(38),
  "Agent" BOOLEAN,
  "Farmer" BOOLEAN,
  "Trader" BOOLEAN,
  "Site" BOOLEAN,
  "Port" BOOLEAN,
  "Plant" BOOLEAN,
  "FeedMill" BOOLEAN,
  "Active" BOOLEAN,
  "Comments" CLOB)
                    VERSION 1
                    UNENCRYPTED
                    INDEX PAGE SIZE 8192
                    BLOB BLOCK SIZE 1024
                    MAX ROW BUFFER SIZE 32768
                    MAX INDEX BUFFER SIZE 65536
                    MAX BLOB BUFFER SIZE 32768
;'
END
_______________________________________

The error I'm getting is:

ElevateDB Error #700 An error was found in the script at line 34 and colum
21 (Expected ; but instead found '  CREATE TABLE "Temp" (.....  (And it
shows the rest of my SQL).

I'm confused as the CREATE TABLE is on the 3rd line, not 34, and I can't
seem to find where I've gone wrong.

Thanks & Regards

Adam.
Fri, Jul 31 2009 4:54 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


You have two errors

1. the final quote encloses the semi colon
2. much more amusing - its IMMEDIATE not IMMEDIATLEY

I'm also not sure why you're using a script since this is just a single sql statement and would run as a query.

Roy Lambert [Team Elevate]
Fri, Jul 31 2009 12:33 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< 2. much more amusing - its IMMEDIATE not IMMEDIATLEY >>

Actually, it's IMMEDIATELY, not IMMEDIATLEY. Smiley

And, Adam actually had the grammatically-correct version, but when did
computer languages start adhering to the rules of grammar. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Aug 1 2009 4:25 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>And, Adam actually had the grammatically-correct version, but when did
>computer languages start adhering to the rules of grammar. Smiley

Or even logic and especially "common sense"

Roy Lambert
Sun, Aug 2 2009 7:12 PMPermanent Link

"Adam H."
Hi Tim and Roy,

Thanks for your replies...

Got it sorted out now.

I was under the impression thta we needed 'scripts' to make changes or
create tables now (or is that only to create memory tables)?

As for the grammatically correctness - well that's a fluke. English was
never my strong point in school. Give me numbers anyday. Wink

Best Regards

Adam.
Mon, Aug 3 2009 3:59 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


You only need scripts when you can't do it in a single sql statement. On the plus side with their own language scripts can be used for a lot of things you could never use a query for.

Roy Lambert [Team Elevate]
Mon, Aug 3 2009 7:21 PMPermanent Link

"Adam H."
Hi Roy,

> You only need scripts when you can't do it in a single sql statement. On
> the plus side with their own language scripts can be used for a lot of
> things you could never use a query for.

That makes sence. Thanks for the reply.

Best Regards

Adam.
Image