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
Similar Messages
-
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. -
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 -
"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 -
Ora-01756: quoted string not properly terminated
Hi all,
I have just practise Oracle REF obj_type. My codes are follows:
CREATE or REPLACE TYPE home_type AS OBJECT (
street VARCHAR2(50), city VARCHAR2(20),
state VARCHAR2(20), zipcode VARCHAR2(6),
owner VARCHAR2(10)
CREATE TABLE homes OF home_type;
INSERT INTO homes VALUES ('300 Regina St', 'WATERLOO', 'ON', '010010', 'HFWANG');
INSERT INTO homes VALUES ('301 Regina St', 'WATERLOO', 'ON', '010010', 'MMWANG');
commit;
CREATE TABLE person (
id NUMBER(6) PRIMARY KEY,
name VARCHAR2(10),
addr REF home_type
INSERT INTO person SELECT 10, 'HFWANG', ref(p)
FROM homes p WHERE p.owner='HFWANG';
===========
when I try to insert the last line into table person. the error occured.
Can anyone help me with this? Thank you very much.Worked for me.
SQL> CREATE or REPLACE TYPE home_type AS OBJECT (
2 street VARCHAR2(50), city VARCHAR2(20),
3 state VARCHAR2(20), zipcode VARCHAR2(6),
4 owner VARCHAR2(10)
5 );
6 /
Type created.
SQL> CREATE TABLE homes OF home_type;
Table created.
SQL> INSERT INTO homes VALUES ('300 Regina St', 'WATERLOO', 'ON', '010010', 'HFWANG');
1 row created.
SQL> INSERT INTO homes VALUES ('301 Regina St', 'WATERLOO', 'ON', '010010', 'MMWANG');
1 row created.
SQL> commit;
Commit complete.
SQL> CREATE TABLE person (
2 id NUMBER(6) PRIMARY KEY,
3 name VARCHAR2(10),
4 addr REF home_type
5 );
Table created.
SQL> INSERT INTO person SELECT 10, 'HFWANG', ref(p)
2 FROM homes p WHERE p.owner='HFWANG';
1 row created.
SQL> commit;
Commit complete. -
ORA-01756quoted string not properly terminated
Hi
I am using Oracle11g and also using Vijeo Citect (cicode).Here I am using Cicode as a front end.
To push the values of tags I wrote this query but it gave following error.
Here all attributes are string datatypes.
INSERT INTO SCADA_MASTER(LOC_ID,LOC_NAME,DATETIME,LEVEL_TANK,CHL_TANK,TOTALISER_INFLOW,FLOW_DISTRIBUTION1) VALUES('"+sNo+"','"+sLoc+"','"+Date(2)+" "+TimeToStr(TimeCurrent(),0)+"','"+RealToStr(LVL_HANUMAYYANAGAR,4,2)+"','"+RealToStr(CHL_HANUMAYYANAGAR,4,2)+"','"+RealToStr(HANUMAYYANAGAR_TOTALISER_INFLOW,4,2)+"',
'"+RealToStr(FLOW_DISTRIBUTION_HANUMAYYANAGAR,4,2)+"')
here i am pushing the tag values of specific device
but its showing
ERROR : 1756[Microsoft][ODBC driver for oracle][Oracle]ORA-01756 quoted string not properly terminated913672 wrote:
I am using Oracle11g and also using Vijeo Citect (cicode).Here I am using Cicode as a front end.
To push the values of tags I wrote this query but it gave following error.Never mind the error. Wrong approach. It is the #1 cause for poor Oracle performance - and not only results in more CPU being burned needlessly, but also resulting in fragmenting the Shared Pool in Oracle that leads to memory allocation errors.
If you want to use a "black box" database - then Oracle is not it. It is technically one of the fastest and most flexible data processing environments on this planet. It expects you to have the basic Oracle concepts and fundamentals under the belt, in order to be used correctly.
And one of these basic and fundamental concepts is creating shareable SQL, using bind variables.
Refer to the Oracle® Database Performance Tuning Guide. -
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 -
This query is returning an error 'strings not well terminated' Pls help
SELECT CONCAT(CONCAT('HDRLMPeople CORPTRAVEL', "YYYYMMDD"), ' ')
UNION
SELECT CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(substr(CONCAT(V_APPT_BASIC.PERSON_ID, ' '), 1, 11),
SUBSTR(CONCAT(V_APPT_BASIC.FIRST_NAME, ' '), 1, 30)),
SUBSTR(CONCAT(V_APPT_BASIC.LAST_NAME, ' '), 1, 30)), ' INSERTED TEXT') as ExportRow,
SUBSTR(CONCAT(V_BU_BASIC.BU_CODE, ' '), 1, 10),
SUBSTR(CONCAT(V_BU_BASIC.BU_NAME, ' '), 1, 30)),
SUBSTR(CONCAT(V_BU_BASIC.BU_PARENT, ' '), 1,10),
SUBSTR(CONCAT(V_BU_BASIC.BU_PARENT_NAME, ' '), 1, 30)), ' INSERTED TEXT') as ExportRow, ' INSERTED TEXT') as ExportRow, ' INSERTED TEXT') as ExportRow, ' INSERTED TEXT) as ExportRow, ' INSERTED TEXT') as ExportRow, ' INSERTED TEXT) as ExportRow,
SUBSTR(CONCAT(V_EMP_ALL.BIRTHDATE, ' '), 1, 8),
SUBSTR(CONCAT(V_EMP_ALL.GENDER, ' '), 1, 8), 'Y') as ExportRow,
FROM HRREPORT.V_APPT_BASIC V_APPT_BASIC,
HRREPORT.V_BU_BASIC V_BU_BASIC,
HRREPORT.V_BU_HIERARCHY V_BU_HIERARCHY,
REPORTS.V_EMP_ALL V_EMP_ALL
WHERE V_APPT_BASIC.CO_C = V_EMP_ALL.COMPANYCODE AND V_APPT_BASIC.EMP_FILE_NB = V_EMP_ALL."FILE#" AND V_APPT_BASIC.BU_CODE = V_BU_HIERARCHY.BU_CODE AND V_BU_HIERARCHY.BU_PARENT_CODE = V_BU_BASIC.BU_CODE AND ((V_EMP_ALL.STATUS='TEXT',)) = ((V_BU_BASIC.UNIT='TEXT',)) AND ((V_BU_BASIC.UNIT_DESCRIPTION='TEXT')) = ((V_BU_BASIC.SETID='TEXT')) AND ((V_BU_BASIC.SETID_DESCRIPTION='TEXT')) = ((V_BU_BASIC.AREA='A7500')) AND ((V_BU_BASIC.AREA_DESCRIPTION='TEXT')) = ((V_EMP_ALL.FIELD='Y'))
UNION
SELECT CONCAT(CONCAT('TRL', COUNT(*)), 'SELECT CONCAT(CONCAT('HDRLMPeople CORPTRAVEL', "YYYYMMDD"), ' ') will do absolutely nothing. You can not select from the vacuum.
Perhaps you meant to SELECT ... FROM dual;
It works better that way. ;)
It also helps to use single-quotes rather than double quotes.
SELECT CONCAT(CONCAT('HDRLMPeople CORPTRAVEL', 'YYYYMMDD'), ' ') from dual;Though what it is you are actually trying to accomplish escapes me. What is the point of this construct? -
Good afternoon,
Would someone with a fresh set of eyes look at this piece of sql? I keep getting the above error. I am the first to admit I am not the brightest when it comes to dynamic sql. I tried just about everything I could and still a no go.
execute immediate 'select count('||c1_rec.message_type||') from doguser.message_state
where org_name='||c1_rec.org_name into cnt_var;
I think it may have to do with the quotes around the variable.
Thanks for your help in advance.
regards,
alWell i've simulated that and it is working.
Though you have to check the uniqueness of the result.
Just running the prepared scripts (ignore the output in case it comes duplicate) -
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
Connected as scott
SQL>
SQL> declare
2 cnt_var number;
3
4 cursor c1
5 is
6 select empno,
7 deptno
8 from emp
9 where deptno in (
10 select deptno
11 from dept
12 )
13 order by deptno;
14
15 begin
16
17 for c1_rec in c1
18 loop
19 execute immediate 'select count(:var1)
20 from emp
21 where deptno = :var2'
22 into cnt_var
23 using c1_rec.empno,c1_rec.deptno;
24
25 dbms_output.put_line(c1_rec.empno||' '||c1_rec.deptno||' '||'has'||' '||cnt_var||' '||'records');
26
27 end loop;
28 end;
29 /
PL/SQL procedure successfully completed
SQL>
SQL> set serveroutput on
SQL>
SQL> /
7782 10 has 3 records
7839 10 has 3 records
7934 10 has 3 records
7566 20 has 5 records
7902 20 has 5 records
7876 20 has 5 records
7369 20 has 5 records
7788 20 has 5 records
7521 30 has 6 records
7844 30 has 6 records
7499 30 has 6 records
7900 30 has 6 records
7698 30 has 6 records
7654 30 has 6 records
PL/SQL procedure successfully completed
As you can see the code is working. Now, check your logic and ensure that the output is unique for you.
Regards.
Satyaki De. -
Ora-00933 sql command not properly terminated
The following query is getting error. please help to fix
Actual output
Data in mv_payment holding:
program_key,amount,received_date
14 400 07/11/2010
14 200
14 300 08/11/2010
Expected output
from mv_payment_holding
program_key sum(amount) latest received date
14 900 08/11/2010
SELECT DISTINCT
PROGRAM_NAME_ID ||'. '|| program_name_descr Surcharge,program_name_id,
get_total('110831559486','90869506814') "Total Amount Due",t.program_key,
nvl(T.PI_AMOUNT,0) "Penalty Interest",
sum(nvl(h.Amount,0)) "Payment Amount",
get_total('110831559486','90869506814')+nvl(T.PI_AMOUNT,0)+sum(nvl(Amount,0)) "Period Balance",
max(to_char(h.received_date,'MM/DD/YY')) "Last Payment Date"
FROM mv_program_dict P, mv_PROG_SURCH T,mv_billing b,mv_payment_holding h
WHERE p.program_key= t.program_key(+)
AND t.billing_key=b.billing_key
AND b.company_id=h.company_id
AND b.report_period=h.report_period
AND t.program_key=h.program_key
AND t.BILLING_KEY='110831559486'
And t.program_key='90869506814'
group by program_name_id,program_name_descr Surcharge,t.program_key,PI_AMOUNT
order by PROGRAM_NAME_IDEdited by: KK on Mar 28, 2011 10:24 AMIf you just want to get your output from the mv then
SELECT program_key, SUM (amount), MAX (received_date)
FROM mv_payment_holding
GROUP BY program_key;you are missing a comma in group by.
SELECT DISTINCT
PROGRAM_NAME_ID || '. ' || program_name_descr Surcharge,
program_name_id,
get_total ( '110831559486', '90869506814') "Total Amount Due",
T.program_key,
NVL (T.PI_AMOUNT, 0) "Penalty Interest",
SUM (NVL (h.Amount, 0)) "Payment Amount",
get_total ( '110831559486', '90869506814')
+ NVL (T.PI_AMOUNT, 0)
+ SUM (NVL (Amount, 0))
"Period Balance",
MAX (TO_CHAR ( h.received_date, 'MM/DD/YY')) "Last Payment Date"
FROM mv_program_dict P,
mv_PROG_SURCH T,
mv_billing b,
mv_payment_holding h
WHERE P.program_key = T.program_key(+)
AND T.billing_key = b.billing_key
AND b.company_id = h.company_id
AND b.report_period = h.report_period
AND T.program_key = h.program_key
AND T.BILLING_KEY = '110831559486'
AND T.program_key = '90869506814'
GROUP BY program_name_id,
program_name_descr,
T.program_key,
PI_AMOUNT
ORDER BY PROGRAM_NAME_IDEdited by: Ganesh Srivatsav on Mar 28, 2011 1:33 PM -
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 -
String literal is not properly closed by a double-quote
Hi,
In my Java Class, this message appears:
String literal is not properly closed by a double-quote
LINE: The red part of the statement.
Please help! Thanks!
package demo;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class Flights {
private EntityManagerFactory emf;
private EntityManager getEntityManager() {
if (emf == null) {
emf = Persistence.createEntityManagerFactory("Flights");
return emf.createEntityManager();
public Flights[] getFlights() {
EntityManager em = getEntityManager();
try {
javax.persistence.Query q = em.createQuery("SELECT /*+ INDEX(lh_master_q lh_master_pk)*/ DISTINCT to_char(FD.FLIGHT_DATE, 'DY')||'.'|| FD.FLIGHT_DATE AS DATE_HEADER,
FD.FLIGHT_DATE AS TRAVEL_DATE,
B.CITY AS LEAVING,
LM.STD AS DEPART,
C.CITY AS ARRIVING,
LM.STA AS ARR,
LM.FNR AS FLIGHT,
E.CARRIER AS AIRLINE,
LM.ACTYPE AS AIRCRAFT,
LM.ACTYPEFULLNAME AS EQUIP,
LM.STD ||' '|| LM.DEP ||' - '|| LM.STA ||' '|| LM.ARR AS SCHEDULE,
B.CITY ||' - '|| C.CITY AS ROUTE
MAX(CASE WHEN FA.BOOKING_CLASS = 'S' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY_SAVER,
MAX(CASE WHEN FA.BOOKING_CLASS = 'H' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY,
MAX(CASE WHEN FA.BOOKING_CLASS = 'B' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY_FLEXIBLE,
MAX(CASE WHEN FA.BOOKING_CLASS = 'Z' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS BUSINESS,
MAX(CASE WHEN FA.BOOKING_CLASS = 'D' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS BUSINESS_FLEXIBLE,
MAX(CASE WHEN FA.BOOKING_CLASS = 'F' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS FIRST_CLASS
FROM LH_MASTER_Q LM, LH_FLIGHT_DATE FD, AIRPORTS_LOOKUP B, AIRPORTS_LOOKUP C, CARRIERS E, LH_FARES FA, LH_SERVICE_CLASS SC, LH_CABIN_CLASS CC
WHERE LM.ROWNR = FD.FLIGHT_LEG_ID
AND LM.DEP = FA.FROM_AP
AND LM.ARR = FA.TO_AP
AND LM.DEP = B.IATA_CODE
AND LM.ARR = C.IATA_CODE
AND LM.AL = E.CARRIER_CODE
AND FA.BOOKING_CLASS = SC.BKG_CLASS_ID
AND SC.CABIN_CLASS_ID = CC.CABIN_CLASS_ID
AND LM.ACTYPE = FD.AIRCRAFT_TYPE
AND B.CITY_CODE = :p_leaving
AND C.CITY_CODE = :p_arriving
AND CC.CABIN_CLASS_NAME = :p_class
AND E.CARRIER = :p_airline
AND FD.FLIGHT_DATE = :p_outbound
GROUP BY FD.FLIGHT_DATE,
to_char(FD.FLIGHT_DATE, 'DY')||'.'|| FD.FLIGHT_DATE,
B.CITY,
LM.STD,
C.CITY,
LM.STA,
LM.FNR,
E.CARRIER,
LM.ACTYPE,
LM.ACTYPEFULLNAME,
LM.STD ||' '|| LM.DEP ||' - '|| LM.STA ||' '|| LM.ARR,
B.CITY ||' - '|| C.CITY,
to_char(FD.FLIGHT_DATE, 'DY')
ORDER BY Depart;");
return (Flights[]) q.getResultList().toArray(new Flights[0]);
} finally {
em.close();
}From the Java specification (http://docs.oracle.com/javase/specs/jls/se5.0/html/lexical.html#3.10.5):
It is a compile-time error for a line terminator to appear after the opening " and before the closing matching ".
In other words, string literals cannot span lines.
You can use the concatenation operator ( + ) to fix this:
String myLiteral = "A long line " +
"Another long line " +
"Another long line, etc.";
If you're going to ever print out that string literal (like for debugging purposes), it would probably be better to have a return at the end of each line (\n):
String myLiteral = "A long line\n" +
"Another long line\n" +
"Another long line, etc.";
Edited by: user739461 on Mar 5, 2012 8:10 AM -
XSD OTD compilefailure String literal not properly closed by double-quote
Java CAPS 5.1.3
I have created a XSD to describe a simple XML file. After this I created an OTD from the exported XSD file.
This OTD is being used in a JCD. During the build of the Deployment Profile I get the error: :Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
All steps have been preferformed within the same eDesigner and the same repository.
I have verified the XSD file with netbeans and can not see a problem with the file itself.
Any ideas to resolve this compile failure?
The XSD is:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1" targetNamespace="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1">
<xsd:element name="MessageBroker">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="IN" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<xsd:element name="MSGFN" type="xsd:string" default="IN"/>
<xsd:element name="DIR" type="xsd:string" default="\"/>
<xsd:element name="FILEMASK"
type="xsd:string" default="*.DAT"/>
<xsd:element name="MAPID" type="xsd:string" default="MS000"/>
<xsd:element name="RCVPRN" type="xsd:string"/>
<xsd:element name="RCVPRT" type="xsd:string"/>
<xsd:element name="RCVPFC" type="xsd:string"/>
<xsd:element name="SNDPRN" type="xsd:string"/>
<xsd:element name="SNDPRT" type="xsd:string"/>
<xsd:element name="MESTYP" type="xsd:string"/>
<xsd:element name="MESCOD" type="xsd:string"/>
<xsd:element name="MESFCT" type="xsd:string"/>
<xsd:element name="TEST" type="xsd:boolean" nillable="true"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="dateTime" type="xsd:dateTime"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>The complete error stack trace is:
com.stc.codegen.framework.model.CodeGenException: error generating otd for CMap1_jcdMB_Recieve_SAP_Inbound1:Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:767)
at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.processCodelets(CodeGenFrameworkImpl.java:653)
at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1544)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
at org.openide.util.Task.run(Task.java:136)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
Caused by: java.lang.RuntimeException: Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
at com.stc.javac.Javac.compile(Javac.java:227)
at com.stc.otd.codegen.BaseXsdDtdGenerator.compileFromJarfile(BaseXsdDtdGenerator.java:254)
at com.stc.otd.codegen.BaseXsdDtdGenerator.compile(BaseXsdDtdGenerator.java:52)
at com.stc.otd.xsd.codegen.XsdParserGenerator.compile(XsdParserGenerator.java:182)
at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:166)
at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:90)
at com.stc.codegen.OTDImpl.model.CollabOTDGenerator.generateCollabOTDJavaFiles(CollabOTDGenerator.java:233)
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.processOTDJars(OTDCodeletFactory.java:861)
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:666)
... 10 moreYou may need to escape the default slash "\\".
I'd suggest importing the xsd into the jcaps xml schema editor and verifying that way and then creating the otd by node export.
Regards,
Rupert -
Error 500: String not terminated at end of line.
Hi,
I am trying to pass three parameters to a bean class. When I hardcode the values the method is executed correctly. However when I embed the parameters into the calling method I get the error:
Error 500: String not terminated at end of line.
The parameters are reqtrieved from the request object, and assigned to page variables. They are picked up and assigned to the variables without a problem.
Can someone let me know what the issue appears to be?
Source:
=====
<%
String forename="";
String surname="";
String username="";
username=request.getParameter("Username");
forename=request.getParameter("Forename");
surname=request.getParameter("Surname");
String var;
var=user.getUserId("<%=username%>", "<%=forename%>", "<%=surname%>");
%>Thanks for the reply. however this reutrns no values back to the browser. Again, hardcoding the values surrounded by quotes ( function expects String ) works fine returning a result.
Any ideas? -
Problems passing timestamp variable to block-SQL command not properly ended
Can you please help me answer or direct me to resources in answering the following.
I'm attempting to pass a timestamp variable to a block but am getting errors with every method I've tried yet.
The example below is attempting to generate a list of all sales dates for orders after the 21st of March 2000.
DECLARE
BeginDate Orders.PurchaseDate%TYPE :=to_date('21-3-2000', 'dd-mm-yyyy');
Target Orders.PurchaseDate%TYPE;
BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(BeginDate));
SELECT Distinct PurchaseDate from Orders into Target WHERE PurchaseDate>BeginDate;
END;
When running it - it returns
ORA-00933: SQL command not properly ended ORA-06512: at line 8Please advise-- I"m still trying to get a timestamp into an execute immediate statement.
Declare
BeginDate Orders.PurchaseDate%TYPE :=to_date('21-3-2000', 'dd-mm-yyyy');
var_date Orders.PurchaseDate%TYPE ;
BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(BeginDate,'DD.MM.YYYY'));
sql1 = 'SELECT MAX(PurchaseDate) INTO Target from Orders WHERE PurchaseDate> :var_date';
Execute Immediate sql1 Using BeginDate;
DBMS_OUTPUT.PUT_LINE(to_char(Target,'DD.MM.YYYY'));
END;
Thanks again for the replies, I'm still not there yet even after re-reading the documentation that applies to this,
Using what follows below the Execute Immediate line/syntax is the problematic part of this...
to quote the block line still returning errors.
This line which would seem natural...
Execute Immediate sql1 Using BeginDate;returns -- missing keyword
Modified with this line attempts to pass another variable to the block also errors.
Execute Immediate sql1 Using BeginDate, var_date;returns -- ORA-01006: bind variable does not exist
Perhaps I'm not getting some key concept here, but I would think passing a variable into execute immediate would be
as simple as passing a string or int into a *.bat,*.sh file or function/procedure in any other language.
And/or I'm missing a key element or understanding to how this syntax should work.
Thank you very much for your previous replies any other ideas welcome.
Maybe you are looking for
-
Can no longer send mail; it sits in my outbox and goes nowhere!
Last night, I used a program from SBC to set up my POP account through that server. For whatever reason, emails now appear in the outbox but never seem to be sent. I receive mail. Connection Doctor was used; no problems. All accounts look the exact s
-
Hi guys, Im new here so please give me tips on how i can improve. I thought id share How i fixed iTunes on my mac. I started up my computer 6 days ago and launched iTunes. an error came up. "The folder iTunes is on a locked disk or you do not have w
-
Benefit of connecting iphone to mac
Is anything gained by connecting one's iPhone to their Mac? If so, wireless or wired? In other words, are there features/apps that benefit when one connects? I seem to recall there is something about Photo Stream but I'm not finding the instructions.
-
Problem consuming web service with basic authentication
Hello, I've set up a web service with basic authentication. Although I have to log in before being able to open the overview page of the web service in the Web Service Navigator, the response I get after sending a request is: Authority check failed I
-
2 SD cards with the same file numbers
How do I burn 2 SD cards with the same file numbers. Always says do I want to replace photo with the same number.