Subject | Re: [firebird-support] Copy Table to Another Database |
---|---|
Author | LtColRDSChauhan |
Post date | 2017-11-22T00:35:33Z |
On Tue, Nov 21, 2017 at 10:33 PM, Dimitry Sibiryakov sd@... [firebird-support] <firebird-support@yahoogroups.com> wrote:21.11.2017 15:52, LtColRDSChauhan rdsc1964@... [firebird-support] wrote:
> Please see if the under mentioned procedure is good enough:
I would do the contrary: select on external source and local insert. It is better forI could not frame select on external source and local insert. Can you please help here.performance. But if your SP work for you, it is good.My procedure worked with good performance. I had to amend a bit: the number of ?s passed as place holders in the values should be equal to the number of fields.Just in case some one else needs this, I please put the correct procedure for records:SET TERM ^ ;
ALTER PROCEDURE COPY_theTABLE
AS
declare variable FIELD_1 varchar(80);
declare variable FIELD_2 varchar(80);
BEGIN
for select p.FIELD_1, p.FIELD_2 from the_TABLE into :FIELD_1, :FIELD_2
do execute statement
('insert into the_TABLE values(?, ?)') /* the number of ?s passed as place holders in the values should be equal to the number of fields */
(:FIELD_1, :FIELD_2)
ON EXTERNAL 'ExternalServer:C:\External_Target.FDB'
AS USER 'SYSDBA' PASSWORD 'masterkey';
END^
SET TERM ; ^
--
WBR, SD.
------------------------------ ------
------------------------------ ------
++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++ ++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/ resources/documents/
++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++ ++++++
------------------------------ ------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ firebird-support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ firebird-support/join
(Yahoo! ID required)
<*> To change settings via email:
firebird-support-digest@ yahoogroups.com
firebird-support-fullfeatured@ yahoogroups.com
<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@ yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/ us/yahoo/utos/terms/