From: Cenk KIZILDAG <cenk1536@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Getting user created tables from SQL
Date: Sun, 2 Oct 2005 06:30:31 -0700 (PDT)
Message-ID: <20051002133031.305.qmail@web40501.mail.yahoo.com> (raw)
hi guys,
i m trying to get the user created tables from SQL by using C++ Builder.Here is the code:
TQuery *TableQuery;
TableQuery= new TQuery (this);
TQuery *TableCountQuery;
TableCountQuery= new TQuery (this);
TableQuery->DatabaseName = "TEMP";
TableCountQuery->DatabaseName = "TEMP";
TableCountQuery->SQL->Add ("SELECT COUNT(TABLE_NAME) AS CTABLE FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_TYPE = 'BASE TABLE')");
TableCountQuery->Open ();
int counttables = TableCountQuery->FieldByName ("CTABLE")->AsInteger;
TableCountQuery->Close ();
TableCountQuery->Free ();
TableQuery->SQL->Add ("SELECT TABLE_NAME AS TNAME FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_TYPE = 'BASE TABLE')");
TableQuery->Open ();
DynamicArray <AnsiString> CTableArr;
CTableArr.Length = counttables;
int f = 0;
while (!TableQuery->Eof)
{
CTableArr[f] = TableQuery->FieldByName ("TNAME")->AsString;
TableQuery->Next();
f++;
}
TableQuery->Close ();
TableQuery->Free ();
the first Select statement work correct, counttables variable gets the right value but unfortunately, after the second select statement, in C++ Builders SQL Explorer window, it brings the correct number of rows but without datas in them!!! In Enterprise Manager the second select statement also works correct but how come it aint work in C++ builder?
i would be grateful if you can help me
Thanks
CENK
THE PUBLICENEMY
http://www3.50megs.com/cenk1536/
CHAIRMAN Of Computer Information Systems Technology CLUB
---------------------------------
Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cenk1536@yahoo.com
Subject: Re: Getting user created tables from SQL
In-Reply-To: <20051002133031.305.qmail@web40501.mail.yahoo.com>
* 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