[ psqlodbc-Bugs-1000648 ] Visual Studio 2005 DataSet Designer "Add Query..." wizard fails with a syntax error if SELECT query contains a WHERE clause

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1000648 ] Visual Studio 2005 DataSet Designer "Add Query..." wizard fails with a syntax error if SELECT query contains a WHERE clause
Date: 2006-05-19 05:23:01
Message-ID: 20060519052301.9735586C4DC@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Bugs item #1000648, was opened at 2006-05-19 05:23
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000648&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Patrick Donelan (patspam)
Assigned to: Nobody (None)
Summary: Visual Studio 2005 DataSet Designer "Add Query..." wizard fails with a syntax error if SELECT query contains a WHERE clause

Initial Comment:
Hi,

I'm using the latest version of the drivers: 8.02.00.02 and PostgreSQL 8.1 on Windows XP Pro.

When adding simple queries to TableAdapters in Visual Studio 2005 using the DataSet Designer, a simple WHERE clause causes the Add Query

wizard to fail with a syntax error, even though the query executes perfectly if you test it during an intermediate Wizard step.

Simple Steps To Reproduce
-------------------------
1. Open an existing DataSet in the DataSet Designer (or create a new one)
2. Add a TableAdapter, with a simple query (in my case "SELECT * FROM agent")
3. Add a Query to the TableAdapter:
Right-click on TableAdapter > Add Query.. > Use SQL statements > SELECT which returns rows
4. Type in a simple SELECT using a single WHERE clause (in my case "SELECT * from agent WHERE (agent_id = ?)")
5. Click Query Builder.. > Execute Query (prompts for Query Parameter and executes perfectly)
6. Click OK > Next > Next (leave "Fill a DataTable" and "Return a DataTable" checked) > Next
At this point, even though the query executed perfectly in the Query Builder, you get an error:
"The wizard detected the following problems when configuring TableAdapter query "FillBy":
Details:
Generated SELECT statement.
ERROR [42601] ERROR: syntax error at or near ")";
Error while executing the query"

I have found a partial workaround:
1. Use the Wizard to create the query (with WHERE clause omitted)
2. Right-click on the new query and select properties
3. Modify the query in the CommandText property window

Logs attached.

Regards,

Patrick

----------------------------------------------------------------------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000648&group_id=1000125

Browse pgsql-odbc by date

  From Date Subject
Next Message Ludek Finstrle 2006-05-19 08:02:58 Re: SQLCODE when using psqlODBC with libODBC++
Previous Message Bart Samwel 2006-05-18 09:33:37 Re: Output parameters