[Interest] QSqlTableModel - table name issue in Postresql
Tony Rietwyk
tony at rightsoft.com.au
Mon Apr 8 03:00:04 CEST 2013
Hi Muhammad,
I don't know Postgresql at all. I believe it is based on Oracle. Your problem sounds like the table name was quoted in the create statement, leading to the mixed-case table name being stored in the database. After that you must always quote the table name in any sql, otherwise it gets converted to uppercase, and doesn't match.
What was the create statement used for the table?
What is the exact error message you are getting back?
Tony.
From: interest-bounces+tony=rightsoft.com.au at qt-project.org [mailto:interest-bounces+tony=rightsoft.com.au at qt-project.org] On Behalf Of M. Bashir Al-Noimi
Sent: Monday, 8 April 2013 1:44 AM
To: Sviatoslav Feshchenko; interest at qt-project.org
Subject: Re: [Interest] QSqlTableModel - table name issue in Postresql
Some how this issue is related but not directly.
Does any one has an idea how to pass table name directly as string?
On Sat, Apr 6, 2013 at 3:58 PM, Sviatoslav Feshchenko <sviatoslav at outlook.com> wrote:
See if your issue is related to QTBUG-30076 <https://bugreports.qt-project.org/browse/QTBUG-30076>
On 2013-04-06, at 8:30 AM, Muhammad Bashir Al-Noimi <mbnoimi at gmail.com> wrote:
Hi All,
Recently I noticed that I’ve to add double quotes to table’s name for calling Postgresql’s table while it’s not required for MySQL or SQLite tables!!
how can I make QSqlTableModel works in same way for three types of SQL databases?
Posgtresql:
p_tableModel->setTable("\"Persons\"");
MySQL & SQLite:
p_tableModel->setTable("Persons");
--
Best Regards,
Muhammad Bashir Al-Noimi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130408/9353e6a3/attachment.html>
More information about the Interest
mailing list