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 terminated

913672 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.

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 PM

    What 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

    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

  • "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-00933 sql not properly ended.

    Dear members,
    I have the following query in Report Builder 10g,
    select a, b, c
    from table1
    where a=12
    &p_whr_fy &p_whr_supp &p_whr_bt &p_whr_mat_spec &p_whr_lc_num &p_whr_cotton &P_WHR_LOC_ID
    union all
    select a, b, c
    from table2
    where a=12
    &p_whr_fy &p_whr_supp &p_whr_bt &p_whr_mat_spec &p_whr_lc_num &p_whr_cotton &P_WHR_LOC_ID
    here I used lexical parameters, and with spaces in lines its ok but when try to edit the query / remove the spaces in lines it gives the error.
    ora-00933 sql not properly ended
    Regards:

    Hi,
    Check your default values for substitution variables, at least one of them is not empty and causes an error.
    kikolus

  • Ora-00933 command not properly ended, txn_analysis_view== ()v

    Hi,
    I am new this forum, I hope all are doing well, Here my problem is I'd like to add a attribute1 column from mtl_system_items table in Report builder 6i SQL query, I am getting an error like :
    ora-00933 command not properly ended, txn_analysis_view==>()v;
    Query is:
    select decode(:P_sort_id,1,SUBINV,'X') Subinventory,
    decode(:P_sort_id,3,&P_cat_flex,'X') C_cat_flex,
    msi.attribute1, --- Adding a column
    msi.segment1,
    msi.segment2,
    msi.segment3,
    &P_item_flex C_item_flex,
    msi.description Description,
    msi.primary_uom_code UOM,
    decode(:P_selection,2,decode(:C_Cost_type,2, round(sum(nvl(SOURCE_TYPE1,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(SOURCE_TYPE1,0)),:C_std_prec)), 3,
    round(sum(nvl(SOURCE_TYPE1,0)) , :C_std_prec),
    sum(nvl(SOURCE_TYPE1,0))) SOURCE_TYPE1,
    decode(:P_selection,2,decode(:C_COST_TYPE,2,round(sum(nvl(SOURCE_TYPE2,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(SOURCE_TYPE2,0)) ,:C_std_prec)),3,
    round(sum(nvl(SOURCE_TYPE2,0)) , :C_std_prec),
    sum(nvl(SOURCE_TYPE2,0))) SOURCE_TYPE2,
    decode(:P_selection,2,decode(:C_COST_TYPE,2,round(sum(nvl(SOURCE_TYPE3,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(SOURCE_TYPE3,0)) ,:C_std_prec)), 3,
    round(sum(nvl(SOURCE_TYPE3,0)) , :C_std_prec),
    sum(nvl(SOURCE_TYPE3,0))) SOURCE_TYPE3,
    decode(:P_selection,2,decode(:C_COST_TYPE,2,round(sum(nvl(SOURCE_TYPE4,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(SOURCE_TYPE4,0)),:C_std_prec)),3,
    round(sum(nvl(SOURCE_TYPE4,0)) , :C_std_prec),
    sum(nvl(SOURCE_TYPE4,0))) SOURCE_TYPE4,
    decode(:P_selection,2,decode(:C_COST_TYPE,2,round(sum(nvl(SOURCE_TYPE5,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(SOURCE_TYPE5,0)),:C_std_prec)),3,
    round(sum(nvl(SOURCE_TYPE5,0)) , :C_std_prec),
    sum(nvl(SOURCE_TYPE5,0))) SOURCE_TYPE5,
    decode(:P_selection,2,decode(:c_cost_type,2, round(sum(nvl(OTHER,0))*v.item_cost,:C_std_prec),
    round(sum(nvl(OTHER,0)),:C_std_prec)),3,
    round(sum(nvl(OTHER,0)) , :C_std_prec),
    sum(nvl(OTHER,0))) OTHER,
    decode(:P_selection,
    1, sum(nvl(CUR_QTY_VAL,0)),
    round(sum(nvl(CUR_QTY_VAL,0)) ,:C_std_prec) )
    CUR_QTY_VAL_old,
    sum(nvl(CUR_QTY,0)) CUR_QTY,
    sum(nvl(TARGET_QTY,0)) TARGET_QTY,
    decode (:P_sort_id,1, msub.asset_inventory,0) ass_inv,
    msi.inventory_item_id item_id
    from
    mtl_secondary_inventories msub,
    mtl_system_items msi
    &C_from_cat
    ,&P_view v
    where ITEM_ID = msi.inventory_item_id
    and msub.organization_id = :P_org_id
    and msub.secondary_inventory_name = SUBINV
    and ( ( msub.asset_inventory = 1) or
    ( msub.asset_inventory = 2) and (msub.quantity_tracked=1))
    and
    ( :P_selection = 1 ) and
    ( ((msub.asset_inventory = 1) and (msub.quantity_tracked=1))
    or ((msub.asset_inventory = 2) and (msub.quantity_tracked=1)))
    ) OR (
    (:P_selection <>1 ) and
    (msub.asset_inventory = 1) and (msub.quantity_tracked=1) )
    and &P_where_cat &C_where_cat
    and msi.organization_id = :P_org_id
    and &P_where_item
    &C_where_subinv
    group by decode(:P_sort_id,1, SUBINV,'X'),
    decode(:P_sort_id,3,&P_cat_flex,'X'),
    msi.segment1, msi.segment2, msi.segment3,
    &P_item_order,
    &P_item_flex, v.item_cost, msi.description,
    msi.primary_uom_code,
    decode(:P_sort_id,1,msub.asset_inventory,0),
    msi.inventory_item_id,
    msi.attribute1, -----ADDING COLUMN
    order by 3,4,5

    Welcome to the forum!!
    Please read {message:id=9360002} from FAQ. It will help us help you better.
    And about your problem..
                   msi.attribute1, -----ADDING COLUMN
    order by 3,4,5Remove the comma (,) after msi.attribute1

  • 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 AM

    If 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

  • 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?

  • String not properly ended

    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,
    al

    Well 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.

  • 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 more

    You 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

  • ORA-00933: SQL command not properly ended

    I am attempting to create a view in oracle 8.0.6 but get the error message ORA-00933 SQL command not properly ended, can anyone help?:
    SQL> create view AJT_SCHEDULES01 as
    2 select SCHDL_REFNO, STRAN_REFNO from SCHEDULES order by STRAN_REFNO desc;
    select SCHDL_REFNO, STRAN_REFNO from SCHEDULES order by STRAN_REFNO desc
    ERROR at line 2:
    ORA-00933: SQL command not properly ended

    ORDER BY cannot be used to create an ordered view or to insert in a certain order.
    Please refer to Section ORA-00933: SQL command not properly ended at : http://otn.oracle.com/doc/server.805/a58312/newch220.htm
    For further assistance, please post in the forum at : PL/SQL
    Hope this helps
    Regards
    Pushkala

  • ORA-01079: ORACLE database was not properly created, operation aborted

    Hello everyone,
    On Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    My problem is that I've to drop the database as the same is not created properly.
    For that, I get the below error when I try to mount the database.
    ORA-01079: ORACLE database was not properly created, operation aborted
    Also, when I was starting the database specifying the pfile, it was throwing error saying
    ORA-00202: control file: 'D:\ORACLE_10G\DATABASE\CTL1SAMPLEDB.ORA'
    When I specified control_files clause in init.ora I was getting above error, so I tried removing the same but still faced the same error.
    Can anybody help me resolving the problem ... ???
    thanks

    Rossy Rocs wrote:
    Hello everyone,
    On Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    My problem is that I've to drop the database as the same is not created properly.
    For that, I get the below error when I try to mount the database.
    ORA-01079: ORACLE database was not properly created, operation aborted
    Also, when I was starting the database specifying the pfile, it was throwing error saying
    ORA-00202: control file: 'D:\ORACLE_10G\DATABASE\CTL1SAMPLEDB.ORA'
    When I specified control_files clause in init.ora I was getting above error, so I tried removing the same but still faced the same error.
    Can anybody help me resolving the problem ... ???
    thanksyou should be able to do the following on windows from the command line
    oradim -delete -sid sampledbthen remove the D:\ORACLE_10G\DATABASE\ folder from the filesystem (assuming there are only files relating to your db in there.
    finally remove the D:\ORACLE_10G\ADMIN\SAMPLEDB folder structure assuming it exists.
    Niall Litchfield
    http://www.orawin.info

Maybe you are looking for

  • Update routine - Can I add new items for an InfoOBject

    In the update rules (for one of the Info object) of a BW-ODS1 to another BW-ODS2 - I might end up reformatting the Info Object. If reformatted I need to create a new entry in the Master tables [maintain the Info Object] Praactical... If MATERIAL in O

  • Validation on Project Definition

    Hi, We configured a validation in Tcode OPSI where: Prerequisite is -> PROJ-PSPID :1-4: = 'XXXX' Check is -> PROJ-VBUKR = '####' However, when we tried to create a project definition with special characters, system allowed us to save the project. Ple

  • Adding photo to layout

    I'm creating a photobook with Photoshop 9.  I've chosen a layout for my page but the layout only contains 5 pictures and I want to add another picture to the layout.  How do I do that?

  • Gather_table_stats - Histograms / Buckets

    Hello guys, i have seen that the default behavior of the pl/sql procedure gather_table_stats changed from 9i to 10g. The default value for method_opt was "FOR ALL COLUMNS SIZE 1" in 9i and now it changed to "get_param('METHOD_OPT')" which is default

  • Manage System Messages

    Hi all,I need a function that permit do the error managment, the situation is the next: I have a report based on Integration Planning and when a modification is executed, I receive the messages but I dont want show all messages only some. For example