473,508 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

export-import problem

I export data from a table that contains a varchar field that stores whole
names in it. Some of the names include the apostrophe character....
O'Neal, etc... When I attempt to import the data (using the copy command
the apostrophe kills the import. If I export the data with quotes around
the varchar field the quotes get stored inside the varchar field.
What the magic incantation to get apostrophes in textual data without
surrounding the data with quotes?
--
--
GreyGeek
Nov 23 '05 #1
2 3015
On Thu, 2004-10-28 at 19:39 -0500, GreyGeek wrote:
I export data from a table that contains a varchar field that stores whole
names in it. Some of the names include the apostrophe character....
O'Neal, etc... When I attempt to import the data (using the copy command
the apostrophe kills the import. If I export the data with quotes around
the varchar field the quotes get stored inside the varchar field.
What the magic incantation to get apostrophes in textual data without
surrounding the data with quotes?


Quotes have no special effect in COPY input:

junk=# create table jj (id INTEGER, jname text);
CREATE TABLE
junk=# copy jj from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
1 O'Neil
2 O'Grady
\.

junk=#

What precisely are you doing?

--
Oliver Elphick ol**@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"But they that wait upon the LORD shall renew their
strength; they shall mount up with wings as eagles;
they shall run, and not be weary; and they shall walk,
and not faint." Isaiah 40:31
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
On Thu, 2004-10-28 at 19:39 -0500, GreyGeek wrote:
I export data from a table that contains a varchar field that stores whole
names in it. Some of the names include the apostrophe character....
O'Neal, etc... When I attempt to import the data (using the copy command
the apostrophe kills the import. If I export the data with quotes around
the varchar field the quotes get stored inside the varchar field.
What the magic incantation to get apostrophes in textual data without
surrounding the data with quotes?


Quotes have no special effect in COPY input:

junk=# create table jj (id INTEGER, jname text);
CREATE TABLE
junk=# copy jj from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
1 O'Neil
2 O'Grady
\.

junk=#

What precisely are you doing?

--
Oliver Elphick ol**@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"But they that wait upon the LORD shall renew their
strength; they shall mount up with wings as eagles;
they shall run, and not be weary; and they shall walk,
and not faint." Isaiah 40:31
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

205
10458
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
1
1833
by: Do Park via SQLMonster.com | last post by:
Hello all, I don?t often export data from a table. I am wondering how you export data from a table. I?d like to know how you export in real world. Do you export data from a table to a flat...
5
10540
by: David | last post by:
I am a little confused by DB2 Backup and Export. I used "db2 backup db QAS to /dev/rmt0" backuping 650GB database to a IBM LTO 3581 (1 drive) only 11 hours. But I used "db2 export to /dev/rmt0...
7
14340
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
0
1949
by: David Valle | last post by:
Hi, i've follow an example that Gabriele G. Ponti wrote on 8/5/2003 about the export of a report made in Crystal Report in PDF format, this: ...
0
1235
by: crjunk | last post by:
According to the help files: ----- Exporting Reports with the Export Button The Export button is located at the top left corner of the CrystalReportViewer toolbar. When users click the Export...
1
5167
by: chaitu | last post by:
Hi, Can anybody tell me what the error code for Export is. Like i get the message SQL3104N The Export utility is beginning to export data to file...
4
1993
by: Steven T. Hatton | last post by:
<quote url="http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=53&rl=1"> exported Templates Last updated Sep 6, 2006. exported Templates The separate compilation model enables...
6
4104
by: jefftyzzer | last post by:
Friends: Let's say I'd like perform a delete, but before I delete, I'd like to export the target rows. I could use an export whose SELECT clause references the OLD TABLE of a DELETE, but the...
8
18737
by: iheartvba | last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file: DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
0
7226
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
7328
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
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.