Quote character Unix to Oracle


 
Thread Tools Search this Thread
Top Forums Programming Quote character Unix to Oracle
# 1  
Old 04-15-2011
Quote character Unix to Oracle

Hi,

I'm trying to load data into an Oracle DB. A Perl script opens a file that was created with vi on Unix, connects to the DB and inserts data.
All characters (some of which are special characters) in my data can be loaded except for one:

'
It turns into something else in the DB.

The other quotes are fine ‘ ' "


I suspect the problem has to do with encoding of the file and Unix and Oracle characters sets, but I know very little about this subject.

Any quick hints? Or link to some place where this subject is described?
# 2  
Old 04-15-2011
Remember that in SQL, string literals are in ' and " is, by default, to making reserved words not recognized, like a column alias AS "Table". Sometimes, session or RDBMS options can make " work as an alternate to ' in matched pairs for string literals. Now, your PERL string literals are in ", so you have to escape any " in there. If you Oracle string data is presented using ', you need to escape any ' in there. Escapes are usually \ or doubling. You did not give a release, is this applicable: quoting string literals in 10g
# 3  
Old 04-15-2011
Thanks for the quick reply.
That's not the problem though. The characters are all inserted into the DB, only one of the quotes is converted to something else.
In vi on Unix, the odd quote character looks like /264
# 4  
Old 04-15-2011
Well, it does sound like your code page or whatever is way misaligned. Google up some info on how to inquire of the RDBMS character set, and how to set your client/connection character set. In ISO8859-1 or Latin 1, the \264 is the accent acute ´, not the single quote, and \140 is accent grave `, which some word processors like to use rather than the aymmetric apostrophe / single quote ' ! So, it is not quoting, it is code pages for funny punctuation.

Last edited by DGPickett; 04-15-2011 at 11:34 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

2. Shell Programming and Scripting

Replacing Double Quote in Double Quote incsv file

Hi All , We have source data file as csv file and since data could contain commas ,each attribute is quoted into double quotes.However problem is that some of the attributa data also contain double quotes which is converted to double double quote while creating csv file XLs data : ... (2 Replies)
Discussion started by: Shalini Badal
2 Replies

3. UNIX for Dummies Questions & Answers

Removing unnecessary eol ($) character from Oracle sql query output

Hi All, I am fetching oracle query result in shell variable. As columns numbers are more the output wraps in unix terminal .i.e one complete record in db gets store in multiple lines. with each line ends with $ character. I want to remove these unnecessary $ character but to keep required $... (8 Replies)
Discussion started by: Harshal22
8 Replies

4. Shell Programming and Scripting

How to match character with single quote?

I need to check whether first character of variable is single quote. I tried the below constructions but they are all not working (always return true) if (test `echo "$REGEXP" |cut -c1` != "'"); then echo "TRUE"; fi if (test `echo "$REGEXP" |cut -c1` != '\''); then echo "TRUE"; fi if (test... (5 Replies)
Discussion started by: urello
5 Replies

5. Shell Programming and Scripting

How do you print a single quote character in AWK

How do you print out a single quote character in AWK? Using the escape character does not seem to work. {printf "%1$s %2$s%3$s%2$s\n" , "INCLUDE", " \' ", "THIS" } does not work. Any suggestions? (6 Replies)
Discussion started by: cold_Que
6 Replies

6. Shell Programming and Scripting

replacing a quote in some lines with multiple quote fields

i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is 223;25 224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;; 300;X;Event:... (3 Replies)
Discussion started by: wradwan
3 Replies

7. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

8. UNIX for Dummies Questions & Answers

Oracle Password having special character

Hi I am trying to connect to oracle using shell script with username/pwd@constring The password is having special character . I have to ignore the special character else i am getting invalid username or password. How to achieve that My password is having $ , but the... (5 Replies)
Discussion started by: ssuresh1999
5 Replies

9. Shell Programming and Scripting

Capturing Data between first quote and next quote

I have input file like RDBMS FALIURE UTY8703 'USER_WORK.TEST' .HIghest return code '12' I want to parse data which comed between first quote till next quote USER_WORK.TEST can you please suggest how to do that (4 Replies)
Discussion started by: scorp_rahul23
4 Replies

10. UNIX for Dummies Questions & Answers

Error : no closing quote in unix

Hey I was stuck in middle of writing this script Can any one help me out of this I am writing this script to delete the log files certain days old and everything fine but when I run the script I always see error at the bottom ./PurgeOneParameter.ksh: no closing quote and for the last if... (4 Replies)
Discussion started by: pinky
4 Replies
Login or Register to Ask a Question