X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 58FC0D9902 for ; Sun, 2 Oct 2005 10:30:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04647-05 for ; Sun, 2 Oct 2005 13:30:29 +0000 (GMT) Received: from web40501.mail.yahoo.com (web40501.mail.yahoo.com [66.218.78.118]) by svr1.postgresql.org (Postfix) with SMTP id EB3BFD9911 for ; Sun, 2 Oct 2005 10:30:28 -0300 (ADT) Received: (qmail 307 invoked by uid 60001); 2 Oct 2005 13:30:31 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Fc4f/dbiqHb3ueKCIZXrVHYUIh6A5uJAd2imxwiWtBDmWl4D8+hWskM64QPUp2Tjr0mKSx/st8Fjn9RVuvlEsd4lpX2Qi3lrr9SE79GifTUtFPr3CFrbBWQ9fT1E8w5U14hQCmZdZH++QOWcuYRj8Mn/wV3FvFONyzyUWHmAZL4= ; Message-ID: <20051002133031.305.qmail@web40501.mail.yahoo.com> Received: from [62.29.32.74] by web40501.mail.yahoo.com via HTTP; Sun, 02 Oct 2005 06:30:31 PDT Date: Sun, 2 Oct 2005 06:30:31 -0700 (PDT) From: Cenk KIZILDAG Subject: Getting user created tables from SQL To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1950920692-1128259831=:98766" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.193 required=5 tests=[DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516, HTML_50_60=0.095, HTML_MESSAGE=0.001, UPPERCASE_25_50=0.207] X-Spam-Level: * X-Archive-Number: 200510/22 X-Sequence-Number: 22875 --0-1950920692-1128259831=:98766 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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. --0-1950920692-1128259831=:98766 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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. --0-1950920692-1128259831=:98766--