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.

Similar Messages

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

  • 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

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

  • Procedure compilation failed with SQL command not properly ended error

    Hi All,
    Kindly help me to fix this.
    I am compiling a procedure and getting an error. Procedure and error details are as follows:
    Procedure:
    CREATE or REPLACE PROCEDURE jiostore_new.auditReportCount (u_name IN VARCHAR2,stdate IN DATE,eddate IN DATE)
    IS
    BEGIN
    DECLARE Total Number;
    BEGIN
    SELECT COUNT(am.id) into Total FROM auditMaster_ AS am  INNER JOIN jioworld.deviceos_ dvos ON dvos.id=am.deviceOs WHERE am.updatedBy=u_name or am.updatedBy=ALL AND DATE(am.updatedDate)>=stdate OR DATE(am.updatedDate)='0000-00-00' AND DATE(am.updatedDate)<=eddate or DATE(am.updatedDate)='0000-00-00';
    dbms_output.put_line('Total Count:' || Total);
    END;
    END;
    Error:
    Error(6,1): PL/SQL: SQL Statement ignored
    Error(6,50): PL/SQL: ORA-00933: SQL command not properly ended
    Regards,
    Vishal G

    2922723 wrote:
    Hi All,
    Kindly help me to fix this.
    I am compiling a procedure and getting an error. Procedure and error details are as follows:
    Procedure:
    CREATE or REPLACE PROCEDURE jiostore_new.auditReportCount (u_name IN VARCHAR2,stdate IN DATE,eddate IN DATE)
    IS
    BEGIN
    DECLARE Total Number;
    BEGIN
    SELECT COUNT(am.id) into Total FROM auditMaster_ AS am  INNER JOIN jioworld.deviceos_ dvos ON dvos.id=am.deviceOs WHERE am.updatedBy=u_name or am.updatedBy=ALL AND DATE(am.updatedDate)>=stdate OR DATE(am.updatedDate)='0000-00-00' AND DATE(am.updatedDate)<=eddate or DATE(am.updatedDate)='0000-00-00';
    dbms_output.put_line('Total Count:' || Total);
    END;
    END;
    Error:
    Error(6,1): PL/SQL: SQL Statement ignored
    Error(6,50): PL/SQL: ORA-00933: SQL command not properly ended
    Regards,
    Vishal G
    The first thing, is that for your own sanity you should learn to format your code for readability.  And for the sanity of those from whom you seek help, you should learn to preserve that formatting when you post to a forum:
    CREATE OR REPLACE PROCEDURE jiostore_new.auditReportCount(
        u_name IN VARCHAR2,
        stdate IN DATE,
        eddate IN DATE)
    IS
    BEGIN
      DECLARE
        Total NUMBER;
      BEGIN
        SELECT COUNT(am.id)
        INTO Total
        FROM auditMaster_ AS am
        INNER JOIN jioworld.deviceos_ dvos
        ON dvos.id              =am.deviceOs
        WHERE am.updatedBy      =u_name
        OR am.updatedBy          =ALL
        AND DATE(am.updatedDate)>=stdate
        OR  DATE(am.updatedDate) ='0000-00-00'
        AND DATE(am.updatedDate)<=eddate
        OR  DATE(am.updatedDate) ='0000-00-00';
        dbms_output.put_line('Total Count:' || Total);
      END;
    END;
    What is the data type of am.updateDate?  It appears to be a varchar being passed to a function named DATE to convert it to a DATEfor comparison to your input parameters,  But you also compare it to strings. 
    Where are the variables 'u_name' and 'ALL'?  (and what kind of a name is that for a variable -- 'ALL'?)

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

  • 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

  • Sql Exception : Sql command not properly ended

    Hi,
    I have the following piece of code which i am using to search into the database and display the result in my jsp page. But it is throwing this exception. This happens only when i give 2 conditions. If i try to search with only one parameter, it works fine and returns the result. But when i enable two parameters , it throws the exception.
    Below is the code i have written.
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@page import="java.sql.*"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <%  
            String queryString=null;
            String Part_Number=null;
                String Revision_Id=null;     
                String Part_Desc=null;     
                String Keyword_Name=null;
                String Design_Style=null;     
                String Configuration_Name=null;
                String Charateristic_Name=null;
             String pN=null;
            String rI=null;
            String pD=null;
            String kN=null;
            String dS=null;
            String coN=null;
            String chN=null;
             queryString ="select * from PART";
             Connection con=null;
               Statement pst=null;
               ResultSet rs=null;
               Part_Number =request.getParameter("part_nbr");
              Revision_Id=request.getParameter("rev_id");
               Part_Desc=request.getParameter("part_desc");
               Keyword_Name=request.getParameter("keyword_name");     
               Design_Style=request.getParameter("Design_style");
               Configuration_Name=request.getParameter("configuration");
               Charateristic_Name=request.getParameter("characteristic");
                pN=Part_Number.trim();
                rI=Revision_Id.trim();
                pD=Part_Desc.trim();
                kN=Keyword_Name.trim();
                dS=Design_Style.trim();
                coN=Configuration_Name.trim();
                chN=Charateristic_Name.trim();
              System.out.println("Part Number In success: "+pN);
              System.out.println("Rev Number In serchsuccess: "+rI);
              System.out.println("part desc In seachsuccess: "+pD);
              System.out.println("Keyword In sesuccess: "+kN);
              System.out.println("Design style In sesuccess: "+dS);
              System.out.println("Config In sesuccess: "+coN);
              System.out.println("charac In sesuccess: "+chN);
              System.out.println("queryString in sesuccess: "+queryString);
               if(rI!=null)     
                   queryString = queryString+" where REV_ID= '"+rI+"'";
               if(pD!=null)     
                   queryString = queryString+" where OBJ_DESC= '"+pD+"'";
               System.out.println("queryString in sesuccess: "+queryString);
              try
                   DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                    System.out.println("driver manager");
                con=DriverManager.getConnection("jdbc:oracle:thin:@172.18.93.53:1521:PDMDumm", "Dumm1", "satyam");
                System.out.println("connection established");
                 pst = con.createStatement();
                rs = pst.executeQuery(queryString);
                System.out.println("Query executed");
              catch(SQLException se)
                System.out.println("database error2");
                se.printStackTrace();
              catch(Exception e)
                   System.out.println("error");
            if(rs!=null)
            %>
          <table>
              <tr>
                <th> PartNumber
                <th> Revision_Id
                <th> Description
                <th> Characteristic
                <th> Configuration
                <th> DesignStyle
                <th> Keyword
                  <th> Planned Eff In Dte
                  <th> Infos
                  <th> Native File
           </table>     
       <tr>         
        <%       
                   while(rs.next())
                      %>
            <td> <%=rs.getString(1) %>          
            <td> <%=rs.getString(2) %>          
            <td> <%=rs.getString(3) %>          
            <td> <%=rs.getString(4) %>
            <td> <%=rs.getString(5) %>
            <td> <%=rs.getString(6) %>
            <td> <%=rs.getString(7) %>     
            <td> <%=rs.getString(8) %>     
            <td> <%=rs.getString(9) %>     
            <td> <%=rs.getString(10) %>     
          <%             
            %>
    </body>
    </html>And this is the exception i get.
    Part Number In success:
    Rev Number In serchsuccess:
    part desc In seachsuccess: cat
    Keyword In sesuccess: ----
    Design style In sesuccess: ----
    Config In sesuccess: ----
    charac In sesuccess: ----
    queryString in sesuccess: select * from PART
    queryString in sesuccess: select * from PART where REV_ID= '' where OBJ_DESC= 'cat'
    driver manager
    connection established
    database error2
    java.sql.SQLException: ORA-00933: SQL command not properly ended
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java)
         at org.apache.jsp.searchsuccess_jsp._jspService(searchsuccess_jsp.java:129)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at SearchKdcc.doPost(SearchKdcc.java:60)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:619)

    Hi drvijayy2k2 ,
    Thanks for replying.
    I used your code in my application and this is the problem i am facing now. The query is getting executed but its not taking the value from the database because of the Null Rev Id that is getting inputted into queryString. I have given only part_desc as the search criteria. If i just search using part description , commenting the rev_id part , i am able to retrieve the result from the database.
    I have to code in a way using which i can search using either rev_id or part_desc , or using both at the same time.
    Part Number In success:
    Rev Number In serchsuccess:
    part desc In seachsuccess: cat
    Keyword In sesuccess: ----
    Design style In sesuccess: ----
    Config In sesuccess: ----
    charac In sesuccess: ----
    queryString in sesuccess: select * from PART
    queryString in sesuccess: select * from PART where REV_ID= '' and OBJ_DESC= 'cat'
    driver manager
    connection established
    Query executed

  • SQL command not properly ended

    I am writting a procedure, I declare a cursor, the code like:
    CREATE or replace procedure printloanbooklist(cardno in integer) as
    cursor cur_loanbooklist is
    select book_loans.book_id bookid,
    title ,
    date_due,
    book_loans.branch_id branchid,
    author_name
    from books, book_loans, BOOK_AUTHORS
    where books.book_id = book_loans.book_id and
    book_authors.book_id = book_loans.book_id and
    card_no = cardno
    group by date_due desc;
    c_rec cur_loanbooklist%rowtype;
    it gave me:
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE PRINTLOANBOOKLIST:
    LINE/COL ERROR
    4/5 PL/SQL: SQL Statement ignored
    13/23 PL/SQL: ORA-00933: SQL command not properly ended
    26/27 PLS-00103: Encountered the symbol "BARCODE" when expecting one of
    the following:
    . ( ) , * @ % & | = - + < / > at in is mod not rem => ..
    <an exponent (**)> <> or != or ~= >= <= <> and or like as
    between from using ||
    I can not tell the problem of cursor, please help and thanks!

    You are right, Thanks. After I delete desc, it works. But the 'BORCODE' problem still there, the rest code like:
    16 begin
    17 if not cur_loanbooklist%isopen then
    18 open cur_loanbooklist;
    19 end if;
    20
    21 fetch cur_loanbooklist into c_rec;
    22 while cur_loanbook%found loop
    23 dbms_output.put_line(c_rec.branchid ||' ' ||sysdate);
    24 dbms_output.put_line('Item(s) checked out to '||cardno);
    25 dbms_output.put_line('TITLE: '||c_rec.title ||''/'||c_rec.author_name);
    26 dbms_output.put_line('BARCODE: '||c_rec.bookid);
    27 dbms_output.put_line('DUE DATE: '||c_rec.date_due);
    28 fetch cur_loanbooklist into c_rec;
    29 end loop;
    30 close cur_loanbooklist;
    31 end;
    32 /
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE PRINTLOANBOOKLIST:
    LINE/COL ERROR
    26/27 PLS-00103: Encountered the symbol "BARCODE" when expecting one of
    the following:
    . ( ) , * @ % & | = - + < / > at in is mod not rem => ..
    <an exponent (**)> <> or != or ~= >= <= <> and or like as
    between from using ||
    Please help and have good thanksgiving!

  • Sql command not properly ended at oci call oci stmtexecute

    Hi ,
    Iam new to OBI Apps, i have my DB,OBIEE 11g,Informatica, DAC instance installed in linux 64 bit and OBI Apps, Informatica, Dac clients in windows7 32 bit
    When i run DAC full load all the tasks show Success.
    In RPD when i select database in physical layer it is not showing any rows, when i try right click and select update row count
    [nqsError: 17001] Oracle Error Code: 933, message: ORA-00933: SQL Command not properly ended at OCI call OCIStmtExecute.[nqsError: 17010] SQL Statament Perparation failed.
    and als in answers iam facing same problem
    In Answers iam using EBS pre defined dashboards
    Unable to see the data in dashboards it is throwing error
    [nqsError: 17001] Oracle Error Code: 933, message: ORA-00933: SQL Command not properly ended at OCI call OCIStmtExecute.[nqsError: 17010] SQL Statament Perparation failed.
    I dont know where i had done mistake.
    can any one help in this regard \
    plzzzzzzzzzz

    Hi,
    Thanq for ur reply
    In EBS connection pool i have given at connection script-> execute on contact
    "call /* valueof(NQ_SESSION.ACF) */ APP_SESSION.validate_icx_session('valueof(NQ_SESSION.ICX_SESSION_COOKIE)')"
    can u let me know is it correct.
    And one more doubt
    in client machine i have 2 RPDs in repository
    1. OracleBIAnalyticApps.rpd and
    2. EnterpriseBusinessAnalytics.rpd
    i had uploaded OracleBIAnalytics.rpd in EM and below that i haven the path for catlog/EnterpriseBusinessAnalytics.rpd
    is it correct i have to upload EnterpriseBusinessAnalytics.rpd only

  • 'SQL command not properly ended' error

    Hi,
    I wrote a test application.
    I used an existing DB schema and the following:
    ============
    Windows XP
    KODO 3.0.2,
    Oracle 8i,
    Oracle JDBC driver - tried both 9.2.x and 9.0.1,
    JDK 1.4.2,
    KODO tools:
    schemagen.bat,
    reversemappingtool.bat,
    jdoc.bat
    custom.properties file where renamed all the ClassnameId filed to
    ClassnamePK.
    ============
    Tried to perform simple query without any parameters.
    Got the following error message:
    ================================
    kodo.util.DataStoreException: ORA-00933: SQL command not properly ended
    What have I missed here? I did not have this problem when I left only one
    table in the schema, having removed the others.
    Does anybody has any ideas regarding this issue? Do you want me to post
    any additional information?
    Thanks in advance,
    Anton

    Patrick Linskey wrote:
    Anton,
    Can you post the offensive SQL?
    -Patrick
    Anton Kommar wrote:
    Hi,
    I wrote a test application.
    I used an existing DB schema and the following:
    ============
    Windows XP
    KODO 3.0.2,
    Oracle 8i,
    Oracle JDBC driver - tried both 9.2.x and 9.0.1,
    JDK 1.4.2,
    KODO tools:
    schemagen.bat,
    reversemappingtool.bat,
    jdoc.bat
    custom.properties file where renamed all the ClassnameId filed to
    ClassnamePK.
    ============
    Tried to perform simple query without any parameters.
    Got the following error message:
    ================================
    kodo.util.DataStoreException: ORA-00933: SQL command not properly ended
    What have I missed here? I did not have this problem when I left only one
    table in the schema, having removed the others.
    Does anybody has any ideas regarding this issue? Do you want me to post
    any additional information?
    Thanks in advance,
    Anton
    Hello Patrick,
    Thank you for your reply.
    The problem I experienced magically dissappeared. I used actually
    different database servers and they probably differ in something. I am not
    able to repro it again.
    Please, forgive me for bothering you. I'll update this issue if I succeed
    to reproduce the problem again.
    Thank you,
    Anton

  • Drop triggers in code causes SQL command not properly ended.

    running the following command in SQL developer giving the following error
    ORA-00933: SQL command not properly ended.
    What am I doing wrong
    Begin 
    For I In (Select Trigger_Name, Owner From Dba_Triggers Where Trigger_Name Like 'ABC%' And Owner = 'my_schema')
      Loop 
        Execute Immediate 'DROP TRIGGER '||I.Owner||'.'||I.Trigger_Name; 
      End Loop; 
    End;Edited by: Mo2 on Apr 16, 2010 12:21 PM
    Edited by: Mo2 on Apr 16, 2010 12:24 PM

    Mo2 wrote:
    yes it has.
    an example of the names is BIN$+i6ls2WnR/Svz0wA5LSG8A==$0
    As a matter of fact those triggers get created by the database after I drop the tables. is there a way to avoid creating them?
    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0;
    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0
    ERROR at line 1:
    ORA-00933: SQL command not properly endedYes oracle complains about this while dropping it.
    These objects get created if you have recyclebin on.
    You can either off your recyclebin or you can purge these objects from recyclebin after dropping it. Make sure that you would not require this feature or objects in future.
    Regards
    Anurag

  • Any One Can Help Me--error :-SQL command not properly ended

    hi,
    this code has an error i have tried to find out this error but i can't find it so please help me :-
    report error:
    ORA-06550: line 1, column 149:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    Code
    select HTMLDB_ITEM.HIDDEN(1,SEQ_ID),
    HTMLDB_ITEM.TEXT(2,a.c001) c001,
    HTMLDB_ITEM.TEXT(3,a.c002) c002,
    HTMLDB_ITEM.TEXT(4,a.c003) c003,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(5,a.c004,'SELECT P_ID D,P_ID R FROM PARTY_DETAIL') c004,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    (6,a.c005,
    'SELECT CATEGARY_NAME D,'||'CATEGARY_NAME R FROM ITEM_CATEGARY',
    'style="width:220px" '
    ||'onchange="get_select_list_xml1(this,'
    || 'f7_'
    || LPAD (seq_id, 4, '0')
    || ')"',
    'YES',
    '0',
    '-Select-',
    'f6_'|| LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c005,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    (7,a.c006,
    'SELECT ITEM_CODE D,'
    ||'ITEM_CODE R FROM ITEM_MASTER'
    ||'WHERE CATEGARY_NAME ='
    || c005,
    'style="width:220px"',
    'YES',
    '0',
    '-Select Code ('
    || (Select Count(*)
    from ITEM_MASTER
    where CATEGARY_NAME = c005)
    || ')-',
    'f7_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c006,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(8,a.c007,'SELECT ITEM_NAME D,ITEM_NAME R FROM ITEM_MASTER') c007,
    HTMLDB_ITEM.TEXT(9,a.c008) c008,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(10,a.c009,'SELECT PACK_TYPE D,PACK_TYPE R FROM ITEM_PACKING') c009,
    HTMLDB_ITEM.TEXT(11,a.c010) c010,
    HTMLDB_ITEM.TEXT(12,a.c011) c011,
    HTMLDB_ITEM.TEXT(13,a.c012) c012,
    HTMLDB_ITEM.TEXT(14,a.c013) c013
    FROM wwv_flow_collections a
    where a.collection_name = 'REC_ITEM'
    Thanks
    Manoj
    Edited by: Manoj Kaushik on Sep 10, 2009 3:36 AM

    hi mike,
    My problem is:-
    i have a bill with multiple item eg . Apple (12), Banana (49), Badam (145) , Grapes(25) with there quantity and now i want to Add these item with quantity in my database
    when i finaly click on submit button .
    Actully I have been used tabular form but i am facing one problem when using tabular form ,in Tabular form i enter first item eg . Apple and there quantity eg. 12 in textfield and after click on Add Row Buttom data insert in to the database . but i want Entry Shouldn't go in to the database. But only New Row Should Add there when i click on Add Row Button.
    I want all these 4 item should enter in to data base when i click on Final Submit.
    So i have use this collection report to insert multiple item .everything was all right when i was using text field but when i changed these textfield into select list then error has arise .
    Actually i want also a cascade selectlist in this report .
    eg .item name depend on item code and item code depend on item category name .
    so i want when i select CATEGARY_NAME then item code come into report item and when i select ietem code them correcponding item name should come into item name field.
    for cascade select list i have created application process and java script .
    So please mike Suggest me some solution how can i do this .
    its urgent for me .
    This Is my code :-
    select HTMLDB_ITEM.HIDDEN(1,SEQ_ID),
    APEX_ITEM.TEXT(2,a.c001) c001,
    APEX_ITEM.TEXT(3,a.c002) c002,
    APEX_ITEM.TEXT(4,a.c003) c003,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(5,a.c004,'SELECT P_ID D,P_ID R FROM PARTY_DETAIL') c004,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    (6,a.c005,
    'SELECT CATEGARY_NAME D,'||'CATEGARY_NAME R FROM ITEM_CATEGARY',
    'style="width:220px" '
    ||'onchange="get_select_list_xml1(this,''f7_'|| LPAD (seq_id, 4, '0')
    ||''')"',
    'YES',
    '0',
    '-Select-',
    'f6_'|| LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c005,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    (7,a.c006,
    'SELECT ITEM_CODE D,'
    ||'ITEM_CODE R FROM ITEM_MASTER'
    ||'WHERE CATEGARY_NAME ='
    || c005,
    'style="width:220px"',
    'YES',
    '0',
    '-Select Code ('
    || (Select Count(*)
    from ITEM_MASTER
    where CATEGARY_NAME = c005)
    || ')-',
    'f7_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c006,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(8,a.c007,'SELECT ITEM_NAME D,ITEM_NAME R FROM ITEM_MASTER') c007,
    APEX_ITEM.TEXT(9,a.c008) c008,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(10,a.c009,'SELECT PACK_TYPE D,PACK_TYPE R FROM ITEM_PACKING') c009,
    APEX_ITEM.TEXT(11,a.c010) c010,
    APEX_ITEM.TEXT(12,a.c011) c011,
    APEX_ITEM.TEXT(13,a.c012) c012,
    APEX_ITEM.TEXT(14,a.c013) c013
    FROM wwv_flow_collections a
    where a.collection_name = 'REC_ITEM'
    I am waiting for your positive responce.
    thanks
    Manoj
    Edited by: Manoj Kaushik on Sep 10, 2009 4:46 AM

Maybe you are looking for

  • How do I add an animated GIF to my signature

    I am trying to add an animated GIF to my out going email. For my signature. How can do this?

  • How can I get the last known IP address of my stolen iPad?

    My iPad 16G Wifi was stolen with Find My iPhone turned on. It was broadcasting some coordinates yesterday, but the accuracy was not the best. Can I somehow get the IP address for this last online point? It would help to filter out some apartments in

  • Domain & Business Catalyst Website Muse Hosting URL Change

    Hi everyone, in case I host my muse site with BC (Business Catalyst). And I want to use a domain (for example "mydomain.com") which I purchased at a third-party. In case I choose the re-delegating option as mentioned here: http://tv.adobe.com/watch/m

  • Dynadock v3.0 monitor question

    I just purchased the Dynadock v3.0 (the smaller/cheaper dock). I am having trouble adjusting the monitor image size. Before connecting the dock I had the monitor directly connected by hdmi to the laptop (I have a toshiba sattelite laptop). The monito

  • Air for iOS connecting to sharepoint

    I am looking to download a text file from a 2007 Sharepoint site that is set up on an HTTPS secured server.  I am using the URLLoader function.  I have searched all over google, but I can't find a way to pass the login credentials through the interfa