Error using postgresql syntax in DataTable SELECT-Statements [solved]

Error using postgresql syntax in DataTable SELECT-Statements [solved]

Postby De Kus » Thu 09 Jan 2014 10:40

I have installed and configured dotConnect postgresql professional trial just fine, just installed with your release from christmas.

This is the - theoretically - simple statement I am having trouble with
Code: Select all
SELECT        "PersonalNr", "Nachname" || ' ' || "Vorname" AS Loginname
FROM            "public".personal

I considered using CONCAT() instead of ||, but we are still using postgresql 8.4, so there is no such function avaible.

When I try to save a statement like that Visual Studio 2013 gives me the following error:
Code: Select all
Error in Select clause: expression near "|"

After that I can continue, but it doesn't update the columns at all, so the columns in the designer don't match to these of the actual statement at all. Basicly I could only run a typeless DataTable...

I assumed the parser has no idea about postgresql syntax at all. Does that mean I can't use strong typed DataTables with custom fields at all? Plain DataTables automatically derived from tables just work fine and the fact that the tableadapters generated that way require a Devart.Data.PostgreSql.PgSqlConnection instead of a normal SqlConnection object also tells me I can't be missing to use your driver at all.

Is this a known restriction? I am doing there something wrong? I mean, I can't find anything in the forum, I can't be the first person to try to concat string using ||... obviously I am doing something wrong. But what? :D Please give me any leads.
Last edited by De Kus on Fri 17 Jan 2014 13:29, edited 1 time in total.
De Kus
 
Posts: 2
Joined: Thu 09 Jan 2014 09:42

Re: Error using postgresql syntax in DataTable SELECT-Statements

Postby Shalex » Tue 14 Jan 2014 13:20

Please use our DataSet wizard: the Tools > PostgreSQL > DataSet Wizard menu of Visual Studio. It is adjusted for working with PostgreSQL databases and parses PostgreSQL-specific SQL queries successfully.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Re: Error using postgresql syntax in DataTable SELECT-Statements [solved]

Postby De Kus » Fri 17 Jan 2014 13:30

Thank you very much. That indeed was the important thing I was missing. Using the Wizzard from the menu solves that issue and always me to use postgresql syntax in the statement creator.
De Kus
 
Posts: 2
Joined: Thu 09 Jan 2014 09:42


Return to dotConnect for PostgreSQL