pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttmail.com>
To: pgsql-odbc@postgresql.org
Cc: Şeniz Ayşe MERCAN <senizm@mobiliz.com.tr>
Subject: "No Mapping exists" Error
Date: Wed, 11 Jun 2008 11:21:46 +0300
Message-ID: <87od681iw5.fsf@alamut.mobiliz.com.tr> (raw)

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.



Message-ID: <87od681iw5.fsf@alamut.mobiliz.com.tr>
Permalink:  ../87od681iw5.fsf@alamut.mobiliz.com.tr/
Also on:    postgresql.org/message-id/87od681iw5.fsf@alamut.mobiliz.com.tr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: yazicivo@ttmail.com, senizm@mobiliz.com.tr
  Subject: Re: "No Mapping exists" Error
  In-Reply-To: <87od681iw5.fsf@alamut.mobiliz.com.tr>
  References: <87od681iw5.fsf@alamut.mobiliz.com.tr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox