Re: Error in Adding All Tables

From: justin <justin(at)emproshunts(dot)com>
To: salman Sheikh <salman_sheikh(at)web(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Error in Adding All Tables
Date: 2008-11-02 02:27:27
Message-ID: 490D100F.3020000@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes, i'm working with VS 2008 with QT framework working on a
application with i don't know couple hundred thousand lines of code.<br>
<br>
Been using VS sense 1997  how about you???<br>
<br>
One of your big problems is your using the Automatic Class builder. 
Its sucks and is what is causing your problem as it creates code that
don't work.<br>
<br>
Case in point the SQL code is wrong.  <br>
<br>
In this case the Select statement being created is trying to join two
tables together that have the same column name <br>
<br>
Select * from mytable, othertable where ctid = ctid <br>
this command will create the error you have <br>
<br>
now to avoid the error it should look like this <br>
Select * from mytable, othertable where mytable.ctid = othertable.ctid<br>
<br>
Now Postgresql knows what you want it to do.  Before the Postgresql has
two columns with the same name and does not understand how to join the
two tables<br>
<br>
Find the the code where the Select statement is change the Joining
argument <br>
<br>
<br>
salman Sheikh wrote:
<blockquote cite="mid:1388758290(at)web(dot)de" type="cite">
<p><br>
Hi Justin</p>
<p>thanks for helping me,</p>
<p>But can i ask u ,have u ever worked with Visual C++ 2005.It does
every thing automatically,u just click on the button it will generats
all classes, for example View class, document class Set class and so
on,Set class is actually connection class,which connect application
with database, and shows all columns of the table which we added in
this application,thatwhy i dont need to write any sql code for adding
all table,how long i know,if i am wrong pls correct me.</p>
<p>thanks once more Jusitn</p>
<p>sheikh<br>
</p>
<table id="alt"
style="border-left: 2px solid blue; padding-left: 10px; font-size: 9pt; margin-left: 20px; font-family: Verdana;">
<tbody>
<tr>
<td>
<hr><b>Von:</b> "justin" <a class="moz-txt-link-rfc2396E" href="mailto:justin(at)emproshunts(dot)com">&lt;justin(at)emproshunts(dot)com&gt;</a><br>
<b>Gesendet:</b> 02.11.08 02:02:21<br>
<b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:pgsql-general(at)postgresql(dot)org">pgsql-general(at)postgresql(dot)org</a><br>
<b>Betreff:</b> Re: [GENERAL] Error in Adding All Tables<br>
<br>
<p>you mean you are trying some kind of table joining correct???<br>
<br>
example<br>
<br>
Select * from mytable, othertable where ctid = ctid ???<br>
<br>
Please post the SQL statement you are using to communicate with
thedatabase.  <br>
The select insert update commands.   If i could see what you are doingi
would have solved your problem 3 emails ago. <br>
<br>
just post the C++ code that has the problem <br>
<br>
<br>
<br>
<br>
salman Sheikh wrote:</p>
<blockquote>
<p><br>
 Hi </p>
<p>i just want to add table through MFC application,in Visual
C++ itgenerates all classes automatically,if i add table one by one,it
showsno problem.i can comunicate with my database.But if i add 2 or
moretables togather,then it shows this error, i dont know why?</p>
<p>sheikh<br>
</p>
<table id="alt"
style="border-left: 2px solid blue; padding-left: 10px; font-size: 9pt; margin-left: 20px; font-family: Verdana;">
<tbody>
<tr>
<td>
<hr><b>Von:</b> "justin" <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:justin(at)emproshunts(dot)com">&lt;justi
n(at)emproshunts(dot)com&gt;</a><br>
<b>Gesendet:</b> 02.11.08 01:48:04<br>
<b>An:</b> <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:pgsql-general-owner(at)postgresql(dot)org">pgsql-general-owner(at)postgresql(dot)org</a><br>
<b>Betreff:</b> Re: [GENERAL] Error in Adding All Tables<br>
<br>
<p>I have no idea what you are trying to do??   please
send theSQLcommands you are using.  <br>
<br>
For me to help you<br>
Need to know what you are trying to accomplish and need to see the code!<br>
<br>
<br>
salman Sheikh wrote:</p>
<blockquote>
<p><br>
 hi</p>
<p>Do u ha ve any suggestion regarding this problem?</p>
<p>can u add all tables once in postgresql?</p>
<p>In MS access i can add table once without any
problem.</p>
<p>sheikh<br>
</p>
<table id="alt"
style="border-left: 2px solid blue; padding-left: 10px; font-size: 9pt; margin-left: 20px; font-family: Verdana;">
<tbody>
<tr>
<td>
<hr><b>Von:</b> "justin" <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:justin(at)emproshunts(dot)com">&lt;justin(at)emproshunts(dot)com&gt;&lt;
/A&gt;<br>
<b>Gesendet:</b> 02.11.08 01:23:15<br>
<b>An:</b> salman Sheikh <span><br>
<b>CC:</b> </span></a><a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:pgsql-general(at)postgresql(dot)org">pgsql-general(at)postgresql(dot)org</a>,<a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:pgsql-odbc(at)postgresql(dot)org">pgsql-odbc(at)postgresql(dot)org</a><br>
<b>Betreff:</b> Re: [GENERAL] Error in Adding
All Tables<br>
<br>
@WEB.DE&gt;
<p>salman Sheikh wrote:</p>
<blockquote><br>
<br>
<table id="alt"
style="border-left: 2px solid blue; padding-left: 10px; font-size: 9pt; margin-left: 20px;">
<tbody>
<tr>
<td>
<p>Hi freinds, <br>
i wanted to add my all tables once in MFC application,</p>
<p>i have a databank,which has 11
tables and iwant toa dd themall togather.</p>
<p> After Adding all tables, it shows
me alwaysthiserrors bydebugging.</p>
<p><br>
ERROR: column reference "ctid" is ambiguous; <br>
Error while executing the query <br>
</p>
<p>i need help from u ppl. I am using
VisualC++ 2005andpostgresql 8.3.<br>
</p>
<p>thanks <br>
She ikh </p>
<br>
<br>
<table border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<td bgcolor="#000000"><img
moz-do-not-send="true" alt="" src="https://img.web.de/p.gif" border="0"
height="1" width="1"></td>
</tr>
<tr>
<td
style="font-size: 12px; font-family: verdana;">Psssst!Schonvom
neuenWEB.DE MultiMessenger geh&amp;oum l;rt?    <br>
Der kann`s mit allen: <a moz-do-not-send="true"
href="http://www.produkte.web.de/messenger/?did=3123"><b>http://www.produkte.web.de/messenger/?did=3123</b></a>  </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
</blockquote>
<br>
Without looking at the sql statement you are using its kinda
hardtoknowwhat the problem is<br>
<br>
but ambiguous column means the Postgresql can't figure o ut
whatyouwantto do as the column shows up twice in a command.<br>
<br>
<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#000000"><img
moz-do-not-send="true" alt="" src="https://img.web.de/p.gif" border="0"
height="1" width="1"></td>
</tr>
<tr>
<td
style="font-size: 12px; font-family: verdana;">n5Schritten zur eigenen
Homepage. Jetzt Domain sichern und gestalten!    <br>
Nur 3,99 EUR/Monat! <a moz-do-not-send="true"
href="http://www.maildomain.web.de/?mc=021114"><b>http://www.maildomain.web.de/?mc=021114</b></a>  </td>
</tr>
</tbody>
</table>
</blockquote>
<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#000000"><img moz-do-not-send="true" alt=""
src="https://img.web.de/p.gif" border="0" height="1" width="1"></td>
</tr>
<tr>
<td style="font-size: 12px; line-height: 17px;">er
WEB.DESmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!   <br>
<a moz-do-not-send="true"
href="http://smartsurfer.web.de/?mc=100071&amp;distributionid=000000000066"><b>http://smartsurfer.web.de/?mc=100071&amp;distributionid=000000000066</b></a>  </td>
</tr>
</tbody>
</table>
</blockquote>
<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#000000"><img moz-do-not-send="true"
src="https://img.web.de/p%0A%20.gif" alt="" border="0" height="1"
width="1"></td>
</tr>
<tr>
<td
style="font-family: verdana; font-size: 12px; line-height: 17px;">n 5
Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten!    <br>
Nur 3,99 EUR/Monat! <a moz-do-not-send="true"
href="http://www.maildomain.web.de/?mc=021114"><b>http://www.maildomain.web.de/?mc=021114</b></a>  </td>
</tr>
</tbody>
</table>
</blockquote>
<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 10.5 KB

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2008-11-02 03:07:19 Re: speed up restore from dump
Previous Message justin 2008-11-02 02:01:41 Re: Error in Adding All Tables