Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread BEGIN EXCEPTION
Sat, Feb 2 2008 11:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Testing in EDBManager 1.07b3

I thought I'd try the BEGIN..EXCEPTION..END construct but it doesn't seem to work. If inFld isn't there the script works, with an error message (ElevateDB Error #401 The table inFld does not exist) on the status bar. If it is there it bombs out with "ElevateDB Error #400 The table infFld already exists"

What am I doing wrong please.

SCRIPT (IN TableWanted VARCHAR, IN DatabaseWanted VARCHAR)
BEGIN
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE inFld';
EXCEPTION
END;
EXECUTE IMMEDIATE
REPLACE('$DB' WITH DatabaseWanted IN
REPLACE('$TN' WITH TableWanted IN
'CREATE TABLE infFld AS
SELECT
...
LEFT OUTER JOIN "$DB".Information.IndexColumns XC ON XC.ColumnName = TC.Name AND XC.TableName = ''$TN''
WHERE
TC.TableName = ''$TN''
GROUP BY Name
WITH DATA'));
EXECUTE IMMEDIATE 'CREATE INDEX "Name" ON "inFld" (Name)';
END




Roy Lambert
Sat, Feb 2 2008 11:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

And as so often after trying for ages and posting I spotted my fault inFld vs infFld - my new glasses should be ready next week Smiley


Not sure how that will help though since they're they same prescription.

Roy Lambert
Image