If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > using copy statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-11, 03:43
kirangentlebreeze kirangentlebreeze is offline
Registered User
 
Join Date: Oct 2010
Posts: 4
using copy statement

hello friends
i am new to this sql

i have values some thing like 1,'kkk','kumar'

using copy i need to put this values in the table

values should not come from file, i need to supply the values manually using copy and get it inserted to my table

copy students from (how can i supply values manually here)

any help is appreciated
Reply With Quote
  #2 (permalink)  
Old 04-06-11, 10:44
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
COPY is specifically for moving data between a table and a file.

Use INSERT to add rows manually.
Reply With Quote
  #3 (permalink)  
Old 04-07-11, 02:17
kirangentlebreeze kirangentlebreeze is offline
Registered User
 
Join Date: Oct 2010
Posts: 4
thank you friend for your response
i solved my problem to some extent
i used sumthing like this
copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
x|xx|xxxx
\.
copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
1|11|1111
\.
copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
1|22|222222
\.

after every record i am specifying an end marker
is there any possibility to have only one end marker i.e at the end of last record like this


copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
x|xx|xxxx

copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
1|11|1111

copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
1|22|222222
\.
Reply With Quote
Reply

Tags
postgres

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On