Board index » delphi » Convatenating fields in Paradox

Convatenating fields in Paradox

Hi all
        I have been given a fairly large Paradox table which I am
going to use in a Delphi app.  It contains (among others) 4 fields
that I would like to concatenate into one.
        Is there a quick way to do this in paradox or the database
desktop or should I just write a Delphi app to do it?
                        TIA     TC
 

Re:Convatenating fields in Paradox


Quote
Tony Case wrote:

> Is there a quick way to do this in paradox or the database
> desktop or should I just write a Delphi app to do it?

Well, of course you can call that a 'Delphi App', but to
me it sounds like a few lines of code.
Let's say your TTable is Orders, and you want to concatenate
four fields to Field5, then the whole code would look something
like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Orders.Open;
  Orders.First;
  while not Orders.EOF do
  begin
    Orders.Edit;
    OrdersField5.AsString := OrdersField1.AsString
     + OrdersField2.AsString +OrdersField3.AsString
     + OrdersField4.AsString;
    Orders.Post;
    Orders.Next;
  end;
end;

Now you have those fields concatenated. Then a few more lines
of code with TQuery, and you have dropped (deleted) the
original four fields.

Markku Nevalainen

Re:Convatenating fields in Paradox


No need for a Delphi app. A simple query will take care of this, e.g.:

UPDATE Names
SET FullName=LastName || ", " || FirstName

"Tony Case" <t...@cases.demon.co.uk> schreef in bericht
news:ucamus8mtm7r7asu73jr1k7robbd8kib5k@4ax.com...

Quote
> Hi all
> I have been given a fairly large Paradox table which I am
> going to use in a Delphi app.  It contains (among others) 4 fields
> that I would like to concatenate into one.
> Is there a quick way to do this in paradox or the database
> desktop or should I just write a Delphi app to do it?
> TIA TC

Re:Convatenating fields in Paradox


You can also do it with QBE PARADOX
(F5)+fieldnamealias (chp1 for example) for each fields
then type calc (F5)chp1+(F5)chp2+(F5)chp3 en Resultfield

Sorry for my poor english

"M.H. Avegaart" a crit :

Quote
> No need for a Delphi app. A simple query will take care of this, e.g.:

> UPDATE Names
> SET FullName=LastName || ", " || FirstName

> "Tony Case" <t...@cases.demon.co.uk> schreef in bericht
> news:ucamus8mtm7r7asu73jr1k7robbd8kib5k@4ax.com...
> > Hi all
> > I have been given a fairly large Paradox table which I am
> > going to use in a Delphi app.  It contains (among others) 4 fields
> > that I would like to concatenate into one.
> > Is there a quick way to do this in paradox or the database
> > desktop or should I just write a Delphi app to do it?
> > TIA TC

Other Threads