replace special characters in sql select
Hello
I have a little problem with one colunm blob in a db.
A blob contains a text with decimal characters (an application writes this colunm in HTML), for example:
Kedves Koll & #233 g & #225; k!
& #193; He's & #225; sfoglal & #225; sotokat k & #233; RJ & #252; k a csatolt panasz & #252; gyben (PI-1167/2014.).
& #220; gyf & #233; ladatok
n & #233; v: lives & #225; RIS Anetta
How could I replace the decimal characters with ascii characters?
Thans a lot
set define off
SELECT UTL_I18N. UNESCAPE_REFERENCE ('Kedves Kollegak!)
Allasfoglalasotokat Kerjuk a. csatolt panaszugyben (PI-1167/2014.)
Ugyfeladatok
Nev: Anetta Vitaris') FROM dual
UTL_I18N. UNESCAPE_REFERENCE('KEDVESKOLLéGáK!) Allasfoglal & #225
--------------------------------------------------------------------------------
Kedves Kollegak!
Allasfoglalasotokat Kerjuk a. csatolt panaszugyben (PI-1167/2014.)
Ugyfeladatok
Nev: Vitaris Anetta
1 selected line.
Tags: Database
Similar Questions
-
Hello
I need SQL or PL/SQL code to replace special characters such as!, @, #, $, %, ^ of the given string.
For example, if the given string is
"it is - test * strin #g to @ spe % ial charact!" ERS"he should replace all special characters and provide the output voltage
It's test string with special characters
Please enter the code
Thank you
You have commas in the character set block and the [[: alnum:]] is equivalent to [a-zA-Z0-9], you may want to include a space in this updated chacter block.
Select REGEXP_REPLACE ("This is test * strin #g to @ spe % ial charact!") ERS ',' [^ [: alnum:]] *', ")
of the double
Output
It's test string with blue characters
EDIT: I do not know what will want the characters allow the OP. For example, a comma, question mark, comma, colon, apostrophe, full stop etc. are all valid in a sentence.
-
Hello
I had a question about the escaping special characters in Oracle. Let's say I have a table column that contains data like '% _Tester % '. I ideally if we do a select on this table, it would be something like
Select * from table where column like '% \_TEST%' escape ' \'
However, when I run this query on sql developer
Select * from table where column like 'TEST %', it returns the same result. (without exhaust the character special _.)
I was just wondering, if this is because default sqldeveloper escapes special characters? or do we still have to write the leak as a good practice?
Thank you!
Ryan
Lines that are LIKE 'TEST %' will include all lines that are LIKE '\_TEST% %' ESCAPE ' \'. If all lines which that interest you conform to the mask, they will also appear when you perform the first. You can have records that correspond to the first but not the second, although:
SQL > create table testdata until
SELECT 'ABCTESTXYZ' val double UNION ALL
SELECT "AB_TESTXYZ" FROM double
Table created.
SQL > SELECT * FROM testdata WHERE val LIKE '\_TEST% %' ESCAPE ' \'
VAL
----------
AB_TESTXYZ
1 selected line.
SQL > SELECT * FROM testdata WHERE val LIKE '% TEST % '.
VAL
----------
ABCTESTXYZ
AB_TESTXYZ
2 selected lines.
-
Resolution IASCI games for (slang word) special characters in SQL
It comes with the special character slang word in the varchar2 column.
For example, one of my table receives the values in the columns of website... In colunm, we used to receive the varchar to e o words as values in the normal English word.
Column values are like "Hellò Dàvid". Have we not all features standard oracle to replace these words in slang (in o (e) normal English words (a, e, o a - z, A - Z).SQL> select translate('Hellò Dàvid','àéò','aeo') from dual; TRANSLATE(' ----------- Hello David
-
Replacing special characters with its actual value
Hi all
Anyone have an idea how to replace an extended character (ASCII ranging from 128 to 255 value) for its actual character set in SQL/PLSQL?
For example: '½' should be replaced on a "1/2".
'¼' should be replaced with "1/4"
Ultimately if the value is "California 71 ½" then the result should be "California 71 1/2". "."
Thanks for your time!
Kind regardsREPLACE the function?
SQL> select replace('California 71 ½', '½', '1/2') from dual; REPLACE('CALIFORNIA71½','½','1 ------------------------------ California 71 1/2
-
XMLType.extract cannot display French special characters in the select statement
Hello
E characters (acute e) get distorted when they are retrieved from the
XMLType column of an ordinary table.
How can we solve correctly get the characters e (acute e)?
We tried setting 'setenv NLS_LANG French_France.WE8ISO8859P1' and
"setenv NLS_LANG French_France.WE8DEC" before loading the table.
Database version:
The test sample case is as follows:SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production PL/SQL Release 11.2.0.2.0 - Production CORE 11.2.0.2.0 Production TNS for Linux: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Production
Output is the following with setenv NLS_LANG French_France.WE8ISO8859P1--connect to any schema where you can store XMLType set long 2000; set pagesize 2000; set serveroutput on; --delete from test; drop table test; create table test (id number, xmldata XMLType); declare featureDescriptorXML CLOB; xml_type XMLType; new_xml_type XMLType; myName varchar2(100); myName2 varchar2(100); myName3 varchar2(100); stmt varchar2(4000); begin featureDescriptorXML := '<?xml version="1.0" encoding="UTF-8"?>' || '<abc:TheFeature xmlns:' || 'de' || '="' || 'http://abc.klmno.org/fghde' || '" xmlns:abc="http://www.ghijklmn.net/abc"' || ' xmlns:xyz="http://www.ghijklmn.net/xyz">' || '<abc:Name>de:MyGénérique</abc:Name>' || '</abc:TheFeature>'; xml_type := xmltype(featureDescriptorXML); myName := xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal(); dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType variable is ' || myName); -- can show French chars insert into test(id, xmldata) values(20, xml_type); stmt := 'select t.xmldata.extract(''/abc:TheFeature/abc:Name/text()'', ''xmlns:abc="http://www.ghijklmn.net/abc"'').getStringVal() from test t'; execute immediate stmt into myName2; dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is ' || myName2); -- cannot show French chars stmt := 'select t.xmldata from test t'; execute immediate stmt into new_xml_type; myName3 := new_xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal(); dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from first XMLType column and then from XMLType variable in 3rd version is ' || myName3); -- cannot show French chars end; / select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal() from test t; -- Cannot show French chars select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal() "myname" from test t; -- Cannot show French chars select t.xmldata.getCLOBVal() from test t; -- Cannot show French chars select t.xmldata from test t; -- Can show French chars
and NLS_DATABASE_PARAMETERS are the following:SQL> select * from nls_database_parameters; PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET WE8DEC NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_RDBMS_VERSION 11.2.0.2.0 20 ligne(s) sélectionnée(s).
We also tried affecting NLS_CHARACTERSET AL32UTF8Table creé. abc:Name value stored in VARCHAR2 variable from XMLType variable is de:MyGénérique abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is de:MyGénérique abc:Name value stored in VARCHAR2 variable from first XMLType column and then from XMLType variable in 3rd version is de:MyGénérique Procdure PL/SQL terminée avec succès. T.XMLDATA.EXTRACT('/ABC:THEFEATURE/ABC:NAME/TEXT()','XMLNS:ABC="HTTP://WWW.GHIJK -------------------------------------------------------------------------------- de:MyGénérique myname -------------------------------------------------------------------------------- de:MyGénérique T.XMLDATA.GETCLOBVAL() -------------------------------------------------------------------------------- <?xml version="1.0" encoding="DEC-MCS"?> <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz"> <abc:Name>de:MyGénérique</abc:Name> </abc:TheFeature> XMLDATA -------------------------------------------------------------------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz"> <abc:Name>de:MyGénérique</abc:Name> </abc:TheFeature>
by CHARACTER SET of ALTER DATABASE.
the database is closed and restarted.
But that did not help.
Thank youOk. Wasn't sure. Thank you for that clarification.
.. .but please make an attempt with XMLTABLE XMLQUERY, XMLCAST (or CAST) and other XML functions that support XQuery and not to use the engine of 'old '... I hope that these features will keep things as it should...
.. .If not... create an SR with support of Oracle on this issue. Changes, if you base your SR on these 'old' operators XML/SQL and functions that are her will not be able to help, mainly due to the fact that your last version and stuff like EXTRACT / getStringVal() etc. are announced officially discouraged in this 11.2.0.2.0 version. As far as I know the t.xmldata.extract, the xml_type.extract and the other syntaxes, outlaw count of 10.1 (although I know, he appealed to java / OO people kind).
Published by: Marco Gralike April 5, 2011 19:50
-
Replace special characters in the FDF
Hello
I've looked everywhere and can't find the answer to this simple problem. I can handle javascript in an HTML environment using free scripts, but it is not so easy in a PDF form. I use Adobe Acrobat 9 Pro and I have a form that once completed and submitted, generates and sends a FDF file. I use a script on the server side, called FormGenie do this and the script hate parentheses and some other characters, they break the FDF file. Everything I want to do is set up a document level Javascript that find and replace all instances of these special characters with something license as a hyphen - or just a space.
I tried:
function clearText() {}
document. FormName.FieldName.Value = filterNum (document. FormName.FieldName.value)function filterNum (str) {}
re = /\$|#|~|\%|\*|\^|\(|\)|\+|\=|\[|\]|\[|\}|\{|\;|\"|\<|\>|\?| \|| \\|\!| \$/g;
remove special characters as ' $' and ',' etc...
return str.replace (re, "-");
}
}and
function clearText2 (str) {}
stringName = stringName.replace (/------$| #| ~ |------% |------* |------^ | \(|\) |--------+ |------= |------[|------] |------[{|------} |------{|------; |------"|"}]) ------< | ------> | \ ? | \|| \\|\!| \$ /g,'-');
}I know that these are not good, but I have to be at least barking to the top of the tree on the right.
Can anyone help?
Thank you
You create the form in Acrobat or LiveCycle Designer?
In general, you can place a script typo in the script of the text of each filter field field hit, in the case where something replacing the user typed with something else would not cause the concern of the user. An alternative would be to be implemented a script that parses the fields just before the submission form action takes place and not to replace them.
For example, you can use the following JavaScript typo customized for text fields created in Acrobat:
If (! event.willCommit) {}
Event.change = event.change.replace (/ [------$# ~ %------*------*------^ \ (\)------+=------[\]------{\};------"\<\>\?]) \ | \\\ !] /g, "-");
}
and it will replace these characters when the user types the data into a text field. May not include all the character you want replaced, but you should get the idea.
\> -
I have a page with a javascript tip which is fed with elements of a database query. Some of the results have special characters that my with the javascript syntax, in fact only 3 of them.
Single quote, double quote and------.
If I set & #34; in the database, it displays as a double in the ToolTip without problem, so what I want to do is to replace all occurrences of "with & #34;" and even with the others. The------should be replaced by------to view. I find it hard to do... any suggestions would be helpful... Here's my current attempt...
< cfset temp = Replace (tester.loc_notes, ' "',' & #34;', 'ALL'") >
Thank youIf these quotes are displayed to the user, use " ", " or HTMLEditFormat().
It is difficult to be more precise, unless you attach the code in question.
-
What happened to search for and replace special characters
I'm a recent update of FrameMaker 9 FrameMaker 11. I use several notations with nonbreaking hyphens and nonbreaking spaces. In version 9, I was able to use the hexadecimal codes in the Find/Replace dialog box and search and replace these ratings. Now in version 11, it does not find these characters. I end up getting more I want.
For example: I want to find
(E Vote, September 12, 2008)
This text has a non-breaking hyphen and showing spaces are nonbreaking. When I entered the document these characters, I used the combination of keys "Esc hyphen:" for the hyphen and "Ctrl + space" for spaces.
When I enter "(E\x15Vote\x10Sept.\x1012,\x102008)" and press the button Search, FrameMaker converts the text to "(E\+Vote\s#Sept.\s#12,\s#2008)" and refers to a "Not Found" statement. I get the error even if I copy the text and paste it into the Find/Replace dialog box. I tried with "Deal", "use wildcards" and whole-word checks both market. I can't find it.
Honestly, I never noticed if verstion 9A made the conversion of \x15 to------+ and dialog of \x10 to \s#, in the search/replace because he always found what I was looking for.
I hope someone can tell me how to solve this problem, because it is a feature I use all the time in FrameMaker. I use hyphens and nonbreaking spaces everywhere in my documents.
I also reported this as a bug because that's what happens if feels like to me. I went out and updated my installation of FrameMaker, thinking that this may have been reported and already corrected.
A sad FrameMaker user
Chris
I'm not sure that's what you're looking for, but you might.
Copy your text ' E-voting, September 12, 2008'.
Go to Find/replace
Select text and character Formats Clipboard from the drop-down
Click on Search.
-
Replace special characters in a string
Let's say that someone copies the list as follows and the glue in a Javascript dialog box:
302304
305678
245675
How do I manipulate the string so that it reads:
302304 305678 245675
In other words, how to replace manual line breaks in a string with spaces?
Thank you!
It's the cleanest method that you are looking for:
/[\n\r]/
In this case, even a simple \s would work, but it's maybe not what the OP...
Substances
-
Replacing special characters when writing to a file
I use the following to replace Muñoz (n with null). It should produce as Muoz.
This should be simple, but it does not work. 209 and 241 represent the upper and the lower case n.
This statement is a CFFILE. I'm generating the file but the n is still there.
Replace (LGL_NM, Chr (209) & chr (241),'3 ', 'all')
I also tried without success the following:
< cfset x = ReplaceNoCase(#Object_query.) LGL_NM #, "#Chr (209) # ',' ', 'all') > '"
< cfset LGL_NM = ReplaceNoCase (x, "#chr (241) #","", "all" "") >Help, please.
Thank you!
Bill
#REReplaceNoCase (testString, "[#chr (209) ##chr (241) #]", "", "all") #. -
special characters in sql developer
Hello
on 11.2.0.4
I have this request:
update set mytable = col1' about & law ';
in sqlplus or sqldevloper
Then I asked: Bill:?
Then according to the documentation, I rewrite as:
Update mytable set col1 = 'about\ & law;
or:
Update mytable set col1 = {subject & Bill};
But I'm always invited.
Thanks for the help.
set define off
-
Special characters could not load DB via SQL * MORE
Hi, I have a pl as .accidentally sets sql script which will insert data in database. The question is there are some records are missing and these missing records contains a special character: Sansao and Strasse. The strange was if I run the script via F5 (Toad), all data can be inserted successfully but run through SQL * MORE (Toad), all records that contain special characters are not inserted.
Anyone here know why it didn't load these special characters via SQL * MORE?
Probably because you have given unicode (multi byte charsets) you read with a customer of standard single-byte character set.
It's SILLY to loading data using SQL * more. It's the wrong tool used for loading the data. It does not support the bind variable. It doesn't support liaison in bulk. It does not support direct path inserts. It is not SQL * Loader.
-
Replace sepcial characters in a Server stored on via PLSQL
Hi Experts,
I have a requirement in which I need to replace special characters by alphabets in a file stored on the server in a directory.
EG - symbol € with E
symbol (at) with @.
I want to do this via a Pl Sql stored procedure.
I tried and script worked great for small files, but it is a failure for large files.
for your Script reference, I've been trying-
DECLARE
l_tmp_blob by DEFAULT EMPTY_BLOB() BLOB;
l_bfile BFILE.
l_dest_offset INTEGER: = 1;
l_src_offset INTEGER: = 1;
l_file_content VARCHAR2 (32767).
l_outfile UTL_FILE. TYPE_DE_FICHIER;
BEGIN
l_bfile: =.
BFILENAME ('TEST_ATTACH ','TEST_ZERO_SIZE.txt '
);
DBMS_LOB. OPEN (l_bfile, DBMS_LOB.file_readonly);
DBMS_LOB.CREATETEMPORARY (l_tmp_blob, TRUE);
DBMS_LOB.loadblobfromfile (l_tmp_blob,
l_bfile,
DBMS_LOB.lobmaxsize,
l_dest_offset,
l_src_offset
);
DBMS_LOB. CLOSE (l_bfile);
BEGIN
SELECT mob_util_pck.blob_to_varchar (l_tmp_blob)
IN l_file_content
Double;
END;
Start
mob_util_pck. DELETE_FILES ("TEST_ATTACH",
'TEST_ZERO_SIZE.txt '.
);
END;
l_file_content: = REPLACE (l_file_content, ' €', 'E');
l_file_content: = REPLACE (l_file_content, ' @', '(at)');
l_file_content: = REPLACE (l_file_content, '&', '+');
l_file_content: = REPLACE (l_file_content, 'to', 'a');
l_file_content: = REPLACE (l_file_content, 'e', 'e');
l_file_content: = REPLACE (l_file_content, 'e', 'e');
l_file_content: = REPLACE (l_file_content, c ","c");
l_file_content: = REPLACE (l_file_content, 'e', 'e');
l_file_content: = REPLACE (l_file_content, 'u', 'u');
l_file_content: = REPLACE (l_file_content, 'e', 'e');
l_file_content: = REPLACE (l_file_content, 'i', 'i');
l_file_content: = REPLACE (l_file_content, ' \', ' / ');
l_file_content: = REPLACE ([l_file_content, '] ',')');
l_file_content: = REPLACE (l_file_content, ' ^ ','.');
l_file_content: = REPLACE (l_file_content, '_', '-');
l_file_content: = REPLACE (l_file_content, "',"');
l_outfile: = UTL_FILE. FOPEN ('TEST_ATTACH', 'TEST_ZERO_SIZE.txt', 'w');
UTL_FILE. PUT (l_outfile, l_file_content);
UTL_FILE. FCLOSE (l_outfile);
END;
/
Please help me with this.
Regards-
Vikrant
I'm testing with CLOB, but I don't know if I can REPLACE on CLOB and write a file with the CLOB.
REPLACEMENT work, UTL_FILE doesn't.
You can use, for example:
DBMS_XSLPROCESSOR.clob2file (l_tmp_clob, 'TEST_ATTACH', 'TEST_VIKS1108062013115301.xml');
-
Reports character - special characters
Hi!, I have a problem, I am using character mode report and it creates a PostScript in UNIX, reports creates a bar code with a function, but this function has special characters and the system automatically replaced by '? 'or '! '.
The function is:
FUNCTION F_GETBARCODE(pv_digitos_afip IN VARCHAR2) RETURN VARCHAR2 IS -- ln_len NUMBER; lv_pair VARCHAR2(50); lv_codebar VARCHAR2(50) := '{'; -- TYPE ARRAY_T IS VARRAY(101) OF VARCHAR2(10); ARRAY ARRAY_T := ARRAY_T('!','"','#','$','%','&','''','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F', 'G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l', 'm','n','o','p','q','r','s','t','u','v','w','x','y','z','¡','¢','£','¤','¥','¦','§','¨','©','ª'); BEGIN -- SELECT LENGTH(pv_digitos_afip)/2 INTO ln_len FROM DUAL; -- FOR i IN 1..ln_len LOOP -- SELECT SUBSTR(pv_digitos_afip,i+i-1,2) INTO lv_pair FROM DUAL; -- lv_codebar := lv_codebar||ARRAY(TO_NUMBER(lv_pair+1)); -- END LOOP; -- lv_codebar := lv_codebar||'}'; -- RETURN lv_codebar; END;
If the number is, 909192 him forge function returns {¢ £}, but returns {!}
The problem is with this "" characters, "¢", "£",'¤ ', ' ¥ ', '¦', ' § ', '¨', 'to', 'ª', I can't create the barcode without solution or ¿Some ideas because. ?
Thank you cordially.I solved the problem in UNIX with this script, replacing special characters:
SED s/special_1-i / /' $salida
SED s/special_2-i / ¢ /' $salida
SED s/special_3-i / £/ ' $salida
sed-i of/special_4 / ¤ /' $salida
SED s/special_5-i / ¥ /' $salida
SED s/special_6-i /... /' $salida
SED s/special_7-i / § /' $salida
SED s/special_8-i / ¨ /' $salida
sed-i of/special_9 / © /' $salida
SED s/special_10-i / ª /' $salida
Maybe you are looking for
-
Word of the day screen saver loading of words but no definitions.
Word of the screen saver of the day showing the "Entry not found" error for every word from installation of Sierra. Would welcome suggestions for fixing this.
-
What's emoji
-
X 305-Q705 - GPU and CPU upgrades possible?
Question 1:I know that on some models have 2 GPU.How can I upgrade the 9700 M GTS and I use crossfire or SLI? Question 2:What processor can I buy for my laptop? Thank you very muchZyon
-
Webcam initialization failed on Satellite L870-14V
Hello When I want to use my webcam, I have an error message "Failed to initialize the webcam."Check the operation of the camera, and then restart the application or restart the computer"to know that I restart the computer and it does not change the w
-
I, m Bob a ball came saying that the firewall is disabled, I went in ave and tutned it then I am I at risk because the antvirous is disabled and I did everything I could do to try to turn it on but can't find anywhere that it says to turn under. all