Sql syntax

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Faisal
Posts: 5
Joined: Wed 05 Apr 2006 13:44
Location: Pakistan

Sql syntax

Post by Faisal » Thu 06 Apr 2006 13:48

Hi,
I want to know what would be the syntax of a fetch query when using PostgreSqlDirect.Net. Following is what in Sql Server when using OleDb

SELECT
a4.CustomerID CustomerID, a4.CompanyName CompanyName,
a4.ContactName ContactName, a4.ContactTitle ContactTitle,
a4.Address Address, a4.City City,
a4.Region Attrib_Region, a4.PostalCode PostalCode,
a4.Country Country, a4.Phone Phone,
a4.Fax Fax

FROM
dbo.Customers a4

WHERE
a4.CustomerID = ?

What would be in PostgreSql.Net?

Thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 07 Apr 2006 07:10

In PostgreSQLDirect .NET your statement should look like this:

Code: Select all

SELECT 
a4.CustomerID as CustomerID, a4.CompanyName as CompanyName, 
a4.ContactName as ContactName, a4.ContactTitle as ContactTitle, 
a4.Address as Address, a4.City as City, 
a4.Region as Attrib_Region, a4.PostalCode as PostalCode, 
a4.Country as Country, a4.Phone as Phone, 
a4.Fax as Fax 

FROM 
dbo.Customers a4 

WHERE 
a4.CustomerID = ?
For more information please read PostgreSQL Documentation.

Faisal
Posts: 5
Joined: Wed 05 Apr 2006 13:44
Location: Pakistan

Post by Faisal » Mon 10 Apr 2006 07:59

It didn't work.
But it does work when i use quotes like

Code: Select all

SELECT 
"a4"."CustomerID" as CustomerID, "a4"."CompanyName" as CompanyName, 
"a4"."ContactName" as ContactName, "a4"."ContactTitle" as ContactTitle, 
"a4"."Address" as Address, "a4"."City" as City, 
"a4"."Region" as Attrib_Region, "a4"."PostalCode" as PostalCode, 
"a4"."Country" as Country, "a4"."Phone" as Phone, 
"a4"."Fax" as Fax 

FROM 
"dbo"."Customers" a4 

WHERE 
"a4"."CustomerID" = ?
Am i doing something wrong.
I really don't want to use quotes.

Thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 10 Apr 2006 08:16

Please provide us with the create table script for the table dbo.Customers.

Post Reply