"No Mapping exists" Error

From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Cc: Şeniz Ayşe MERCAN <senizm(at)mobiliz(dot)com(dot)tr>
Subject: "No Mapping exists" Error
Date: 2008-06-11 08:21:46
Message-ID: 87od681iw5.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

There is a DataSet1.xsd dataset in a web service project developed in
Visual Studio .NET environment. A fill method in the table adapter of
this dataset has below connection string:

<add
name="ConnectionString"
connectionString="Data Source=xxx.xxx.xx.xx;Initial Catalog=xxx;User ID=xxx;Password=xxx"
providerName="System.Data.SqlClient" />

Then, I define a system DSN using ODBC data source manager. In the
dialog, I type related PostgreSQL database connection properties (host,
dbname, etc.).

After that, I introduce a new dataset (DataSet2.xsd) to the same
project. While adding a table adapter to this dataset, I select freshly
introduced DSN using "New Connection" option.

Now, I copy the SQL query string -- displayed in Query Builder -- used
in DataSet1 to DataSet2. The query string working without a problem in
the DataSet1, gets transformed into a new scheme when we try to execute
it in DataSet2:

DATASET1 QUERY
--------------
select yyy.muid
from xxx inner join
yyy inner join
mmm on yyy.muid = mmm.muid inner join
eee on yyy.eventlogid = eee.eventlogid and
mmm.muid = eee.muid inner join
ddd on mmm.muid = ddd.muid and
eee.eventlogid = ddd.eventlogid inner join
ccc on eee.eventcode = ccc.eventcode on
xxx.groupid = mmm.groupid inner join
fff on xxx.fleetid = fff.fleetid inner join
kkk on fff.kkkid = kkk.kkkid inner join
ggg on
kkk.kkkid = ggg.kkkid
left outer join
vvv inner join
vvvlog on vvv.driverid = vvvlog.driverid on
mmm.muid = vvvlog.muid and
eee.eventlogid = vvvlog.eventlogid
where (eee.”time” >?) and
(mmm.networkid = ?) and (eee.”time” < ?) and
(ggg.username = ?)

DATASET2 QUERY (AFTER TRANSFORMATION)
--------------
SELECT yyy.muid
FROM emove.yyy, emove.mmm, emove.eee, emove.ddd, emove.ccc, emove.fff,
emove.kkk, emove.ggg, emove.vvvlog,
{ oj emove.xxx LEFT OUTER JOIN
emove.vvv ON mmm.muid = vvvlog.muid AND
eee.eventlogid = vvvlog.eventlogid }
WHERE xxx.groupid = mmm.groupid AND
yyy.muid = mmm.muid AND
yyy.eventlogid = eee.eventlogid AND
mmm.muid = eee.muid AND
mmm.muid = ddd.muid AND
eee.eventlogid = ddd.eventlogid AND
eee.eventcode = ccc.eventcode AND
xxx.fleetid = fff.fleetid AND
fff.kkkid = kkk.kkkid AND
kkk.kkkid = ggg.kkkid AND
vvv.driverid = vvvlog.driverid AND
(eee."time" > ?) AND
(mmm.networkid = ?) AND
(eee."time" < ?) AND
(ggg.username = ?)

When we execute the transformed query, Query Builder complains that:

Error Source: PSQLODBC.DLL
Error Message: ERROR [42P01] ERROR: invalid reference to FROM-clause entry for table “mmm”

If we'd directly issue the query using New Table Adapter Wizard (without
touching Query Builder interface), in the last step the wizard complains
that

No Mapping exists from DbType Object to a known OdbcType.

Moreover, if we'd comment out the WHERE clause used in the above query
(typed in New Table Adapter Wizard), query gets executed without a
problem.

We'll be really appreciated for any kind of help and suggestion. Even
alternative methods are welcome.

Regards.

P.S. PostgreSQL ODBC driver is installed via PostgreSQL 8.3.1 windows
binary package.

Browse pgsql-odbc by date

  From Date Subject
Next Message Richard Broersma 2008-06-11 12:32:45 Re: what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE
Previous Message Richard Huxton 2008-06-11 07:07:28 Re: what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE