This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 94433 - Query with IN ('?', '?') fails in QueryBuilder
Summary: Query with IN ('?', '?') fails in QueryBuilder
Status: RESOLVED WORKSFORME
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-05 18:16 UTC by bugbridge
Modified: 2008-11-18 13:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2007-02-05 18:16:49 UTC
Original status: 3-Accepted; Suggested Status: NEW


Original submitter: jimdavidson

Description:
Start with SELECT * from PERSON, then use Add Query Criteria to get
SELECT * from PERSON where personid IN ('?', '?')

Strange things happen to the WHERE clause because of syntax highlighting. 
There's a call to 
dsdocument.remove(), with a string ('?', that only removes the first three
characters.  As a result the 
where clause becomes 
where personid IN ('?'', '?')

Someone else reported this, but I can't find the bug.  Not worth a lot of time,
but worth a little effort from 
someone who knows DefaultStyledDocument.

Evaluation:
I can reproduce, will look into
Comment 1 John Baker 2007-03-01 02:32:48 UTC
reassigning
Comment 2 John Baker 2007-10-18 22:10:57 UTC
Turns out this is not a bug.
a PERSONID is an integer, so the IN clause should be (?, ?)

SELECT ALL TRAVEL.TRIP.TRIPID, 
                    TRAVEL.TRIP.PERSONID, 
                    TRAVEL.TRIP.DEPDATE, 
                    TRAVEL.TRIP.DEPCITY, 
                    TRAVEL.TRIP.DESTCITY, 
                    TRAVEL.TRIP.TRIPTYPEID, 
                    TRAVEL.TRIP.LASTUPDATED 
FROM TRAVEL.TRIP
WHERE TRAVEL.TRIP.PERSONID  IN   ( ?,? )
Comment 3 Petr Blaha 2008-11-18 13:09:34 UTC
Move visualsqleditor subcomponents below visualweb