473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to copy data from one table to other table

111 100+
HII all,
im working on postgresql database where i want to copy the data from one table to other table....

when im trying to write the sql query..

ERROR: 42601: syntax error at or near "ABH0001" at character 701
LOCATION: yyerror, scan.l:609

In statement:
COPY "Tbl_Students_Dalitch" ("Student_Code", "Project_Location", "Student_Name", "Date_of_Birth", "Gender", "Father_Name", "Father_Occupation", "Mother_Name", "Mother_Occupation", "Family_Income", "Religion", "Caste", "Family_Members", "Family_Background", "Height", "Weight", "General_Health", "Recent_Illness", "Health_Comments", "Date_of_Admission", "Class_of_Admission", "Present_Class", "Staff_Firstname", "Subject_Name", "Sport_Name", "Exam_Performance", "Academic_Comments", "Cocurricular_Activities", "Photograph", "Info_Date", "Comments", "Corrections", "Reports", "Letters", "Status", "Approved", "Changed_Status", "Posted_On", "Live_Status", "Website_Name", "Sponsor_Status") FROM stdin;
ABH0001 Abohar B 1999-08-08 M Shagan Lal Police Constable Surjeet Kaur Housewife 3000.00 Hindu Scheduled Caste 5: Father, Mother, Manjeet (elder sister), Ravinder (elder brother) and Bhuperder. Bhupender`s father is a Police constable. Though he earns a good salary, he spends most of the money in drinking. His grand mother also stays with them. Both his brother and sister go to school. 97 13 Healthy - - 2003-07-14 LKG LKG Nemneih Kim Hindi Athletics C Must work hard He is interested in drawing. 1 2005-08-01 SUCCESS-Update \N \N \N 0 1 N 2007-06-07 Y dalitchild.com 0

IM GETTING THE ERROR AT FROM stdin;

can anyone help me out with this error..???


THNX......
Jun 7 '07 #1
1 3734
michaelb
534 Expert 512MB
You did not specify a delimiter to the COPY command, so make sure that all values in the list are separated with a tab.
I'm pretty sure that working in text mode you also need to terminate the input with \. (backslash-period) combination, and keep each record on a separate line.

If this does not help you may get more info from the COPY man page.

By the way, if both tables live in the same database you don't need to use the COPY command.
Jun 10 '07 #2

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

Similar topics

1
by: Ryan | last post by:
I have a stored procedure which copies data from a view into a temporary table (x2) and then from the temporary table into a table which the users use. It takes 1 minute to get the data into the...
3
by: Alex | last post by:
I have a "source" table that is being populated by a DTS bulk import of a text file. I need to scrub the source table after the import step by running appropriate stored proc(s) to copy the source...
3
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
1
by: Bastian Blank | last post by:
I'm using postgresql 7.4.2 and COPY FROM don't trigger INSERT rules. Definitions: | CREATE TABLE log.package_status ( | version integer NOT NULL, | architecture integer NOT NULL, | ...
6
by: sql_server_user | last post by:
I'm trying to copy all 440 million rows from one table in my SQL Server 2005 db to another table with a different clustering scheme. After a few test inserts that were successful (up to a million...
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
1
by: David | last post by:
Hi, I have an MS Access app which lets me create a new product by copying data from another selected product. All works fine, except one of the copy updates which I cannot fathom. The code...
4
by: colmkav | last post by:
Hi, I need to copy a linked table but without keeping the link. ie all the data and settings accept for the link to another db. How can I do this? Colm
4
by: remya1000 | last post by:
i'm using VB.NET i have 4 computers in network. when i press a button i need to delete a table from computer 2,3,4 and i need to copy that table from computer 1 to 2,3,4. and this file is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.