Subject | Re: [firebird-support] Help with Queries |
---|---|
Author | Helen Borrie |
Post date | 2004-06-26T11:57:49Z |
At 08:26 AM 26/06/2004 +0000, you wrote:
insert into table1 (col2, col3, col4, .....)
select col2, col3,col4, ... from table1
where blah...
to start a single transaction spanning both connections. How (or IF) you
can do this depends on the data access components you're using. Select the
set from database a into a dataset then use a parameterised INSERT
statement to add the rows to the table in the other database, i.e. the
client has to mediate.
The datapump tool in IB_SQL uses this technique and allows you to massage
the data en route if needed. It uses the IB Objects TIB_DataPump component
so you can write an application to do the same thing.
/heLen
>Using Firebird 1.5 & BCB 5.0isn't available in DSQL
>
>What is the best/simplist way to accomplish these things.
>(My searching found results on UPDATE,
>FETCH
>& REPLACE INTO,isn't supported.
>but noAssuming in both cases you are using generator + trigger to poplulate the PK:
>exact examples of what I want to accomplish)
>
>1) I have a table with 15 columns & 256 rows, col 1 is the PK, .
> I want to update all the columns (except the PK) in row x after a
>select from row y.
> i.e. copy a row to another row
insert into table1 (col2, col3, col4, .....)
select col2, col3,col4, ... from table1
where blah...
>2) As above but with x & y being a range e.g. y = 1 to 20 & x = 51exactly the same, just a different WHERE clause in the query
>to 71 i.e. copy 20 rows.
>3) As 1 & 2 above but with with the source & destination rowsYou can't do this directly. You'll need a connection for each database and
>belonging to tables in a different database.
to start a single transaction spanning both connections. How (or IF) you
can do this depends on the data access components you're using. Select the
set from database a into a dataset then use a parameterised INSERT
statement to add the rows to the table in the other database, i.e. the
client has to mediate.
The datapump tool in IB_SQL uses this technique and allows you to massage
the data en route if needed. It uses the IB Objects TIB_DataPump component
so you can write an application to do the same thing.
/heLen