Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330171

Summary: Constant of type VARCHAR FOR BIT DATA disturbs SQL-Editor
Product: [Tools] Data Tools Reporter: Martin Ackermann <public.viewing>
Component: SQL Editor FrameworkAssignee: dtp.sqldevtools-inbox <dtp.sqldevtools-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: bpayton
Version: 1.8.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.