Insering quoted string in a table
i have a string liek the following in a variable
hello'786'
Please tell me how to insert this into a table
> But these data is coming from a file
i am fetching it in a variable.
I have to insert it
pls tell me how
Just insert the variable. That simple.
The variable contains a string. The string contains quotes. But you deal, at INSERT time, with the variable - not the actual contents of the variable. Oracle will grab and insert that contents just fine, provided that is is of a valid type. And quotes are valid in a string.
So...create or replace procedure ....
line varchar2(4000);
begin
-- string has been read from file into line, and this now
-- has to be inserted into the table foo
insert into foo ( text_line ) values ( line );
end;
Similar Messages
-
Can I use the quoted string in the field like dbms-column or table-name
I see some examples like table name using quoted string in the weblogic-rdbms20-persisstence-810.dtd.
Can the experts tell me how the quoted string should be used for EJB 20?Hi,
Whether the identifiers should be quoted or not depends whether they were defined that way when the table and colums were created. Whether they can be created/accessed this way depends on the policy of the database that you are using with regards to 'Quoted Identifiers' (also known as 'Delimited Identifiers'). On databases this feature is on by default, on others it is not. If you database objects require quoted identifiers then you may enter them as quoted as you've seen in the weblogic-rdbms20-persistence-810.dtd
Hope this helps
-thorick -
Urgent: help me on: ORA-01756: quoted string not properly terminated
I got the following error message when I tried to insert a record into database.
Please help me in this regard. I need to insert upto 2000 bytes.
insert into activity_reason values(1733214, 3234, 23,'P54I8N',to_date('04/19/2006','MM/DD/YYYY'),NULL, NULL, NULL, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd1600', NULL, NULL, NULL, NULL);
ERROR:
ORA-01756: quoted string not properly terminated
table desc:
SQL> desc activity_reason;
Name Null? Type
CASE_ACTIVITY_ID NOT NULL NUMBER(10)
REASON_CDE NOT NULL NUMBER(5)
QUESTION_ID NOT NULL NUMBER(10)
OPER_ID NOT NULL CHAR(8)
LAST_UPD_TMS DATE
COMMENT_TXT_1 VARCHAR2(240)
COMMENT_TXT_2 VARCHAR2(240)
COMMENT_TXT_3 VARCHAR2(240)
COMMENT_TXT_4 VARCHAR2(2000)
LETTER_TXT_1 VARCHAR2(240)
LETTER_TXT_2 VARCHAR2(2000)
PATIENT_LETTER_TXT_1 VARCHAR2(240)
PATIENT_LETTER_TXT_2 VARCHAR2(2000)Hi,
It's work fine on my 9.2.0.4 database.
SQL> create table activity_reason
2 (CASE_ACTIVITY_ID NUMBER(10) NOT NULL,
3 REASON_CDE NUMBER(5) NOT NULL,
4 QUESTION_ID NUMBER(10) NOT NULL,
5 OPER_ID CHAR(8) NOT NULL,
6 LAST_UPD_TMS DATE,
7 COMMENT_TXT_1 VARCHAR2(240),
8 COMMENT_TXT_2 VARCHAR2(240),
9 COMMENT_TXT_3 VARCHAR2(240),
10 COMMENT_TXT_4 VARCHAR2(2000),
11 LETTER_TXT_1 VARCHAR2(240),
12 LETTER_TXT_2 VARCHAR2(2000),
13 PATIENT_LETTER_TXT_1 VARCHAR2(240),
14 PATIENT_LETTER_TXT_2 VARCHAR2(2000));
Table created.
SQL>
SQL> insert into activity_reason values(1733214, 3234, 23,'P54I8N',to_date('04/19/2006','MM/DD/YYYY'),NULL, NULL, NULL, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd1600', NULL, NULL, NULL, NULL);
1 row created.
SQL> What is your db version ?
Nicolas. -
Embedded double quotes in a quoted string not working.
It seems that Numbers doesn't process embedded double quotes correctly in a quoted string. Is this an issue that Apple are aware about? Any fixes planned? Is this an issue that Apple are aware about? Any fixes planned?
This is not an issue in Excel, but I'd prefer to use Numbers.To run Hiroto's script, copy and paste into AppleScript Editor. Click the compile "hammer" to make sure the copy/paste went well. Then (still in AppleScript Editor click the run button. Then, back in Numbers, click once in a cell in an existing table, and paste.
To run the service in the post immediately above Hiroto's, just click the link in my post and doubleclick the downloaded .workflow package. (You may have to go to System Preferences > Privacy & Security and click "Download Anyway"). It then appears automatically in your Numbers > Services menu. Then to run the script just choose the item in the menu item CSV to Tabs on Clipboard.
You can uninstall the Service at any time by holding down the option key while in Finder and from the menu Go > Library > Services.
If you have a chance to try these, would be interested in hearing back whether they worked for you. They are working well on my setup here.
SG -
How to find a string inside Excel table
Hi,
I am trying to find a string inside Excel table, and it does not work. Please see attached figure. I use the find Invoke Node and do not get anthing.
Please help
Attachments:
find_excel.JPG 21 KBSee attached files.
Thanks,
David
Attachments:
Excel_table.xls 15 KB
Read_XL.vi 42 KB -
Runtime.getRuntime().exec and quoted strings?
Attempting to execute a command containing a quoted string. Being very new to Java I'm guessing I'm not doing it right. Below are two code bits the first one works the second doesn't. So the question is "How do I use quoted strings in a command with .exec?"
// this one works
try {
p = Runtime.getRuntime().exec("ls -l tst.java");
p.waitFor();
System.out.println("Done!");
catch(Throwable e) {
system.out.println("Errors!");
// this one fails
try {
p = Runtime.getRuntime().exec("ls -l \"tst.java\"");
p.waitFor();
System.out.println("Done!");
catch(Throwable e) {
system.out.println("Errors!");I don't know if it is too late for the answer, but I think I know what the problem is.
You are using exec(String) method, and passed String parameter is parsed using StringTokenizer class. This means that when you use quotes as in "file1 file2", StringTokenizer parses this as "file1 and then file2" so it is not understandable command.
To solve the problem, do not use exec(String) method, use exec(String[])
Using this you can send separate command and separate parameters as in following example:
If you want to send (in Unix)
grep "SHOW lotid" text.txt
(using exec("grep \"SHOW lotid\" text.txt") would not work)
Do the following
exec(new String[]{"grep", "SHOW lotid", "text.txt"});
This avoids parsing problem when quotes are used.
Mehmed -
Quoted string not properly terminated
I am trying to use the tune_mview package. I am setting up variables in sqlplus to use when calling the package. I am using the following to set the entire create Mview staement into a variable, but am getting a ORA-01756: quoted string not properly terminated. I can execute the select statement inside the create mview statement, and can execute the create mview statement, but when I try to set the entire statement into a variable I get the error. This is 10gR2.
EXECUTE :create_mv_ddl := q'|CREATE MATERIALIZED VIEW WH.MV_SPS_CONTRIB_SPLITS ENABLE QUERY REWRITE AS
select
c.rep_nbr rep_number
,decode(p.override,null,c.rep_nbr,p.override) override
,c.rep_type
,decode(s.rep_number,null,1,decode(s.summed_perc,0,1/s.number_of_splits,p.payout_perc/s.summed_perc)) Comm_Contr
,p.payout_perc Split_Percentage
,s.summed_perc Sum_Of_All_Splits
from
wh.t_stg_sps_rep_control c
,(select *
from wh.t_stg_sps_rep_payout p
where
p.payout_cat = 'PRC'
and production_credit = 'Y') p
select
rep_nbr rep_number
,sum(payout_perc) summed_perc
,count(*) number_of_splits
,count(payout_perc) used_for_MV_rewrite
from
wh.t_stg_sps_rep_payout
where
production_credit = 'Y'
and payout_cat = 'PRC'
group by
rep_nbr
) s
where
c.rep_nbr = p.rep_nbr (+)
and p.rep_nbr = s.rep_number (+)
order by
c.rep_type
,p.rep_nbr |';Hi,
If i spotted the error I would write...two ('|') in the beggining and end of the CREATE statement .
EXECUTE :create_mv_ddl := q'||CREATE MATERIALIZED VIEW WH.MV_SPS_CONTRIB_SPLITS ENABLE QUERY REWRITE AS
select
c.rep_nbr rep_number
,decode(p.override,null,c.rep_nbr,p.override) override
,c.rep_type
,decode(s.rep_number,null,1,decode(s.summed_perc,0,1/s.number_of_splits,p.payout_perc/s.summed_perc)) Comm_Contr
,p.payout_perc Split_Percentage
,s.summed_perc Sum_Of_All_Splits
from
wh.t_stg_sps_rep_control c
,(select *
from wh.t_stg_sps_rep_payout p
where
p.payout_cat = 'PRC'
and production_credit = 'Y') p
select
rep_nbr rep_number
,sum(payout_perc) summed_perc
,count(*) number_of_splits
,count(payout_perc) used_for_MV_rewrite
from
wh.t_stg_sps_rep_payout
where
production_credit = 'Y'
and payout_cat = 'PRC'
group by
rep_nbr
) s
where
c.rep_nbr = p.rep_nbr (+)
and p.rep_nbr = s.rep_number (+)
order by
c.rep_type
,p.rep_nbr[b] ||';
Regards,
Simon -
ORA-13223: duplicate entry for string in SDO_GEOM_METADATA table and
I got the above error while trying to insert a record into the table SDO_GEOM_METADATA. However, when querying this table I did find any duplicate table_name, column_name pair that match with the error.
Here are the steps that I worked on:
1. Add a geometry column into an existing table.
ALTER TABLE GEO_MAP ADD (ORG_GEOM mdsys.sdo_geometry);
2. Register the new column into mdsys
insert into USER_SDO_GEOM_METADATA
values ('GEO_MAP','ORG_GEOM',
mdsys.sdo_dim_array(
mdsys.sdo_dim_element('LONG',-180,180,0.00005),
mdsys.sdo_dim_element('LAT',-90,90,0.00005)
8307)
I got the error ORA-13223: duplicate entry for string in SDO_GEOM_METADATA table even there was no such record in there.
3. I inserted values in the column ORG_GEOM fine.
4. However, when I tried to create the index for this column I got the error:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13203: failed to read USER_SDO_GEOM_METADATA view
ORA-13203: failed to read
Please help.
Thanks.SQL> select * from mdsys.sdo_geom_metadata_table;
SDO_OWNER SDO_TABLE_NAME
SDO_COLUMN_NAME
SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
SDO_SRID
QW_USER1 GEO_REF
LOC_GEOM
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('LONG', -180, 180, .00005), SDO_DIM_ELEMENT('LAT',
-90, 90, .00005))
SDO_OWNER SDO_TABLE_NAME
SDO_COLUMN_NAME
SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
SDO_SRID
8307
MDSYS SDO_CMT_CBK_RTREE_TAB
GEOM
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .000000005), SDO_DIM_ELEMENT('Y',
SDO_OWNER SDO_TABLE_NAME
SDO_COLUMN_NAME
SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
SDO_SRID
-90, 90, .000000005))
The situation is we have 2 tables (GEO_MAP, and GEO_REF) that have spatial columns. Everything worked fine until when one of the queries that searched through the table GEO_MAP ran so slow, we decided to rebuild the related spatial index by dropping and recreating it. However, after I dropped it I could not recreated. Keep getting the error:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13203: failed to read USER_SDO_GEOM_METADATA view
ORA-13203: failed to read
Any help is very much appreciated. -
I have a string like this: This is the A' tring sample. into a variable
Obviously when I tray to insert this I get the error because the middle quote:
ORA-01756 quoted string not properly terminated
What can I do if I need to sotred as it appears (with the middle quote)?If ur string is like "This's sample" then try to insert it with this 'This''s sample' .
hope this will hepl u...
null -
ORA-01756: quoted string not properly terminated (using (q) operator
Hi
I tried this example but giving the error
select q'( it's done )' from dualbut the following is working
select q'( it''s done )' from dualIf i need to use it''s done then what is the use of (q) operator
Thanks..
Edited by: josh1612 on May 10, 2010 11:09 PMWhat is your database version ? Q-quote operator introduced in Oracle 10g and see the example, you might be facing this error.
This is in SQL *PLUS V 9.2.0.1.0
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> select q'( it's done )' from dual;
ERROR:
ORA-01756: quoted string not properly terminated
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 11 12:58:12 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn hr/hr
Connected.
SQL> select q'( it's done )' from dual;
Q'(IT'SDONE
it's doneEdited by: Saubhik on May 11, 2010 12:28 AM -
Storing JSON string into Oracle table
Hi,
What is appropriate way to store JSON string into Oracle table?
Regards
PeterIf JSON becomes more popular, ORACLE might write data cartridge extension for JSONDB (in the same way as XMLDB).
Till then CLOB and NCLOB is your best choice, and leave the parsing in your application layer. -
"quoted string not properly terminated" error in File to Oracle interface
We have an interface at our site that is a simple file to Oracle interface. We used the sqlldr LKM and the SQL Control Append IKM. The interface bombs out when one of the unmapped Oracle fields has this for a string literal in it: '--A'. It's a size 3 varchar field in Oracle. We can put in other literals fine in it, but using the '--A' one brings back this error in the Insert portion of the interface:
1756 : 42000 : java.sql.SQLException: ORA-01756: quoted string not properly terminated
java.sql.SQLException: ORA-01756: quoted string not properly terminated
I ran the sql query that ODI bombs out on and the record inserts fine inside sql developer.
Anybody else experience this and if so what was the solution to get past this?
We're using ODI 10.1.3.5.5.Hi A,
I tried this but it didn't work. I am puzzled as to why OBIEE prints any special character after a % twice. For example %& becomes %&& or %' become %'' . I guess it is the Evaluate function that is fiddling with the % .
Thanks.
Edited by: 900740 on Feb 9, 2012 9:22 AM -
How to insert single quote in to the table
Pl help me out in how to insert the single quote ie ' into the table. If there is no other way, i will go for some other alternative
Regards,
BasavarajuSQL> desc varchar2_test
Name Null? Type
TEXT VARCHAR2(4000)
SQL> insert into varchar2_test values ('''ABCDEFGHIJ''');
1 row created.
SQL> select * from varchar2_test;
TEXT
'ABCDEFGHIJ'Thanks,
BB -
Printing out double quote string
Hello,
I would like to know how can i print out the double quote string (")
in JSP using out.print(), because a double qoute has already used
for indicating the string. If the string that i want to print out is including double quote("), how can i print that string out.
THX !out.println("\"mystring\"");
generally: backslash "\" is used in Java to quote special characters e.g. out.println("c:\\my documents\\bla"); -
Function for search string in all table of a particular schema ? (postgres)
Hi ,
i want to create a function postgresql, that can able to search a string from all tables.
I try as below.... please rectify this
CREATE OR REPLACE FUNCTION search_string(str char(50))
returnS character varying AS
$BODY$
DECLARE
tempCount bigint ;
record_v record;
itemid_v bigint ;
query varchar;
return_v character varying := null;
BEGIN
for record_v in (select table_name ,column_name
from information_schema.columns and data_type in ('character','character varying','text')) loop
query := 'select count(*) from '|| record_v.table_name ||' where ' || record_v.column_name || ' like ''%' || str ||'%''' ;
execute query into tempcount;
if (tempCount >0) then
return 'l';
else
return '2572';
end if;
end loop;
END;
$BODY$ LANGUAGE plpgsql VOLATILE
COST 100;
in output i need all tables in which string exists :
like table_name count_of_string_matchMr. singh wrote:
oracle is the master of all databases - i hope u know
if any body work on oracle .. he can right any query in any database :)Query maybe. but you were asking about functions. ANSI SQL is a pretty good standard for most normal dbs nowadays. But the procedural extensions differ more. Therefor you should go to a postgress forum to ask there. Or upgrade your database to oracle.
Maybe you are looking for
-
Sales Orders Transparent Tables Needed
I am trying to create a report with SQV1 that shows Sales Order Sales Order Status Material Rev Level on Material ECN Number on Material ECN Description on Material I need the transparancy tables for Sales Order Detail; I tried VBAP and VBAK and bot
-
Cannot Edit a Form in Adobe Acrobat Pro Xi - use Livecycle
Hi all, I was advised to buy Adobe Pro XI yesterday by the Direct Sales Adobe team because it includes "everything I need" to create and EDIT PDF forms. I actually rang up to buy X but was told it was now XI. I tried to edit a form today and got thi
-
PDF Attachment preview problem
Hello, Can some one advise me why would there be a problem in viewing pdf attachment properly.The problem is when I try to open a PO attachment that is sent via SAP or preview it in SAP itself, the content seems to vanish when scrolling up and down t
-
On other computer, w/Vista, Windows Mail, clicking Send Link works perfectly, providing one click hyperlink. Running latest Firefox on both computers. Made Windows Live Mail default email. No help. Uninstalled Windows Live Mail and switched to thunde
-
MacBook Pro Early 2011 doesn't turn on
I haven't used this macbook for almost a year. Today when I tried to start it, with power plugged in, the light on the power cord was on. But even pressing the power button on macbook, it doesn't even boot or has light on it. Nobody touched or droppe