Special Characters in Create Table......
How can I use & sign in the column name in Create Table Statement:
Create Table
(aa&bb varchar2(10));
You can create table with column name having "&" in the following way... but I won't recommend that because you'll have problems when you would need to Query the table or perform any DML operation!!
SQL> Create Table not_good_practise
2 ("aa&bb" varchar2(10));
Enter value for bb: &bb
old 2: ("aa&bb" varchar2(10))
new 2: ("aa&bb" varchar2(10))
Table created.
SQL> desc not_good_practise
Name Null? Type
aa&bb VARCHAR2(10)
SQL> drop table not_good_practise;
Table dropped.
Be sure ... why you want to do something like this before you put it in your design.
Similar Messages
-
How to insert & # special characters into oracle table?
I have a text value which contains special characters such as & and #.
After I pass from one page to another,
TEST& becomes "TEST&"
I put " " on the above test, otherwise amp; will be truncated by OTN).
TEST# becomes TEST (# is truncated).
Actually the value is saved in table like this: "TEST&"
How to solve this problem?
How to insert & into table without &
Thank you.
Edited by: user628655 on Jul 27, 2009 9:47 AM
Edited by: user628655 on Jul 27, 2009 9:49 AM
Edited by: user628655 on Jul 27, 2009 10:39 AMAvoid doing that through a link. If this is a page item then submit the page and redirect to the target page using a branching. On the target page, create a computation to compute the target item using the original page item as the source. If you are talking about a report, use the id to pass through the link and fetch the text column in an on load computation.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------ -
Oracle SQL query for getting specific special characters from a table
Hi all,
This is my table
Table Name- Table1
S.no Name
1 aaaaaaaa
2 a1234sgjghb
3 a@3$%jkhkjn
4 abcd-dfghjik
5 bbvxzckvbzxcv&^%#
6 ashgweqfg/gfjwgefj////
7 sdsaf$([]:'
8 <-fdsjgbdfsg
9 dfgfdgfd"uodf
10 aaaa bbbbz#$
11 cccc dddd-/mnm
The output has to be
S.no Name
3 a@3$%jkhkjn
5 bbvxzckvbzxcv&^%#
7 sdsaf$([]:'
8 <-fdsjgbdfsg
10 aaaa bbbbz#$
It has to return "Name" column which is having special characters,whereas some special chars like -, / ," and space are acceptable.
The Oracle query has to print columns having special characters excluding -,/," and space
Can anyone help me to get a SQL query for the above.
Thanks in advance.You can achieve it in multiple ways. Here are few.
SQL> with t
2 as
3 (
4 select 1 id, 'aaaaaaaa' name from dual union all
5 select 2 id, 'a1234sgjghb' name from dual union all
6 select 3 id, 'a@3$%jkhkjn' name from dual union all
7 select 4 id, 'abcd-dfghjik' name from dual union all
8 select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
9 select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
10 select 7 id, 'sdsaf$([]:''' name from dual union all
11 select 8 id, '<-fdsjgbdfsg' name from dual union all
12 select 9 id, 'dfgfdgfd"uodf' name from dual union all
13 select 10 id, 'aaaa bbbbz#$' name from dual union all
14 select 11 id, 'cccc dddd-/mnm' name from dual
15 )
16 select *
17 from t
18 where regexp_like(translate(name,'a-/" ','a'), '[^[:alnum:]]');
ID NAME
3 a@3$%jkhkjn
5 bbvxzckvbzxcv&^%#
7 sdsaf$([]:'
8 <-fdsjgbdfsg
10 aaaa bbbbz#$
SQL> with t
2 as
3 (
4 select 1 id, 'aaaaaaaa' name from dual union all
5 select 2 id, 'a1234sgjghb' name from dual union all
6 select 3 id, 'a@3$%jkhkjn' name from dual union all
7 select 4 id, 'abcd-dfghjik' name from dual union all
8 select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
9 select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
10 select 7 id, 'sdsaf$([]:''' name from dual union all
11 select 8 id, '<-fdsjgbdfsg' name from dual union all
12 select 9 id, 'dfgfdgfd"uodf' name from dual union all
13 select 10 id, 'aaaa bbbbz#$' name from dual union all
14 select 11 id, 'cccc dddd-/mnm' name from dual
15 )
16 select *
17 from t
18 where translate
19 (
20 lower(translate(name,'a-/" ','a'))
21 , '.0123456789abcdefghijklmnopqrstuvwxyz'
22 , '.'
23 ) is not null;
ID NAME
3 a@3$%jkhkjn
5 bbvxzckvbzxcv&^%#
7 sdsaf$([]:'
8 <-fdsjgbdfsg
10 aaaa bbbbz#$
SQL> -
Special characters & numbers in tables....
Hello...
I've just started using Pages '08 and I'm having a couple of problems.....
Firstly.... I can't seem to insert special characters.... when I click Edit > Special Characters... nothing happens.... is there something wrong with my software?
Secondly.... When I try to insert a value such as 1.00 into a table Pages automatically corrects it to 1, deleting the decimal places.... how can I change this?....
Any help at all would be great...... Thanks...Firstly.... I can't seem to insert special characters.... when I click Edit > Special Characters... nothing happens.... is there something wrong with my software?
There is a possible fix here:
http://docs.info.apple.com/article.html?artnum=307354 -
How to find Special Characters in a table ?
Hi,
I have a problem, during a data upload by the client, some special characters were uploaded in the database.
Sample data : " AC Power Cord Denmark "
I want to find all records containing such special characters and update them.
TOAD is able to display these characters but when i copy them onto the query... it doesnt work.
Can we know which encoding is that ? or do something to take care of this ?
Thanks in Advance.
Message was edited by:
Champinsert into t1 values ('joe$%"likes#$%#to*()ride%^$#his bike');
1 rows inserted
select * from t1;
C1
joe$%"likes#$%#to*()ride%^$#his bike
1 rows selected
select translate(c1,'!@#$%^&*()"',' ') from t1;
TRANSLATE(C1,'!@#$%^&*()"','')
joe likes to ride his bike
1 rows selected
update t1 set c1 = translate(c1,'!@#$%^&*()"',' ');
1 rows updated
select * from t1;
C1
joe likes to ride his bike
1 rows selectedI didn't notice your special special characters, but it still works:
insert into t1 values ('joe likes his'||chr(22));
select * from t1;
select translate(c1,chr(22),' ') from t1;
update t1 set c1 = translate(c1,chr(22),' ');
select * from t1;
Message was edited by:
JoeC -
How to insert some special Characters in a table
Dear All
I have a value with some italian Characters ..
Like :- )
e l’attivazione - Here the ' symbol is not single quote , it is some ITALIAN characters .
So how can i insert .
I have value like :- e l’attivazione "Trasloco Linea Telefonica”, disponibili sul portale TUO, sezione Accessi/Traslochi"
Insert into ABC values ('e l’attivazione "Trasloco Linea Telefonica”, disponibili sul portale TUO, sezione {code}Accessi/Traslochi"');Hey,
You can run below command to insert such value in single column of the table.
INSERT INTO ABC VALUES ('e l’attivazione "Trasloco Linea Telefonical, disponibili sul portale TUO, sezione Accessi/Traslochi"');
or you need to get ascii value of the character '’'
e.g.
SELECT ASCII('’') FROM dual;
O/P
14844057
then use this ASCII value in CHR function while inserting data into table
INSERT INTO ABC VALUES ('e l'||CHR(14844057)||'attivazione "Trasloco Linea Telefonical, disponibili sul portale TUO, sezione Accessi/Traslochi"');
When you will query the data from table you be get below value for that column.
e l’attivazione "Trasloco Linea Telefonical, disponibili sul portale TUO, sezione Accessi/Traslochi"
Regards,
Nisarg -
How to remove special characters in a particular column
Hello,
i have a csv feed and i load it into a sql table (the sql table has all varchar data type fields)
feed data looks like (just sampled 2 rows but my file has thousands of like this)
"K" "AIF" "AMERICAN IND FORCE" "FRI" "EXAMP" "133" "DISPLAY" "505250" "MEDIA INC." 03/01/10" "INV31202" ".00" ".00" "0.00" "ALLO" ;
"K" "AIF" "AMERICAN IND FORCE" "THU" "TRTH" "123" "MUN MARCH 2010" "505099" "SOCIALTYZE" "03/01/10" "1308" "40,282.32" "40,282.32" "45564.64" "DIS" ;
some times i got some special characters in my table column (example: in my invoice no column some time i do have # or ! kind of invalid characters ) so how can i remove some kind of special characters in my column
once it is eliminated then i can write it to new table (with correct data format such as integer)
could some one please tell me how can i remove special character in a column of particular table
thanks in advance
asitaRemoves any characters from
@myString that do not meet the
provided criteria.
CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
RETURNS varchar(500) AS
BEGIN
While @myString like '%[^' + @validChars + ']%'
Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
Return @myString
END
Go
Declare @testStr varchar(1000),
@i int
Set @i = 1
while @i < 255
Select
@TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
@i = @i + 1
Select @TestStr
Select dbo.GetCharacters(@TestStr,'a-z')
Select dbo.GetCharacters(@TestStr,'0-9')
Select dbo.GetCharacters(@TestStr,'0-9a-z')
Select dbo.GetCharacters(@TestStr,'02468bferlki')
perfect soluction -
Special characters in CLOB are making report fail
Hi-
I am working on a report which is refering CLOB column from database. If the CLOB had special characters like & or <, the report is returning error 'Expected name instead of .' I created a view and stored CLOB as varchar2 and refered the view in query and the report works fine, but the drawback of this is varchar2 max limit is 4000 chars and the text i intend to show is more than 4000 chars.
Can someone share any ideas on how to get around this error?
Thanks in advance.Hmm, thought I'd dig a little to see what you guys mean. Indeed XML Publisher Data Template doesn't translate CLOB special characters and so BIP chokes!
My advice - log a bug and write XML output in PL/SQL.
Here's my working for reference (note spaces added after & to preserve special chars!):
CREATE TABLE test_clob (
id NUMBER(15)
, file_name VARCHAR2(1000)
, file_contents CLOB
, timestamp DATE
insert into test_clob
(id,file_name, file_contents)
values
(3,'Greeting = <Hello, world>','Greeting = <Hello, my funky file contents>');
ed gg.sql
select '<?xml version="1.0" encoding="UTF-8" ?>'
from dual;
select xmlelement("row",
xmlelement("file_name", file_name),
xmlelement("file_contents", file_contents))
from test_clob
where id = 3;
:q
set serverout off termout off echo off verify off head off trimspool on
set lines 300 pages 0 long 20000
spool gg.xml
@gg
spool off
exit
cat gg.xml
<?xml version="1.0" encoding="UTF-8" ?>
<row><file_name>Greeting = & lt;Hello, world& gt;</file_name><file_contents>Greeting = & lt;Hello, my funky file contents& gt;</file_contents></row>
OKAY: both fields translated! Let's try using dataTemplate
<?xml version = '1.0' encoding = 'utf-8'?>
<dataTemplate name="XXV8_CLOB" description="$Header$" defaultPackage="" Version="1.0">
<parameters>
</parameters>
<properties>
<property name="include_parameters" value="true" />
<property name="include_null_Element" value="true" />
<property name="include_rowsettag" value="false" />
<property name="scalable_mode" value="on" />
<property name="debug_mode" value="off" />
</properties>
<dataQuery>
<sqlStatement name="Q_LOBS">
<![CDATA[
select file_name, file_contents
from test_clob
where id = 3
]]>
</sqlStatement>
</dataQuery>
</dataTemplate>
OUTPUT:
<?xml version="1.0" encoding="UTF-8"?>
<XXV8_CLOB>
<LIST_Q_LOBS>
<Q_LOBS>
<FILE_NAME>Greeting = & lt;Hello, world& gt;</FILE_NAME>
<FILE_CONTENTS>
Greeting = <Hello, my funky file contents></FILE_CONTENTS>
</Q_LOBS>
</LIST_Q_LOBS>
</XXV8_CLOB>
CHOKE:
Post-processing of request 2805016 failed at 18-MAR-2008 22:59:19 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
Error message in OPP output processor:
Template code: XXV8_CLOB
Template app: XXV8
Language: en
Territory: US
Output type: PDF
[3/18/08 10:59:18 PM] [UNEXPECTED] [752315:RT2805016] java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:517)
at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:224)
at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1657)
at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:967)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5888)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3438)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
Caused by: oracle.xdo.parser.v2.XMLParseException: Expected name instead of ,.
at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:324)
at oracle.xdo.parser.v2.XMLReader.scanNameChars(XMLReader.java:1056)
at oracle.xdo.parser.v2.XMLReader.scanQName(XMLReader.java:1768)
at oracle.xdo.parser.v2.NonValidatingParser.parseAttr(NonValidatingParser.java:1444)
at oracle.xdo.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1394)
at oracle.xdo.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1225)
at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:266)
... 17 moreAs you can see the varchar special characters are "escaped" or translated or whatever you want, but not the CLOB!
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/ -
Using Special characters in Insert statement
Hi All,
I want to insert special characters in my table. Here is my query
insert into COM_TAB(TAB_COMMENTS) VALUES('ADAM'S FARM & FARM-GANG APPLE GOOGLE') .Please help.Also tel me is there any method to handle special characters like using ascci values for itPut the & and ' as below
create table com_tab(tab_comments varchar2(128));
insert into COM_TAB(TAB_COMMENTS) VALUES('ADAM''S FARM ' || '&' || ' FARM-GANG APPLE GOOGLE')
select * from com_tab
TAB_COMMENTS
ADAM'S FARM & FARM-GANG APPLE GOOGLE -
Best way to give tablename in create table statement
hi all,
what's the best way to give table name while "create statement" in case of performance..
for eg:
create table tablename(id int,name varchar(20))
a.) tablename
b.) [tablename]
c.) (tablename)
d.) "tablename"
pls its urgent..
thanks in advance..
lucky>b.) [tablename]
As Naomi pointed it out, the above is dangerous because unintentionally special characters or space can be included and accepted by SQL Server.
Once you introduce special characters in the table name, you have to use [....] forever.
Related QUOTENAME:
http://technet.microsoft.com/en-us/library/ms176114.aspx
a is the best choice.
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Find All Special Characters in a SQL Server
I would like to find all Special Characters in a table. I am currently using the code below. Not sure if this gets all of them.
select top 50 *
from [dbo].[SV20150122]
where street LIKE '%[^0-9a-zA-Z @\.\-]%'
SQLDepends on what you want to count as a special character. Depending on your collation, your query might not consider é (for example) as a special character. The same goes for other accented letters. If that's what you want, then fine.
If that is not what you want, you may want to do
where street LIKE '%[^0-9a-zA-Z @\.\-]%' Collate Latin1_General_BIN
In any case, you can see exactly which characters are NOT counted as special characters on your system (with and without the Collate clause) by running
Declare @Test Table(ID int, MyData char(1));
;With cte As
(Select 0 As Number
Union All
Select Number + 1
From cte
Where Number < 255)
Insert @Test(ID, MyData)
Select Number, CHAR(Number)
From cte Option(MaxRecursion 256);
Select ID, MyData From @Test
Except
Select ID, MyData From @Test
Where MyData LIKE '%[^0-9a-zA-Z @\.\-]%'
Select ID, MyData From @Test
Except
Select ID, MyData From @Test
Where MyData LIKE '%[^0-9a-zA-Z @\.\-]%' Collate Latin1_General_BIN
Note: the above code assumes the column street is char or varchar.
Tom -
Identify special characters in oracle 9i
HI,
I want to identify the special characters in a table.Right now i am using oracle 9i version.
Please help us.You can use following pl/sql block for this purpose. It will check if there is any special character in a field(item description here) and will display that display the position and ascii value of that special character. Later you can write another query(if needed) to remove those special characters.
Modify the query as needed.
declare
l_desc VARCHAR2(90);
l_length NUMBER;
l_cnt NUMBER := 1;
l_char VARCHAR2(20);
l_spc_char NUMBER := 0;
CURSOR c1 is select segment1, description, length(description) length1 from mtl_system_items_b where 1=1 rownum < 10000 and segment1 = '00000942304A330'
and organization_id = 156;
begin
FOR c_rec IN C1
LOOP
l_cnt := 1;
l_spc_char := 0;
WHILE l_cnt <= c_rec.length1
LOOP
l_char := SUBSTR(c_rec.description,l_cnt,1);
IF (ascii(l_char) < 32 or ascii(l_char) > 126) then
DBMS_OUTPUT.PUT_LINE('Character: '||l_char||' Position: '||l_cnt||' Ascii Value: '||ascii(l_char));
l_spc_char := l_spc_char + 1;
end if;
l_cnt := l_cnt + 1 ;
END LOOP;
IF l_spc_char > 0 THEN
DBMS_OUTPUT.PUT_LINE('Item: '||c_rec.segment1||' Description: '||c_rec.description);
END IF;
END LOOP;
end; -
I am creating a list of words with special characters in some of them. I get to a point where I cannot enter data directly into the cell. I have to use the data entry bar at the top in the toolbar. Any solutions available?
This is the table I am creating...
From row 25 on, I am only able to enter data into the cell through the toolbar at the top and not directly into the cell itself. I believe that this problem originates from the special characters I have inserted in the previous records because if I do not use special characters, then the spreadsheet acts flawlessly. Have there been issues in Numbers with data entry, the size of a table, and using special characters?I would try removing the rows with "special" characters one at a time to see which one is causing the problem
-
hi,
i am having a requirement to create/use "add link to a document" content type for a item in the document library.
so i got the code from below site :
http://howtosharepoint.blogspot.in/2010/05/programmatically-add-link-to-document.html
my issue is, if teh document library names are single words - like MOM, model, procedures etc this functionality is working fine and i am able to view the link to a document as an item.
but when the doc lib name contains special characters like , or / , this link to a document content type functionality is NOT working.
can anyone pls point me whether this is the actual issue ? ie, if the doc lib name contains special chars like , or / my
add link to a document wont work? is there any restrictions/limitations for doc lib names in SharePoint ?
for eg: my doc lib names are :
1) Report and analysis, Data
2) form / template
3) map/ plot
help is highly appreciated!hi,
its talking abt the subsite names and folders and NOT the document librraies.
is there any link which gives the naming convention / restricted names for document libs or splists , from msdn / blogs.technet.
thnx -
Can't show special characters (ÆØÅ) in pdf fields created with inDesign CS6
Hi Guys im having a problem with special characters in pdf's form fields created in inDesign CS6
instead of the character ÆØÅ it creates squares or some other seemingly random character
Here's the pdfI figured it out
Just in case people had the same problem here is how it's done: (i misunderstood the two posters above me, so you are actually going to change fonts within acrobat, like they said, and save it)
Open the pdf in acrobat, go and change font settings for each of your fields and change the font under the "Appearance" tab.
Maybe you are looking for
-
I was trying to clean up my playlists in iTunes and in doing so accidentally deleted my "Recently Added" wheel playlist. I really want it back so I can see what I have recently added when I download or open things in iTunes. Is there any way to get
-
Paypal Payment Without Credit Card
I want to sign up a learning software ( treehouse - coding software ) and I wanted to buy the 1 month member but when I click buyand fill all the form , I selected Paypal and then It display you need to link the credit card so you can pay . But I do
-
I replaced the black cartridge with a new HP cartridge. Now it won't rpint what is requested of it, butonly a page, nearly blank, but with some blue text. (Appears to come from Yahoo mail: has my yahoo mail address, and soem symbols at side to p
-
Sample resume for an sap bi fresher
hello every one... i have completed my masters, and have done a course in SAP BW/BI , now i want to get a job in this field , so can any one please forward me the sample resume format for a SAP BI cunsoltant as a fresher..
-
i am going to migrate and upgrade database from 8.1.7 / 2000 server to 10.2.0.1.0 / OEL using exp and imp ie take exp from source database( 8i ) install OEL / 10.2.0.1.0 IN ANOTHER SERVER create empty datebase with necessary tablespaces. import the d