Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330171 - Constant of type VARCHAR FOR BIT DATA disturbs SQL-Editor
Summary: Constant of type VARCHAR FOR BIT DATA disturbs SQL-Editor
Status: NEW
Alias: None
Product: Data Tools
Classification: Tools
Component: SQL Editor Framework (show other bugs)
Version: 1.8.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dtp.sqldevtools-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 11:08 EST by Martin Ackermann CLA
Modified: 2011-02-18 20:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Ackermann CLA 2010-11-13 11:08:09 EST
Build Identifier: 20100218-1602

It seems that the constant of type VARCHAR FOR BIT DATA disturbs the parser in the SQL editor when using "Execute All".

Reproducible: Always

Steps to Reproduce:
On "Execute All" the following SQL produces "Syntax error: Encountered ";" at line 1, column 48."
CREATE TABLE app.test (bytearray VARCHAR(255) FOR BIT DATA);
INSERT INTO app.test(bytearray) VALUES(x'0102');
INSERT INTO app.test(bytearray) VALUES(x'0102');

With three times "Execute Current Text", it works fine.

When replacing the the constant by null, the script runs fine with "Execute All":
CREATE TABLE app.test (bytearray VARCHAR(255) FOR BIT DATA);
INSERT INTO app.test(bytearray) VALUES(null);
INSERT INTO app.test(bytearray) VALUES(null);
Comment 1 Martin Ackermann CLA 2010-11-13 11:11:27 EST
Happens in Helios SR1 too. Build Identifier: 20100917-0705
Comment 2 Brian Payton CLA 2011-02-18 20:58:09 EST
That is an odd error.  I can reproduce it with a DB2 for LUW v9.7 connection.  However, I get a different error message:

An unexpected token "(x'0102')" was found following " 
INSERT INTO".  Expected tokens may include:  "ST(BYTEARRAY) VALUES".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.52.95

From the error message, it looks like the text "app.test(bytearray) VALUES" is getting dropped out.