473,786 Members | 2,608 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 3028
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
10712
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
1858
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 file or what type? There are many selections when you choose file type. When do you need to export data? How often? Do you use DTS rather than export wizard?
5
10619
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 of ixf messages MKPF.msg select * from mkpf" on the same 3581, and this table is only 5GB, but the export used 4 hours. What's the diffirent between Backup and Export? I mean except backup is used to backup whole database or tablespace, and export...
7
14371
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 display the graph but it is not possible to send query parameters to an OLE graph on a report (or programatically change any properties of an OLE Graph). However with a Form you do have the ability to change the RowSource of
0
1973
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: ------------------------------------------------------------------------ This is how I export reports to PDF files: Dim diskOpts As New DiskFileDestinationOptions ' load report m_Report.Load(strReport)
0
1256
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 button, a dialog box prompts them for the export format. The Export button appears automatically unless you disable the viewer toolbar (in which case you can either prompt users for export options, or use code to export with specific options).
1
5404
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 "/home/db2as/sqllib/bluee_tables1/DBCHECK.ixf". if it is beginning to export and
4
2005
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 us to define functions, types and objects in one translation unit and refer to them from other translation
6
4159
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 issue is I'm deleting the table in chunks, like so: WHILE (V_NO_DATA = 0) DO DELETE FROM
8
18823
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", "C:\qryFFRDeFile.txt", True Access asks for a specification name, now here lies the challenge, how do I create an export specification I have tried the following 2 methods: In access 2007: Step1: I right clicked the query and chose export to...
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.