"No Mapping exists" Error - Mailing list pgsql-odbc

From Volkan YAZICI
Subject "No Mapping exists" Error
Date
Msg-id 87od681iw5.fsf@alamut.mobiliz.com.tr
Whole thread Raw
List 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.

pgsql-odbc by date:

Previous
From: Richard Huxton
Date:
Subject: Re: [GENERAL] what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE
Next
From: "Richard Broersma"
Date:
Subject: Re: [GENERAL] what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE