By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

How to use copy in a loop in windows?

P: 1
How to use copy in a loop in windows?
Apr 28 '11 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 700
Under windows it should be something like that
Expand|Select|Wrap|Line Numbers
  1. for %i in (<list of tables separated by spaces>)
  2. do 
  3. psql <database and user parameters> -c "COPY %i FROM E'C:\\bcp\\%i.txt' USING DELIMITERS ',' CSV"
  4.  
May 2 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.