Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Code blindness & line numbers with multiline sql
Tue, Sep 16 2008 8:45 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

I'd like to help anyone else who falls into this trap

Originally I generated an error when running my migration program. I've finally managed to track it down in EDBManager. The error was

ElevateDB Error #700 An error was found in the statement at line 157 and column 19 (Missing expression)

The line where EDBManager stops is

EXECUTE IMMEDIATE 'ALTER TABLE "UserStats"

This is part of a multi line statement which in full is

EXECUTE IMMEDIATE 'ALTER TABLE "UserStats"
  ALTER COLUMN "_Date" AS DATE DEFAULT CURRENT_DATE,
  ALTER COLUMN "_Dialings" AS INTEGER DEFAULT 0,
  ALTER COLUMN "_Connected" AS INTEGER DEFAULT 0,
  ALTER COLUMN "_Positive" AS INTEGER DEFAULT 0,
  ALTER COLUMN "_Negative" AS INTEGER DEFAULT 0,
  ALTER COLUMN "_Score" AS INTEGER DEFAULT';

Now I know everyone out there is immediately going to spot the bug but my problem was I focussed onto the line I had reported and didn't let my eyes drift down far enough.

So my suggestion is when ElevateDB says there's an error on a line which is part of a multi line statement READ THE WHOLE STATEMENT NOT JUST THE LINE IT TELLS YOU!

This is not a criticism - I can't see what else EDB could report but this suggestion could save someone a few happy hours of hair pulling and the cost of a wig.

Roy Lambert
Image