Subject RE: [firebird-support] FBCOPY - how to copy a table.
Author Chris Voronin
Thank you very much, I will try that.


Chris Voronin




-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Milan Babuskov
Sent: Friday, September 08, 2006 1:46 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] FBCOPY - how to copy a table.

Chris Voronin wrote:
> I have 2 databases, exact same databases just one has a table that I need
to
> copy over, just one table called "REPORTS". And I just can't figure out
how
> to do that via fbcopy tool.
>
> Here is what I attempted:
> Fbcopy S sysdba:masterke@c:\test\from.fdb sysdba:masterke@c:\test\to.fdb
> That doesn't let me select which tables to copy and doesn't copy.

FBCopy needs to get the table name via stdin. If you have grep
installed, you can do it on a single line with something like this:

fbcopy d sysdba:masterke@c:\test\from.fdb sysdba:masterke@c:\test\to.fdb
| grep REPORTS | fbcopy c sysdba:masterke@c:\test\from.fdb
sysdba:masterke@c:\test\to.fdb


If not, then you need to use a temporary file:

fbcopy d [src] [dest] > list.txt

Edit the list.txt (with Notepad for example) and remove all but the line
that starts with REPORTS. Then run the copy:

fbcopy c [src] [dest] < list.txt

Note: I used [src] and [dest] to make it look cleaner, replace them with
"sysdba:masterke@c:\test\from.fdb" and "sysdba:masterke@c:\test\to.fdb".

> Can someone please help me on this one? I tried online documentation,
it's
> confusing me.

You can ask further fbcopy-related questions at firebird-tools list, or
e-mail me directly.

--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links