Subject | Re: [IBO] Copy entire records without specifying the fields? IB_Datapump? |
---|---|
Author | Helen Borrie |
Post date | 2006-12-07T00:36:19Z |
At 09:47 AM 7/12/2006, you wrote:
the ready-made datapump tool in IB_SQL? For which FULL source code
is in everyone's IBO root, if you want to figure out how to roll your own.
Using the datapump component is toooo easy. It's a simple matter of
defining a select statement as your source, a parameterised insert or
update statement as your destination, and mapping the source outputs
to the destination parameters and you've got it. Ideally use a
tib_cursor for the source statement and a tib_dsql for the
destination statement. For the user interface - if you want the user
to decide the mappings - you can do the mappings in a TMemo, as Jason
does in the datapump tool. Don't even think of using a tib_query or
grids or any of that noisy stuff.
As for "not specifying the fields", well, this is sloppy practice at
any time. Do SELECT * if you must, but be sensible about ANY data
you write. You can easily pick up a comma-separated field list from
the last tab of the dataset display that you get in the IDE editors
(both via the connection and via the dataset editor itself). It's
the same interface that you see in the Browser tool of IB_SQL.
In any case, QLI can't copy blobs, AFAIR.
Helen
>Another option (not IBO-specific) that should be very quick, is to useErm, as long as one was going to use a tool, why would one go past
>QLI, the ancient command line tool that Ann masters, but is an unknown
>mystery to most of the rest of us (before SQL, I think it was the
>standard way of communicating with InterBase). I don't know how it
>works, and I have no idea whether it will copy records from one table to
>another or whether it removes existing records and makes both tables
>identical, but take a look at:
>
>http://bdn.borland.com/article/25170
the ready-made datapump tool in IB_SQL? For which FULL source code
is in everyone's IBO root, if you want to figure out how to roll your own.
Using the datapump component is toooo easy. It's a simple matter of
defining a select statement as your source, a parameterised insert or
update statement as your destination, and mapping the source outputs
to the destination parameters and you've got it. Ideally use a
tib_cursor for the source statement and a tib_dsql for the
destination statement. For the user interface - if you want the user
to decide the mappings - you can do the mappings in a TMemo, as Jason
does in the datapump tool. Don't even think of using a tib_query or
grids or any of that noisy stuff.
As for "not specifying the fields", well, this is sloppy practice at
any time. Do SELECT * if you must, but be sensible about ANY data
you write. You can easily pick up a comma-separated field list from
the last tab of the dataset display that you get in the IDE editors
(both via the connection and via the dataset editor itself). It's
the same interface that you see in the Browser tool of IB_SQL.
In any case, QLI can't copy blobs, AFAIR.
Helen