Possible limitation with updating a field in Advantage Database?

206 views Asked by At

I'm trying to update a field in a table and am unsure if I'm just completely wrong or if it's a possible limitation of using Advantage Database.

My Script:

UPDATE myTable SET myField = REPLACE(myField,substring(myField,myNumber,mynumber),'<>') Where myField = '<>';

The error I receive is "Expected lexical element not found: -- Missing table name. You are missing the table name after the keyword UPDATE. -- Location of error in the SQL statement is: 8"

1

There are 1 answers

0
dougwoodrow On

Please show the actual statement that produced the "missing table name" error. The statement you gave is syntactically correct.

DECLARE myNumber INTEGER;
myNumber = 1;

//TRY DROP TABLE myTable; CATCH ALL END TRY;

CREATE TABLE myTable
(
  id AUTOINC,
  myField VARCHAR(20)
);

INSERT INTO myTable (myField) VALUES ('<>');

UPDATE myTable
  SET myField = REPLACE(myField, SUBSTRING(myField, myNumber, myNumber), '<>')
  WHERE myField = '<>';

Result:

SUCCESS: 2 Rows Affected