🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5106

Re: simple loop to copy all rows from one table to another. (using TVarRec)

#5106
From: Douglas Stites
Date: Thu, 12 Jul 2001 13:15
64 lines
2581 bytes
Thanks Mark .... Nice approach,
Minor syntactical corrections produce:

    OracleDataSet->Open();
    NewTable->Open();

   while (!OracleDataSet->Eof)
      {  NewTable->Append();
         for (int Index = 0; Index < OracleDataSet->FieldCount; Index++)
                {
NewTable->FieldByName(OracleDataSet->Fields->Fields[Index]->FieldName)->Valu
e
                            = OracleDataSet->Fields->Fields[Index]->Value;
                 }
         NewTable->Post();
         OracleDataSet->Next();
       }






"Mark Cashman" <mcashman@temporaldoorway.com> wrote in message
news:3B4CF967.F62A868C@temporaldoorway.com...
> Hi, Doulas!
>
> It might be better to try something like this...
>
> OracleDataSet->Open();
> NewTable->Open();
>
> OracleDataSet->First();
>
> while (!OracleDataSet->Eof)
> {
>     NewTable->Edit();
>
>     for (int Index = 0; Index < OracleDataSet->FieldCount; Index++)
>     {
>
>
NewTable->FieldByName(OracleDataSet->Fields->Fields(Index)->FieldName)->Valu
e
> =
>             OracleDataSet->Fields->Fields(Index)->Value; // Ensures that
> field is the same by name - does not reply on position
>     };
>
>     NewTable->Post();
>     OracleDataSet->Next();
> };
>
>
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
>
>
Technical Details
Message-ID: <3b4da38f_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b4c3fc2_2@dnews> <3B4CF967.F62A868C@temporaldoorway.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,28bedb73628f75d6
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-07-12 06:25:58 PST
Reply-To: "Douglas Stites" <dlstites@ix.netcom.com>
From: "Douglas Stites" <dlstites@ix.netcom.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b4c3fc2_2@dnews> <3B4CF967.F62A868C@temporaldoorway.com>
Subject: Re: simple loop to copy all rows from one table to another. (using  TVarRec)
Date: Thu, 12 Jul 2001 09:15:43 -0400
Lines: 66
Organization: Avatar
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 165.247.117.179
Message-ID: <3b4da38f_1@dnews>
X-Trace: dnews 994943887 165.247.117.179 (12 Jul 2001 06:18:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews