ORA-00933 SQL COMMAND NOT END PROPERLY

I face problem on this query________________
"SELECT channel.channel_id,Channel.PANEL_ID, Channel.STRIP_ID, Channel.CHANNEL_NAME,Control_system_tag.CS_TAG_NAME,Control_system_tag.CS_TAG_ID,Component.CMPNT_NAME,Component.CMPNT_ID " _
& "FROM Channel LEFT JOIN Control_system_tag ON (Channel.CHANNEL_ID = Control_system_tag.CHANNEL_ID) AND (Channel.STRIP_ID = Control_system_tag.STRIP_ID) AND (Channel.PANEL_ID = Control_system_tag.PANEL_ID)LEFT JOIN Component ON Control_system_tag.CMPNT_ID = Component.CMPNT_ID " _
& "WHERE ((Channel.PANEL_ID)=" & lPanelId & ") AND ((Channel.STRIP_ID)=" & lStripId & ")) order by channel.channel_id"
sql command not properly ended
Could anybody tell me what is a problem in my query?
Thanks

Try by removing a ")":
)) order by channel.channel_id" becames
) order by channel.channel_id"
Bye
Acr

Similar Messages

  • 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

  • SQL Error [ORA-00933: SQL command not properly ended

    I have following installed:
    7.9.6 BI Apps
    10.1.3.4 DAC
    8.6.0 Informatica
    Container JDE Enterprise 9.0
    Out of 211 tasks 69 tasks executed successfully.
    Error in workflow [SDE_JDE_PartyOrganisationDimension_Full].
    I have checked the session log file and understand that there is error with the SQL statement.
    Since it is Pre-built, the workflow should have run properly with correct SQl statement. But in this case it is not working.
    Is it because the SQL statement is too long?
    Any help will be greatly appreciated.
    Part of the log file
    RR_4035 : SQL Error [
    ORA-00933: SQL command not properly ended
    Database driver error...
    Function Name : Execute
    SQL Stmt : SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    INNER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    LEFT OUTER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    union
    SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    LEFT OUTER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    INNER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    Oracle Fatal Error
    Database driver error...
    Function Name : Execute
    *****************************************************

    "ORA-00933: SQL command not properly ended"
    this error may be seen due to reasons like the Informatica properties are not set correct.
    Are all the informatica properties set correct? how many ETL jobs completed, what analytic apps are in the ETL process?

  • Xml query error. ORA-00933: SQL command not properly ended

    Hi all,
    My Database Version: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0.
    CREATE table test (Name varchar2(3), Id number);
    insert into test values ('abc', 61);
    insert into test values ('def', 46);
    select table_name,
    column_name,
    'abc' search_string,
    result
    from cols,xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| 'abc' || '%") > 0]')
    columns result varchar2(10) path '.'
    where table_name in ('TEST');
    and i get: ORA-00933: SQL command not properly ended it points over '*xmltable*'

    ok, its possible to get output from a xml like this.
    i need output like this,
    customerid CustomerName Country
    1 xxxx 4
    2 yyyy 5
    xml:
    <Customer>
    <CustomerInformation>
              <Customerid>1</Customerid>
              <CustomerName>xxxx</CustomerName>
              <Country>4</Country>
         </CustomerInformation>
    <CustomerInformation>
              <Customerid>2</Customerid>
              <CustomerName>yyyy</CustomerName>
              <Country>5</Country>
         </CustomerInformation>
    </Customer>
    This xml is input to my stored procedure, i need to insert the xml tag values into customner_table.
    For this i insert the xml inro a xml_document_table having a xmltype column.
    after , by using the below mentioned query to select xml_tag values from that column.
    when i execute this query
    INSERT into customer_table(customer_id)
    SELECT X.XML_DOCUMENT.extract('/Customer/commodityInfo/CustomerInformation/Customerid/text()').getStringVal() "Customerid" from XML_DOCUMENT_TABLE X;
    i got output in a single row.
    customerid_
    1 <next line> 2
    But i need output like this,
    Customerid_
    1
    2
    im struggling with this simple insert. pls share ur idea.....
    Edited by: 887268 on Apr 4, 2012 10:04 PM
    Edited by: 887268 on Apr 4, 2012 10:17 PM

  • Hi..."PL/SQL: ORA-00933: SQL command not properly ended"

    Error starting at line 1 in command:
    DECLARE
    V_ENAME EMP.ENAME%TYPE;
    V_SAL EMP.SAL%TYPE;
    V_RANK INTEGER(2);
    BEGIN
    V_RANK:=&RN;
    select ENAME,SAL,RNK from (select ENAME,SAL,dense_rank() over(order by sal desc) AS RNK from emp)
    into V_ENAME,V_SAL,V_RANK from emp where RNK=V_RANK;
    DOPL('EMPLOYEE NAME:'||V_ENAME);
    DOPL('EMPLOYEE SAL:'||V_SAL);
    DOPL('EMPLOYEE RANK:'||V_RNK);
    END;
    Error report:
    ORA-06550: line 7, column 99:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 7, column 1:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    hi..,when i executing above pl/sql program, it shows error...!
    so i am unable to find error correctly..! plz help me..!
    Regards..!
    Cnu.

    Your SELECT syntax is messed up. The INTO should follow the SELECT. Is this what you are trying to do:
    DECLARE
      V_ENAME     EMP.ENAME%TYPE;
      V_SAL       EMP.SAL%TYPE;
      V_RANK      INTEGER (2);
    BEGIN
      V_RANK := &RN;
      select ENAME,
             SAL,
             RNK
        into V_ENAME,
             V_SAL,
             V_RANK
        from (select ENAME,
                     SAL,
                     dense_rank () over (order by sal desc) AS RNK
                from emp),
             emp
       where RNK = V_RANK;
      DOPL ('EMPLOYEE NAME:' || V_ENAME);
      DOPL ('EMPLOYEE SAL:' || V_SAL);
      DOPL ('EMPLOYEE RANK:' || V_RNK);
    END;By the way, looking at some of your past entries it looks like you have a bad habit of opening a request then never responding to it. You really should mark a entry as closed once it is no longer an issue. Also, if you mark helpful hints and helpful and correct hints as correct it makes people that help you happy and they are more likely going to help you again in the future... just saying.

  • Java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

    Jdeveloper 11.1.1.6
    WLS 10.3.5
    The screen in our application polls at a fixed interval, The screen renders properly and the poll too works good. but intermittently we get the error below. and there will be no data in the screen. and if reload the screen it works good.
    This doesn't happen in dev and is happening in clustered env only.Please suggest.
    java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
    Thanks

    Habe you tested your application with application module polling turned off? 
    Errors like this are most often the result of activation/passivation problems in the application.  Check out http://tompeez.wordpress.com/2011/07/08/jdev-always-test-your-app-with-applicationmodule-pooling-turned-off/ for more info.
    Timo

  • ORA-00933: SQL command not properly ended: error in TRIGGER

    Hi ,
    I tried the following example trigger but unable to trace the error..
    Could you please find it...
    CREATE OR REPLACE TRIGGER trig1
    AFTER INSERT OR UPDATE OR DELETE
    OF RLID,RL
    ON X_RLM_T
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    rlmId X_RLM_T.RLID%TYPE:=CASE WHEN INSERTING OR UPDATING THEN :NEW.RLID WHEN DELETING THEN :OLD.RLID ELSE NULL END;
    rlm RX_RLM_T.RL%TYPE:=CASE WHEN INSERTING OR UPDATING THEN :NEW.RL WHEN DELETING THEN :OLD.RL ELSE NULL END;
    var number:=0;
    var1 number:=0;
    BEGIN
    var:=1;
    var1:=1;
    INSERT ALL
    WHEN var=1 then
    INTO LM_D(CL_ID,D_RLM,RM_NM,RDK_ORG)
    VALUES(dclid,D_RLM,RM_NM,RDK_ORG)
    WHEN var1=1 then
    INTO LM_D(CL_ID,D_RLM,RM_NM,RDK_ORG)
    VALUES(pclid,D_RLM,RM_NM,RDK_ORG)
    SELECT X_RLM_DK_MAP_T.CL_ID AS dclid,
        PM_OR_T_VP.ORG_TECH_ID AS pclid,
        rlmId as D_RLM,
        rlm as RM_NM,
        RX_RLM_DK_MAP_T.ORG_TECH_ID as RDK_ORG
    FROM  RX_RLM_DK_MAP_T , PM_OR_T PMN_ORG_T_VP, PM_OR_T PMN_ORG_T_HP
           PM_RA_MST
    WHERE rlmId = RX_RLM_DK_MAP_T.RL_ID and
    RX_RLM_DK_MAP_T.ORG_TECH_ID=PM_OR_T_HP.ORG_TECH_ID and
    PM_OR_T_HP.ORG_ID=PM_RA_MST.HPMN_ID and     
    PM_RA_MST.VPMN_ID=PM_OR_T_VP.ORG_ID;
    end;error:
    11/2 PL/SQL: SQL Statement ignored
    24/8 PL/SQL: ORA-00933: SQL command not properly ended
    please help me in this...

    i GOT THE ERROR...

  • Classic report ORA-00933 SQL command not properly ended when enabling sort

    Hi,
    Oracle 11g r2, APEX 4.1.1.00.23.
    I have some reports of type SQL Query (PL/SQL function body returning SQL query), so the source is like the following :
    begin
      return points_ui.get_points_query(:P0_FILTER_TYPE);
    end;Without any sort option, the report is rendering successfully.
    But I got the following error when a try to enable the sort option for a column :
    ORA-00933: SQL command not properly endedI read about this error on Oracle forums, and I saw it was a bug in a previous release, but I thought it was fixed in 4.0.2...
    Any help would be much appreciated.
    Thanks.
    Yann.

    OK indeed I had to remove the order by clause from the query, I should have tested this...
    I thought there were some checks in the internal APEX process to "merge" the order by clauses, but it seems it is not the case...
    Thank you for your help.
    Yann.

  • PL/SQL function. ORA-00933: SQL command not properly ended

    This is my first attempt at pl/sql functions with dynamic sql. It will compile, but when I try to test it I get the ORA-00933 error at line 147. line 147 is OPEN retval FOR report_query;
    Please take a look and let me know what it wrong! thanks
    {CREATE OR REPLACE FUNCTION TSARPTS.Stats (v_Hub       IN VARCHAR2,
                                              v_type      IN VARCHAR2,
                                              v_subtype   IN VARCHAR2)
       RETURN SYS_REFCURSOR
    IS
       retval           SYS_REFCURSOR;
       report_query_a   VARCHAR2 (10000)
                           := '
      SELECT hub,
             CASE
                WHEN Total = 0 OR Pass_1st = 0 THEN 0
                ELSE ROUND (Pass_1st / (Total) * 100, 2)
             END
                AS Pass_1st_percent,
             CASE
                WHEN Total = 0 OR Pass_2nd = 0 THEN 0
                ELSE ROUND (Pass_2nd / (Total) * 100, 2)
             END
                AS Pass_2nd_percent,
             CASE
                WHEN Total = 0 OR Pass_3rd = 0 THEN 0
                ELSE ROUND (Pass_3rd / (Total) * 100, 2)
             END
                AS Pass_3rd_percent,
             CASE
                WHEN Total = 0 OR DNM = 0 THEN 0
                ELSE ROUND (DNM / (Total) * 100, 2)
             END
                AS DNM,
             CASE
                WHEN Total = 0 OR Incomplete = 0 THEN 0
                ELSE ROUND (Incomplete / (Total) * 100, 2)
             END
                AS Incomplete
        FROM (  SELECT hub,
                       SUM (DECODE (result, ''Pass_on_1st'', 1, 0)) Pass_1st,
                       SUM (DECODE (result, ''Pass_on_2nd'', 1, 0)) Pass_2nd,
                       SUM (DECODE (result, ''Pass_on_3rd'', 1, 0)) Pass_3rd,
                       SUM (DECODE (result, ''DNM'', 1, 0)) DNM,
                       SUM (DECODE (result, ''INCOMPLETE'', 1, 0)) Incomplete,
                         SUM (DECODE (result, ''Pass_on_1st'', 1, 0))
                       + SUM (DECODE (result, ''Pass_on_2nd'', 1, 0))
                       + SUM (DECODE (result, ''Pass_on_3rd'', 1, 0))
                       + SUM (DECODE (result, ''DNM'', 1, 0))
                       + SUM (DECODE (result, ''INCOMPLETE'', 1, 0))
                          Total
                  FROM employees_vw a, pse_vw b
                 WHERE     a.emplid = b.emplid
                       AND status IN (''S'', ''I'', ''N'')
                       AND TYPE = ''PSE''
       report_query_b   VARCHAR2 (10000)
                           := ' 
    SELECT hub,
           TYPE,
           subtype,
           CASE
              WHEN Total = 0 OR Pass_1st = 0 THEN 0
              ELSE ROUND (Pass_1st / (Total) * 100, 2)
           END
              AS Pass_1st_percent,
           CASE
              WHEN Total = 0 OR Pass_2nd = 0 THEN 0
              ELSE ROUND (Pass_2nd / (Total) * 100, 2)
           END
              AS Pass_2nd_percent,
           CASE
              WHEN Total = 0 OR Pass_3rd = 0 THEN 0
              ELSE ROUND (Pass_3rd / (Total) * 100, 2)
           END
              AS Pass_3rd_percent,
           CASE
              WHEN Total = 0 OR DNM = 0 THEN 0
              ELSE ROUND (DNM / (Total) * 100, 2)
           END
              AS DNM,
           CASE
              WHEN Total = 0 OR Incomplete = 0 THEN 0
              ELSE ROUND (Incomplete / (Total) * 100, 2)
           END
              AS Incomplete
      FROM (  SELECT hub,
       TYPE,
           subtype
                      SUM (DECODE (result, ''Pass_on_1st'', 1, 0)) Pass_1st,
                       SUM (DECODE (result, ''Pass_on_2nd'', 1, 0)) Pass_2nd,
                       SUM (DECODE (result, ''Pass_on_3rd'', 1, 0)) Pass_3rd,
                       SUM (DECODE (result, ''DNM'', 1, 0)) DNM,
                       SUM (DECODE (result, ''INCOMPLETE'', 1, 0)) Incomplete,
                         SUM (DECODE (result, ''Pass_on_1st'', 1, 0))
                       + SUM (DECODE (result, ''Pass_on_2nd'', 1, 0))
                       + SUM (DECODE (result, ''Pass_on_3rd'', 1, 0))
                       + SUM (DECODE (result, ''DNM'', 1, 0))
                       + SUM (DECODE (result, ''INCOMPLETE'', 1, 0))
                          Total
                  FROM employees_vw a, pse_vw b
                 WHERE     a.emplid = b.emplid
                       AND status IN (''S'', ''I'', ''N'')
                     AND TYPE = ''PSE''
       report_query     VARCHAR2 (10000);
    BEGIN
       IF v_hub <> '*'
       THEN
          report_query := report_query_a;
       ELSE
          report_query := report_query_b;
       END IF;
       IF v_hub <> '*'
       THEN
          report_query :=
             report_query || ' and hub = ''' || v_hub || ''' GROUP BY hub )
    GROUP BY hub,
             Pass_1st,
             Pass_2nd,
             Pass_3rd,
             Total,
             DNM,
             Incomplete';
       END IF;
       IF v_type <> '*' AND v_subtype <> '*' AND v_hub <> '*'
       THEN
          report_query :=
                report_query
             || ' and hub = '''
             || v_hub
             || ''' and type = '''
             || v_type
             || ''' and subtype= '''
             || v_subtype
             || '''
              GROUP BY hub,
                     TYPE,
                     subtype,
            GROUP BY hub,
                     TYPE,
                     subtype,
                     Pass_1st,
                     Pass_2nd,
                     Pass_3rd,
                     Total,
                     DNM,
                     Incomplete';
       END IF;
       OPEN retval FOR report_query;
       RETURN retval;
    END;
    Edited by: user10821012 on May 13, 2010 9:56 AM

    What you are seeing is pretty common. When I work with dynamic SQL I usually include some logic to put the dyanmic SQL into a string and a means to see what was generated, something like (untested here)
      v_sql_c := 'select * from dual';
      open refcur for v_sql_c;
    exception
      when others then
         insert into work_table (clob_column) values (v_sql_c);so I can later query the table to get to the generated SQL for debugging, something like
      select * from work_table;I also try to write dynamic SQL so I can paste it from the work table right into query execution without editing.

  • Got ORA-00933: SQL command not properly ended while submitting BIP Report

    Hi All,
    I have got the subjected error while submitting the XML report concurrent Program in R12.
    I have used lexical parameters in my data template and build the where clause in before report trigger.
    If i commented this lexical parameter thing in Data template and ran the report it was working fine...
    I have enabled the "debug_mode" property in Data template and i could see the query in log but the lexical parameter is coming as '&P_WHERE'. So I couldn't find that from where the error is coming...
    Please help me on this ....
    Regards,
    Kalidoss

    post what do you have for lexical parameters
    plz see
    Re: Lexical Parameters in WHERE clause giving error
    Re: lexical parameter in bi report

  • JDBC adapter error : ora-00933 SQL command not properly ended

    but I am quite sure to my configuration for jdbc was correct ,however it worked fine sometime, if is it the jdbc driver version problem? now the version is 9.2.0

    below is the message what I wanna send through SOAP to JDBC:
    - <ns1:MT_JDBC_KELVIN xmlns:ns1="urn:kelvin.com.xi.jdbc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    - <Statement>
    - <ZXI_MATERIAL action="">
      <table>1</table>
    - <access>
      <MATNR>119</MATNR>
      <MTART>1</MTART>
      <WERKS>1</WERKS>
      <LGORT>1</LGORT>
      <LGPBE>1</LGPBE>
      <MAKTX>1</MAKTX>
      <MEINS>1</MEINS>
      <MATKL>1</MATKL>
      <EXTWG>1</EXTWG>
      <PRDHA>1</PRDHA>
      <GROES>1</GROES>
      <BISMT>1</BISMT>
      <BKLAS>1</BKLAS>
      <QKLAS>1</QKLAS>
      <PRCTR>1</PRCTR>
      <XCHPF>1</XCHPF>
      <UPDATED>1</UPDATED>
      </access>
    - <key1>
      <MATNR>119</MATNR>
      </key1>
      </ZXI_MATERIAL>
      </Statement>
      </ns1:MT_JDBC_KELVIN>

  • 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

  • ORA-00933 SQL Comand not properly ended

    Hi,
    While running SQL * Plus report,I am getting the Error.ORA-00933 SQL Command not properly ended.
    Please advise

    Hi,
    This is the query.I want to run the report for 2 different org_ids.Each Org_id runs individually and it shoul be resticted only one org_id for a particular user.The user is resticted only his particular org_id.
    I am getting the same error.
    Please advise and Help me
    SELECT org_id
    , ctype
    , invoice_day inv_date
    , ROUND (TRUNC (SYSDATE) - invoice_date, 0) days_from_inv_date
    , CASE
    WHEN ROUND (TRUNC (SYSDATE) - invoice_date, 0) <= 0
    THEN 'Current'
    WHEN ROUND (TRUNC (SYSDATE) - invoice_date, 0) BETWEEN 1 AND 30
    THEN '1 - 30'
    WHEN ROUND (TRUNC (SYSDATE) - invoice_date, 0) BETWEEN 31 AND 60
    THEN '31 - 60'
    WHEN ROUND (TRUNC (SYSDATE) - invoice_date, 0) BETWEEN 61 AND 90
    THEN '61 - 90'
    WHEN ROUND (TRUNC (SYSDATE) - invoice_date, 0) > 90
    THEN '> 90'
    END inv_date_bucket
    , COUNT (DISTINCT invoice_number) num_invoices
    , SUM (amt_due_orig) total_amt_invoiced
    , SUM (amt_due_remain) total_amt_remain
    , ROUND ((SUM (amt_due_remain) / SUM (amt_due_orig)) * 100, 0) "%_DUE"
    FROM (SELECT rcta.org_id
    , TRUNC (rcta.printing_original_date) printing_date
    , hp.party_name customer_name
    , hca.account_number customer_number
    , hcsua.attribute1 ctype
    , hcsua.attribute2 ctype1
    , hcsua.attribute3 branch_agent_id
    , rcta.trx_date invoice_date
    , TO_CHAR (rcta.trx_date, 'DD-MON-YYYY - Day') invoice_day
    , rcta.trx_number invoice_number
    , apsa.amount_due_original amt_due_orig
    , apsa.amount_due_remaining amt_due_remain
    , (apsa.amount_due_original - apsa.amount_due_remaining)
    amt_paid
    , rcta.purchase_order
    , apsa.due_date
    FROM apps.ra_customer_trx_all rcta
    , apps.ar_payment_schedules_all apsa
    , apps.hz_parties hp
    , apps.hz_cust_accounts hca
    , apps.hz_cust_site_uses_all hcsua
    WHERE 1 = 1
    AND rcta.customer_trx_id = apsa.customer_trx_id
    AND apsa.CLASS = 'INV'
    AND rcta.bill_to_customer_id = hca.cust_account_id
    -------- AND rcta.org_id = :org_id
    AND hca.party_id = hp.party_id
    AND rcta.bill_to_site_use_id = hcsua.site_use_id
    AND rcta.trx_date >= SYSDATE - 180
    AND rcta.trx_date < SYSDATE + 1)
    GROUP BY org_id
    , ctype
    , invoice_day
    , invoice_date
    ORDER BY 1
    , 2
    , 4

  • ErrorORA-00933: SQL command not properly ended-933

    Hi All,
    I am trying to call a procedure and it is throwing me above error.Can you please look into below code and let me know what exactly I am missing here? :)
          EXECUTE IMMEDIATE('SELECT
              xmlelement("letter",
                   xmlattributes(
                        ' || x_letter_id || ' as "id",
                        to_char(sysdate,''DD.MM.YYYY HH24:MI:SS'') as "timestamp"
                          xmlelement("type", ''xxad.party.newPartyWithoutSSN''),
                   xmlelement("address",
                        XMLELEMENT("party",
                             xmlattributes (hp.party_id as "id"), hp.party_name
                           xmlelement ("location",
                                  XMLELEMENT("line-list",
                                       xmlelement("line", xxad_locations_pkg.format_street_address(hps.location_id)
                              xmlelement("postal-code", hp.POSTAL_CODE),
                        xmlelement("postal-name", hp.city)
                   select
                                    xmlelement(
                             "content-params",
                             XMLELEMENT("party",xmlattributes (hp.party_id as "party_id"), hp.party_name)
                        ) xml_data
                               FROM hz_parties hp
                               WHERE hp.party_number = :1
         ))  xml_data
    FROM
         hz_parties hp,
         hz_party_sites hps
         WHERE
         hp.party_number = ''114805372'')
         and hp.party_id= hps.party_id
          INTO xml_data USING q_party_number,
            q_party_number;Edited by: 889254 on Mar 5, 2012 6:02 AM

    889254 wrote:
    Hi Jeneesh,
    Thanks for your prompt reply.
    If I am not getting you wrong. you mean to say I should print the out put of execute immediate into dbms_outPut then run in execute immediate right?Almost.
    You should print the output of your SQL string using dbms_output to see what the SQL looks like, so that you can check that it's valid SQL.
    The problem with a lot of people who (mistakenly) use dynamic SQL statements is that they often leave out necessary spaces or quotes etc. in the syntax because they can't read their own SQL statements due to them being made up in pieces. The string you end up with has to be syntactically correct for execute immediate to be able to work.
    If the string your code generates can work alone in an SQL*Plus session then it will work with an execute immediate.

  • CallableStatement error: SQL command not properly ended

    I am getting a strange error using CallableStatement and Oracle 7.3.4 with PL/SQL 2.3 using Classes12 JDBC driverset from Oracle. Here is the code we are using, which is almost verbatim from several Java/Oracle CallableStatement examples for Oracle 8. I am wondering what I am missing to make this work on Oracle 7 and am unable to find a reference online:
    //String query = "begin PAC.PAC_WIP_WIPHEADER_PKG.GetWipNumPartList(?,?); end;";
    String query = "{ call PAC.PAC_WIP_WIPHEADER_PKG.GETWIPNUMPARTLIST(?,?) } ";
    CallableStatement csth = Connection.prepareCall(query);
    csth.setString(1, wipNumber);
    csth.setInt(2, PacCarousel.getCarouselNumber());
    csth.execute();
    using either the Begin or the call query (Begin commented in above code snip) is returning the following error from the JDBC driver:
    java.sql.SQLException: ORA-00933: SQL command not properly ended
    This identical 'begin' query works fine in TOAD or the PL/SQL console for Oracle, but just won't work using this set of JDBC drivers.
    Has anyone run into this problem before or perhaps have some suggestions?
    Thanks in advance

    I am getting a strange error using CallableStatement and Oracle 7.3.4 with PL/SQL 2.3 using Classes12 JDBC driverset from Oracle. Here is the code we are using, which is almost verbatim from several Java/Oracle CallableStatement examples for Oracle 8. I am wondering what I am missing to make this work on Oracle 7 and am unable to find a reference online:
    //String query = "begin PAC.PAC_WIP_WIPHEADER_PKG.GetWipNumPartList(?,?); end;";
    String query = "{ call PAC.PAC_WIP_WIPHEADER_PKG.GETWIPNUMPARTLIST(?,?) } ";
    CallableStatement csth = Connection.prepareCall(query);
    csth.setString(1, wipNumber);
    csth.setInt(2, PacCarousel.getCarouselNumber());
    csth.execute();
    using either the Begin or the call query (Begin commented in above code snip) is returning the following error from the JDBC driver:
    java.sql.SQLException: ORA-00933: SQL command not properly ended
    This identical 'begin' query works fine in TOAD or the PL/SQL console for Oracle, but just won't work using this set of JDBC drivers.
    Has anyone run into this problem before or perhaps have some suggestions?
    Thanks in advance

Maybe you are looking for

  • How to run a Java applet on a website.

    Hi, I am trying to run the code below [DrawLines.java|http://www.dgp.toronto.edu/~mjmcguff/learn/java/01-drawingLines/] import java.applet.*; import java.awt.*; public class DrawingLines extends Applet {    int width, height;    public void init() {

  • Who uses apogee products?

    hi everyone. i wanted to see who here uses apogee products? i have 2 duets for different machines and i find so many problems with the drivers. i have distortion, crashing, no sound input, random pops when there is no sound being played. its so frust

  • Rogue Detection and SPT issues

    Deployed wireless a few months. From a client to infrastrure standpoint, majority of users are happy with the ability to go wireless with their personal and work devices. The problem we're facing is proper identification of rogue's AP's on our wired

  • Webcenter Content URL is NOT WORKING

    Hi All, I'm new to Oracle Webcenter and  installed webcenter content 11.1.1.8 in my system(Windows 7).After running Admin and managed server(UCM_server1), getting the following error while i'm going to connect http://localhost:16200/cs Error 404--Not

  • How to play with 2 keyboards at the same time?

    Hello, I would like to play live (recording is not the target) with 2 keyboards connected on 2 separate tracks That requires a multipart USB...but how to assign each keyboard to a different track? Thank U for your help Pierre