How to use copy in a loop in windows?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sukuchha
    New Member
    • Apr 2011
    • 1

    How to use copy in a loop in windows?

    How to use copy in a loop in windows?
    Last edited by Niheel; Nov 5 '11, 08:36 PM.
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Under windows it should be something like that
    Code:
    for %i in (<list of tables separated by spaces>)
    do 
    psql <database and user parameters> -c "COPY %i FROM E'C:\\bcp\\%i.txt' USING DELIMITERS ',' CSV"

    Comment

    Working...