Unexpected end of SQl command error ORA-921

I wrote this query as part of a larger query, however I can't seem to figure out why this ection gives me the ORA-921 error after the comparison expression (underlined below).
with
s2n as (
select distinct employeefk, policyref, advicename
from source
where
(payrollfk = (select payrollfk1 from payroll_1) or payrollfk = (select payrollfk2 from payroll_2)) and
displaysequence >= 0
group by employeefk, displaysequence, policyref, classificationtype, advicename, payrollfk)

I used hr demo tables for a similar query, check the usage examples of with clause - http://psoug.org/reference/with.html
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Pzt Eyl 10 23:10:07 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> conn hr/hr
Connected.
SQL> WITH tong AS (
  2    select distinct employee_id, first_name, last_name
  3    from employees
  4    where salary >= 0
  5          and (department_id = (select department_id from departments
  6                                   where department_name = 'IT') or
  7               department_id = (select department_id from departments
  8                                       where department_name = 'NOC')
  9              )
10    group by employee_id, first_name, last_name)
11  SELECT /*+ MATERIALIZE */ * FROM tong ;
EMPLOYEE_ID FIRST_NAME           LAST_NAME
        104 Bruce                Ernst
        105 David                Austin
        106 Valli                Pataballa
        103 Alexander            Hunold
        107 Diana                Lorentz

Similar Messages

  • UPPER function ..........ORA-00921: unexpected end of SQL command

    Hi
    getting below error.
    SQL> @c:\test_user.sql;
    Enter value for username: mapple
    old 1: DROP USER UPPER(&&USERNAME) CAS
    new 1: DROP USER UPPER(mapple) CASCADE
    DROP USER UPPER(mapple) CASCADE
    ERROR at line 1:
    ORA-00921: unexpected end of SQL command
    want to convert the user input into uppercase.
    cant we use UPPER() function over here ?
    how it can be done ?
    With Regards

    No you can't use the UPPER.
    Nor do you need it. Oracle will automatically translate all identifiers (table names, column names etc) in uppercase, unless you wrap them in double quotes.
    If you insist on using upper case:
    set sqlcase upper
    will send all of your statements translated to uppercase to the server.
    Sybrand Bakker
    Senior Oracle DBA

  • SQL execution error, ORA-01843: not a valid month

    Im using ASP/VBScript and its my first time starting to use Oracle as a DB provider.
    Just having an issue with a statement that I have.
    Heres my statement:
    SELECT T592_NOON.SHIP_CODE, T592_NOON.REPORT_DATE, T592_NOON.L_B, T592_NOON.AVERAGE_SPEED, T592_NOON.SEASTATE, T592_NOON.DISTANCE, T592_NOON.WIND_DIRECTION, T592_NOON.IFO_MAIN, T592_NOON.IFO_BOILER, T592_NOON.IFO_AUXENGINE FROM T592_NOON WHERE (((SHIP_CODE)='S271') AND (REPORT_DATE BETWEEN to_date('08/02/2004 13:00:00', 'DD-MON-YYYY HH24:MI') and to_date('28/02/2004 18:15:00', 'DD-MON-YYYY HH24:MI')))
    Whenever I run it it errors and returns:
    SQL execution error, ORA-01843: not a valid month
    Can anyone tell why this wouldnt work?
    REPORT_DATE type is DATE
    REPORT_DATE Sample data: 2003-04-28-12.00.00.000000

    Changing the format of the date seemed to fix it.
    Incorrect: '08/02/2004 13:00:00'
    Correct: '08-FEB-2004 13:00'

  • SQL*LOADER ERROR 비교 (ORA-2359, ORA-1401)

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-09
    SQL*LOADER ERROR 비교 (ORA-2359, ORA-1401)
    ==========================================
    PURPOSE
    SQL*LOADER 를 사용하는 경우 ORA-2359 ERROR가 나는 경우와
    ORA-1401 ERROR가 나는 경우를 비교한다.
    Examples
    table 의 desc가 다음과 같다고 가정하자.
    SQL> create table test5(a varchar2(1000));
    이 경우 delimiter 가 comma 인지 position 으로 구분되는지에 따라 error
    message가 달리 나타난다.
    1) ORA-2359 : field in datafile exceeded maximum specified length
    load data
    infile test.dat
    replace
    into table test5
    fields terminated by ','
    (a char) 로 실행 시 발생.
    ---> a char(1000) 으로 하면 error 해결이 가능하다.
    2) ORA-1401: inserted value too large for column
    load data
    infile test.dat
    replace
    into table test5
    fields terminated by ','
    (a position(1:2000) char)
    ---> 이 경우 a position (1:1000) char 로 하면 해결 가능하다 .
    * 참고로 + , - 기호와 comma 를 load 하기 위해서는 decimal external을
    사용한다. (a position decimal external (10))
    Reference Documents
    ---------------------

    You hit Bug 3531336
    Run the script catcio.sql from $ORACLE_HOME/rdbms/admin directory.
    Run this in sys schema.
    And then load the data with sqlloader.

  • SQL Loader Error : ORA-01830: date format picture ends before converting en

    I am inserting following data
    BES101706     M.E. Deals     7     10/17/2006
    through control file :
    LOAD DATA
    APPEND
    INTO TABLE abc_temp
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    (BATCH_NAME               ,
    SUPPLIER_NAME          ,
    SUPPLIER_NBR          ,
    INV_DATE "to_date(substr(:INV_DATE,1,10),'MM/DD/YYYY' )"
    But I am getting this error:
    ORA-01830: date format picture ends before converting entire input string
    inv_data is a date field in the database.

    I think it has to do with data format.Exactly.
    You have
    BES101706*M.E.*Deals*7*10/17/2006
    I replace each space with an asterisk. You have 5 columns according to your spec (terminated by '<space>')
    SQL Loader doesn't know that M.E. Deals is the supplier name.
    It's trying to convert 7 as the date.

  • Hi, i am new to oracle, SQL DEVELOPER:- ERROR:- ORA-01918

    Hi,
    I am new to oracle, and i have installed Oracle database 12c enterprise edition, and oracle jdeveloper 12c for adf web application development,
    I created a database and a new connection in it using sql developer, however while trying to create new user with the name db1 by right clicking on other users. by following the instructions in oracle documentation site. i get the error that new user db1 doesnt exist, and gives error:- ORA-01981. i even tried by changing the username as i thought may be it doesnt support alphanumeric name, but still i get the same error.
    So please tell me how to create a new user. is there any way to get out of this ora:-01918, as i googled and it says this is a bug.
    My os is win 7 x64(amd processor ).
    Thank you
    Baldwin

    A new user (called a schema in Oracle) is created using the CREATE USER SQL command. You need to be signed in as the SYS schema/user or as a schema that has been granted the rights to create schemas.
    12c database comes in two basic flavours. Container database (containing pluggable databases). Standard database. If connected to a container database, you cannot create standard user schemas - you need to be connected to a pluggable database.
    Also, your question has no relevance to either the SQL or PL/SQL languages - the subject matter of this forum. Please repost your question to a more appropriate forum dealing with SQL-Developer issues.

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi,
    I am working on Application Express 4.0.2.00.06, and 11G database.
    I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at runtime only), and does not when I define it - Use Query-Specific Column Names and Validate Query.
    I am getting error:
    report error:ORA-01403: no data found
    This is my query that is returned from function, and displayed with htp.p, and it works ok and returns data in SQL Developer and SQL Workshop (in Apex).
    <code>
    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA
    </code>
    As you can see, I even tried with workaround that I found on the previous post on the forum, and that is to put /* select 1 from dual */ to start query.
    Any help would be appriciated.

    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA

  • SQL loader error ORA-01401:

    I am trying to import a .dat file using SQL loader and
    i am getting error:ORA-01401: inserted value too large for column and i tried changing the column length to bigger too.
    TABLE STRUCTURE
    create table NOTE
    NOTE_EFF_DATE NUMBER,
    NOTE_NDC_NUMBER NUMBER,
    NOTE_PREV_NDC_NUMBER NUMBER,
    NOTE_DEA_CLASS_CD VARCHAR2(5),
    NOTE_PRODUCT_CTGRY_CD VARCHAR2(5),
    NOTE_PRODUCT_NAME VARCHAR2(40),
    NOTE_FORM_CODE VARCHAR2(5),
    NOTE_PRODUCT_STRENGTH VARCHAR2(35),
    NOTE_PRODUCT_MSUR_CD VARCHAR2(5),
    NOTE_PRODUCT_PKG_SZ NUMBER,
    NOTE_PRODUCT_PKG_QTY_CD VARCHAR2(6),
    NOTE_THRPTC_CLS_CD NUMBER,
    NOTE_AWP_CRT_PRC_EF_DT NUMBER,
    NOTE_AWP_CRT_PRC NUMBER,
    NOTE_AWP_UNT_PRC NUMBER,
    NOTE_AWP_1ST_PRV_UNT_PRC NUMBER
    DATA IN .dat FILE:
    093083100002035151 401DARVOCET-N 50 TAB 01000EA 0000000001831780008120000008120000007250
    093083100002011104 08SODIUM SALICYLATE CAP10 GR 01000EA 2808020070880920005519000005519000005158
    .dat FILE format/structure
    01 NOTE-REC.
    05 NOTE-KEY.
    10 NOTE-EFF-DATE.
    15 NOTE-EFF-C PIC X(01).
    15 NOTE-EFF-YY PIC X(02).
    15 NOTE-EFF-MM PIC X(02).
    15 NOTE-EFF-DD PIC X(02).
    10 NOTE-NDC-NUMBER.
    15 NOTE-NDC-NUM-5 PIC X(05).
    15 NOTE-NDC-NUM-4 PIC X(04).
    15 NOTE-NDC-NUM-2 PIC X(02).
    05 NOTE-PREV-NDC-NUMBER.
    10 NOTE-NDC-NUM-5 PIC X(05).
    10 NOTE-NDC-NUM-4 PIC X(04).
    10 NOTE-NDC-NUM-2 PIC X(02).
    05 NOTE-DEA-CLASS-CD PIC X(01).
    05 NOTE-PRODUCT-CTGRY-CD PIC X(02).
    05 NOTE-PRODUCT-NAME PIC X(35).
    05 NOTE-FORM-CODE PIC X(03).
    05 NOTE-PRODUCT-STRENGTH PIC X(25).
    05 NOTE-PRODUCT-MSUR-CD PIC X(02).
    05 NOTE-PRODUCT-PKG-SZ PIC 9(05).
    05 NOTE-PRODUCT-PKG-QTY-CD PIC X(03).
    05 NOTE-THRPTC-CLS-CD PIC 9(10).
    05 NOTE-AWP-CRT-PRC-EF-DT PIC 9(05).
    05 NOTE-AWP-CRT-PRC PIC 9(05)V99.
    05 NOTE-AWP-UNT-PRC PIC 9(04)V9(05).
    05 NOTE-AWP-1ST-PRV-UNT-PRC PIC 9(04)V9(05).
    Control FILE:
    LOAD DATA
    INFILE 'NCD.dat'
    BADFILE 'NCD.bad'
    DISCARDFILE 'NCD.dsc'
    INTO TABLE NOTE
    REPLACE
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    NOTE_EFF_DATE POSITION(1:7) INTEGER EXTERNAL NULLIF(NOTE_EFF_DATE=BLANKS),
    NOTE_NDC_NUMBER POSITION(8:18) DECIMAL EXTERNAL NULLIF(NOTE_NDC_NUMBER=BLANKS),
    NOTE_PREV_NDC_NUMBER POSITION(19:27) DECIMAL EXTERNAL NULLIF(NOTE_PREV_NDC_NUMBER=BLANKS),
    NOTE_DEA_CLASS_CD POSITION(28) CHAR NULLIF (NOTE_DEA_CLASS_CD=BLANKS),
    NOTE_PRODUCT_CTGRY_CD POSITION(29:30) CHAR NULLIF (NOTE_PRODUCT_CTGRY_CD=BLANKS),
    NOTE_PRODUCT_NAME POSITION(31:65) CHAR NULLIF (NOTE_PRODUCT_NAME=BLANKS),
    NOTE_FORM_CODE POSITION(66:68) CHAR NULLIF (NOTE_FORM_CODE=BLANKS),
    NOTE_PRODUCT_STRENGTH POSITION(69:93) CHAR NULLIF (NOTE_PRODUCT_STRENGTH=BLANKS),
    NOTE_PRODUCT_MSUR_CD POSITION(94:95) CHAR NULLIF (NOTE_PRODUCT_MSUR_CD=BLANKS),
    NOTE_PRODUCT_PKG_SZ POSITION(96:100) INTEGER EXTERNAL NULLIF (NOTE_PRODUCT_PKG_SZ=BLANKS),
    NOTE_PRODUCT_PKG_QTY_CD POSITION(101:103) CHAR NULLIF (NOTE_PRODUCT_PKG_QTY_CD=BLANKS),
    NOTE_THRPTC_CLS_CD POSITION(104:113) INTEGER EXTERNAL NULLIF (NOTE_THRPTC_CLS_CD=BLANKS),
    NOTE_AWP_CRT_PRC_EF_DT POSITION(114:118) INTEGER EXTERNAL NULLIF (NOTE_AWP_CRT_PRC_EF_DT=BLANKS),
    NOTE_AWP_CRT_PRC POSITION(119:225) DECIMAL EXTERNAL NULLIF (NOTE_AWP_CRT_PRC=BLANKS),
    NOTE_AWP_UNT_PRC POSITION(226:234) DECIMAL EXTERNAL NULLIF (NOTE_AWP_UNT_PRC=BLANKS),
    NOTE_AWP_1ST_PRV_UNT_PRC POSITION(235:245) DECIMAL EXTERNAL NULLIF (NOTE_AWP_1ST_PRV_UNT_PRC=BLANKS)

    load data
    APPEND into table TBL1
    fields terminated by "," optionally enclosed by '"'
    TRAILING NULLCOLS          
    columnname
    )Hi!
    Brother, pls give the details of your column. Your exact script. Initially, it seems that - your code is ok. But, that is my guess. Please post the complete script. We cannot say anithing - untill we go through the entire code of your script.
    Regards.
    Satyaki De.

  • SQL Command Error on Hosted environment

    An error is occurring on the oracle hosted environment. I don't believe that it is a problem with my IE, but with my company's antivirus software. Is there some setting I should ask them to do? I am unable to run sql commands on the hosted environment.
    Line: 241
    Char: 7
    Error: Automation server can't create object
    Code:0
    URL:http//htmldb.oracle.com/pls/otn/f?p=4500:1001

    Hi <please supply your name>,
    SQL Developer Worksheet is not available from the command line.
    The BRIDGE command is only supported in the Worksheet.
    Its an interesting idea though. Are you trying to script data move from a non Oracle database to an Oracle database using the BRIDGE command?
    The BRIDGE command was initially done to allow a simple data move from a non Oracle database to Oracle. We then build the "Copy to Oracle" feature out of it.
    http://dermotoneill.blogspot.com/2010/11/cross-database-bridge-statement.html
    http://dermotoneill.blogspot.com/2010/11/copy-to-oracle.html
    Since the BRIDGE command references connection names, which have to be defined in UI of SQL Developer any solution to run this on the command line would have to work this out.
    There are number of ways you can do this without using the BRIDGE command.
    1) Perform a capture/convert of your non Oracle database and then generate the "offline" data move scripts.
    Theses scripts use SQL*Loader and your non Oracle database tool (Ex: Sybase BCP).
    These are run from the command line and can be modified ....
    2) Use a database link from your Oracle database to your non Oracle database and reference /query the data that way.
    I would interested to hear your thoughts.
    Regards,
    Dermot
    SQL Developer Team.

  • Adding multiple SQL Commands, Errors

    When I add a second SQL Command to my report I get the following error messages right before it attempts to update the data.  I have tried replacing the new SQL into the existing SQL command and it works, so I am fairly certain the SQL syntax is correct.
    "Failed to retrieve data from the database" and "unknown database connection error".
    Any idea as to why this is occurring?
    Thanks!

    If you're using a command, you should use a single command to provide ALL of the data for your report.  Please see my post here Best Practices When Using Commands with Crystal Reports for more information about how to use commands.
    -Dell

  • Sql load error: ORA-01461: can bind a LONG value only for insert into a LON

    I have 3 columns of varchar2(4000) in my table. I used char(4000) in my ctl. Please see below..
    LOAD DATA
    TRUNCATE INTO TABLE sa.sudhir_MARRIOTT_RBP_FORMAT
    fields terminated by ' '
    TRAILING NULLCOLS
    TARGETING_SECTION,
    TAG_TYPE,
    NO_OFFER_SUPPRESS,
    MAX_OFFER,
    HTML_REGEX,
    HTML_HEADER char(4000),
    HTML_FOOTER char(4000),
    RICH_TEXT_REGEX,
    RICH_TEXT_HEADER,
    RICH_TEXT_FOOTER,
    TEXT_REGEX,
    TEXT_HEADER,
    TEXT_FOOTER
    If I specify char(3000) for HTML_HEADER and char(1000) for HTML_FOOTER it works! (because at this moment html_header is less than 3000 and html_footer data is less than 1000). But I want to load 4000 characters max into both columns too. When I add , it fails with following error,
    ORA-01461: can bind a LONG value only for insert into a LONG column
    Please help !!
    Sudhir

    Anybody have any ideas?

  • SQL startup  Error:ORA-03113: end-of-file on communication channel

    Hello All,
    Oracle 11g 11.2.0.2 Expression Edition
    I made the number of processes to 1 by issuing the below command.
    SQL> alter system set processes = 1;
    SQL>shutdown immediateI am getting the below error when I issued startup command.
    SQL> startup;
    ORA-03113: end-of-file on communication channelalert log:
    Fri Dec 28 14:09:24 2012
    PMON started with pid=2, OS id=2984
    Fri Dec 28 14:09:24 2012
    PSP0 started with pid=3, OS id=5788
    Fri Dec 28 14:09:25 2012
    ORA-00020: No more process state objects available
    ORA-20 errors will not be written to the alert log for
    the next minute. Please look at trace files to see all
    the ORA-20 errors.
    Process GEN0 submission failed with error = 20
    USER (ospid: 4780): terminating the instance due to error 444
    Fri Dec 28 14:09:25 2012
    VKTM started with pid=4, OS id=1676 at elevated priority
    Instance terminated by USER, pid = 4780How to startup my database again?

    alert log:
    Starting up:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production.
    Using parameter settings in server-side pfile C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\INITXE.ORA
    System parameters with non-default values:
      processes                = 6
      sessions                 = 32
      spfile                   = "C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DBS\SPFILEXE.ORA"
      memory_target            = 1G
      control_files            = "C:\ORACLEXE\APP\ORACLE\ORADATA\XE\CONTROL.DBF"
      compatible               = "11.2.0.0.0"
      db_recovery_file_dest    = "C:\oraclexe\app\oracle\fast_recovery_area"
      db_recovery_file_dest_size= 10G
      undo_management          = "AUTO"
      undo_tablespace          = "UNDOTBS1"
      remote_login_passwordfile= "EXCLUSIVE"
      dispatchers              = "(PROTOCOL=TCP) (SERVICE=XEXDB)"
      shared_servers           = 4
      job_queue_processes      = 4
      audit_file_dest          = "C:\ORACLEXE\APP\ORACLE\ADMIN\XE\ADUMP"
      db_name                  = "XE"
      open_cursors             = 300
      diagnostic_dest          = "C:\ORACLEXE\APP\ORACLE"
    Fri Dec 28 14:06:59 2012
    PMON started with pid=2, OS id=2248
    Fri Dec 28 14:06:59 2012
    PSP0 started with pid=3, OS id=3700
    Fri Dec 28 14:07:00 2012
    VKTM started with pid=4, OS id=4492 at elevated priority
    Fri Dec 28 14:07:00 2012
    ORA-00020: No more process state objects available
    VKTM running at (10)millisec precision with DBRM quantum (100)ms
    ORA-20 errors will not be written to the alert log for
    the next minute. Please look at trace files to see all
    the ORA-20 errors.
    Process GEN0 submission failed with error = 20
    USER (ospid: 6076): terminating the instance due to error 444
    Instance terminated by USER, pid = 6076
    Fri Dec 28 14:09:07 2012
    Starting ORACLE instance (normal)
    LICENSE_MAX_SESSION = 0
    LICENSE_SESSIONS_WARNING = 0
    Picked latch-free SCN scheme 2
    Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
    Autotune of undo retention is turned on.
    IMODE=BR
    ILAT =10
    LICENSE_MAX_USERS = 0
    SYS auditing is disabled
    Starting up:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production.
    Using parameter settings in server-side pfile C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\INITXE.ORA
    System parameters with non-default values:
      processes                = 6
      sessions                 = 32
      spfile                   = "C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DBS\SPFILEXE.ORA"
      memory_target            = 1G
      control_files            = "C:\ORACLEXE\APP\ORACLE\ORADATA\XE\CONTROL.DBF"
      compatible               = "11.2.0.0.0"
      db_recovery_file_dest    = "C:\oraclexe\app\oracle\fast_recovery_area"
      db_recovery_file_dest_size= 10G
      undo_management          = "AUTO"
      undo_tablespace          = "UNDOTBS1"
      remote_login_passwordfile= "EXCLUSIVE"
      dispatchers              = "(PROTOCOL=TCP) (SERVICE=XEXDB)"
      shared_servers           = 4
      job_queue_processes      = 4
      audit_file_dest          = "C:\ORACLEXE\APP\ORACLE\ADMIN\XE\ADUMP"
      db_name                  = "XE"
      open_cursors             = 300
      diagnostic_dest          = "C:\ORACLEXE\APP\ORACLE"
    Fri Dec 28 14:09:24 2012
    PMON started with pid=2, OS id=2984
    Fri Dec 28 14:09:24 2012
    PSP0 started with pid=3, OS id=5788
    Fri Dec 28 14:09:25 2012
    ORA-00020: No more process state objects available
    ORA-20 errors will not be written to the alert log for
    the next minute. Please look at trace files to see all
    the ORA-20 errors.
    Process GEN0 submission failed with error = 20
    USER (ospid: 4780): terminating the instance due to error 444
    Fri Dec 28 14:09:25 2012
    VKTM started with pid=4, OS id=1676 at elevated priority
    Instance terminated by USER, pid = 4780pfile.ora
    xe.__db_cache_size=239075328
    xe.__java_pool_size=4194304
    xe.__large_pool_size=12582912
    xe.__oracle_base='C:\oraclexe\app\oracle'#ORACLE_BASE set from environment
    xe.__pga_aggregate_target=427819008
    xe.__sga_target=645922816
    xe.__shared_io_pool_size=75497472
    xe.__shared_pool_size=306184192
    xe.__streams_pool_size=0
    *.audit_file_dest='C:\oraclexe\app\oracle\admin\XE\adump'
    *.compatible='11.2.0.0.0'
    *.control_files='C:\oraclexe\app\oracle\oradata\XE\control.dbf'
    *.db_name='XE'
    *.DB_RECOVERY_FILE_DEST_SIZE=10G
    *.DB_RECOVERY_FILE_DEST='C:\oraclexe\app\oracle\fast_recovery_area'
    *.diagnostic_dest='C:\oraclexe\app\oracle\.'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=XEXDB)'
    *.job_queue_processes=4
    *.memory_target=1024M
    *.open_cursors=300
    *.processes=100
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sessions=80
    *.shared_servers=4
    *.undo_management='AUTO'
    *.undo_tablespace='UNDOTBS1'

  • Why is the clause marked red giving error - unexpected end of sql statement

    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
         SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),                         (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B')
                        FROM ape_summary_a a ;

    I believe you are missing a parenthesis from the last select statement
    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
    SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'), (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B') )
    FROM ape_summary_a a ;
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • PL/SQL report errors: ORA-01422

    Hi all,
    (before i you read i would like to say i have searched the net for this error code but nothing shows up like this problem..)
    I am getting an error problem when i select certain Schemas from a list on an apex app. page, it only works for some schemas not all..
    When i select one schema, it is supposed to display one row.. when i select [ALL] it is supposed to show them all.
    It does work if i select '[ALL]' from the select list (p3_schema_name), just not for every single individual one.
    the error code:
    ORA-01422: exact fetch returns more than requested number of rows
    declare
      vSchema  varchar2(20);
      vStmt  varchar2(1000);
      vVersion number(5);
      vDBName  varchar2(20);
      vHostName varchar2(80);
      vStmt2  varchar2(1000);
      vVersion2 number(5);
      vDBName2  varchar2(20);
      vServer2 varchar2(80);
      vSchema2 varchar2(80);
      CURSOR c_schemas IS
        select owner from dba_tables@P3_DB_NAME.db_link where table_name = 'DDL_LOG' and num_rows > 0 order by owner;
    begin
      IF :P3_SCHEMA_NAME != '[ALL]' AND :P3_DB_NAME IS NOT NULL AND :P3_SERVER_NAME IS NOT NULL THEN
        vServer2 := :P3_SERVER_NAME;
        vSchema2 := :P3_SCHEMA_NAME;
          vStmt2 := 'select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from &P3_SCHEMA_NAME..ddl_log@&P3_DB_NAME.db_link GROUP BY DDH_DB_NM';
          Execute Immediate vStmt2 into vDBName2, vVersion2;
            htp.p('<br>');
            htp.p('<table border="1">');
            htp.p('<tr>');
            htp.p('<th bgcolor="#FFCC99">SERVER NAME</th>');
            htp.p('<th bgcolor="#FFCC99">DB NAME</th>');
            htp.p('<th bgcolor="#FFCC99">SCHEMA NAME</th>');
            htp.p('<th bgcolor="#FFCC99">PATCH</th>');
            htp.p('</tr>');
            htp.p('<tr>');
            htp.p('<td>');
            htp.p(vServer2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vDBName2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vSchema2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vVersion2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p('<BR>');
            htp.p('</td>');
            htp.p('</tr>');
            htp.p('</tr>');
            htp.p('</table>');
       ELSE IF :P3_SCHEMA_NAME = '[ALL]' AND :P3_DB_NAME IS NOT NULL AND :P3_SERVER_NAME IS NOT NULL THEN
       vHostName := :P3_SERVER_NAME;
       vDBName := :P3_DB_NAME;
         open c_schemas;
          htp.p('<br>');
          htp.p('<table border="1">');
          htp.p('<tr>');
          htp.p('<th bgcolor="#FFCC99">SERVER NAME</th>');
          htp.p('<th bgcolor="#FFCC99">DB NAME</th>');
          htp.p('<th bgcolor="#FFCC99">SCHEMA NAME</th>');
          htp.p('<th bgcolor="#FFCC99">PATCH</th>');
          htp.p('</tr>');
        LOOP
          FETCH c_schemas INTO vSchema;
          EXIT WHEN c_schemas%NOTFOUND;
          vStmt  := 'select max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from '||vSchema||'.ddl_log@&P3_DB_NAME.db_link where DDH_SCHEMA_NR = (select max(DDH_SCHEMA_NR) from '||vSchema||'.ddl_log@&P3_DB_NAME.db_link) and rownum < 2' ;
          Execute Immediate vStmt into vVersion  ;
          htp.p('<tr>');
          htp.p('<td>');
          htp.p(vHostName);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vDBName);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vSchema);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vVersion);
          htp.p('</td>');
          htp.p('<td>');
          htp.p('<BR>');
          htp.p('</td>');
          htp.p('</tr>');
        END LOOP;
          htp.p('</tr>');
          htp.p('</table>');  
      CLOSE c_schemas;
    END IF;
    END IF;
    END;I have checked the DDH_SCHEMA_NR for repeating entries of the highest number.. some of the ones that dont work do have repeating entries some don't.
    Sorry if this is confusing, i have tried to explain it as best as i can.
    Thanks in advance for any help.
    Ashleigh

    Hello Ashleigh,
    Based on your code, I'd start by running this piece of SQL via command-line (thru SQL Workshop, SQL*Plus, Toad, etc.), replacing &P3_SCHEMA_NAME. and &P3_DB_NAME. with values that are currently causing the routine to fail and see if it returns more than one row. I don't know your data, but DISTINCT and GROUP BY are typically used to return multiple (though grouped/summarized) rows. It appears to be the only statement that would cause the error your seeing (more than one row being returned into single variables).
    select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from &P3_SCHEMA_NAME..ddl_log@&P3_DB_NAME.db_link GROUP BY DDH_DB_NM;I'm actually surprised that the code runs at all. I didn't think 'execute immediate' would know what to do with substitutions indicated as "&something." (I've typically seen that when substituting in dynamic HTML/Javascript code but maybe I'm learning something new). But since you already have vServer2 and vSchema2, I'd be more apt to code it as:
    vStmt2 := 'select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from ' ||
    vSchema2 || '.ddl_log@' || vServer2 || '.db_link GROUP BY DDH_DB_NM';Hope this helps,
    John

  • SQL Statement error - ORA-00903: invalid table name

    Hi
    I have written a sql script that gets executed from a form within e-business suite. Unfortunately, the script is falling over with an error:
    unknown command beginning "MERGE INTO..." - rest of line ignored.
    unknown command beginning "USING edop..." - rest of line ignored.
    unknown command beginning "ON (elw.ro..." - rest of line ignored.
    unknown command beginning "WHEN MATCH..." - rest of line ignored.
    For a list of known commands enter HELP
    and to leave enter EXIT.
          SET ELW.billed_flag          = t.billed_flag,
    ERROR at line 2:
    ORA-00903: invalid table name the actual statement that is causing the issue is:
    MERGE INTO edopaif.table1 elw
    USING edopaif.tablw2 t
    ON (elw.rowid = t.LOAD_WORKING_ROWID)
    WHEN MATCHED THEN
       UPDATE
          SET ELW.billed_flag          = t.billed_flag,
              ELW.last_bill_generated   = t.last_bill_generated,
              ELW.last_bill_type        = t.last_bill_type,
              ELW.load_month            = t.load_month,
              ELW.BILL_TRANSACTION_ID   = t.bill_transaction_id
    WHEN NOT MATCHED THEN
       INSERT(error_meaning)
       VALUES('ROWID error with ins_ptia');The version of e-business suite that we are using is: 11.5.10.2.
    The version of the Oracle database that we are using is:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE 9.2.0.6.0 Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    Please note that I am able to successfully run the statement directly connected as the APPS schema in the database - the error only occurs when the script is run from the forms front-end (which is really confusing me).
    Many thanks
    Paul

    Hi
    I've modified the script to include only the statement that is erroring and it still errors when executed from the front end application.
    Next I re-wrote the statement to use PL/SQL instead of the MERGE statement, to do the update, and the script completes succesfully, i.e.:
    DECLARE
       CURSOR cu_lw IS
             SELECT t.billed_flag,
                    t.last_bill_generated,
                    t.last_bill_type,
                    t.load_month,
                    t.bill_transaction_id,
                    t.load_working_rowid
               FROM table2 t;
    BEGIN
       FOR rec_cu_lw IN cu_lw LOOP
          UPDATE table1 elw
             SET ELW.billed_flag           = rec_cu_lw.billed_flag,
              ELW.last_bill_generated      = rec_cu_lw.last_bill_generated,
              ELW.last_bill_type           = rec_cu_lw.last_bill_type,
              ELW.load_month               = rec_cu_lw.load_month,
              ELW.BILL_TRANSACTION_ID      = rec_cu_lw.bill_transaction_id
          WHERE elw.rowid                  = rec_cu_lw.load_working_rowid;
       END LOOP;
    END;
    /I am still unsure as to why the MERGE statement is failing when executed in the front end, but completes in the backend with no issues at all. Obviously I would prefer to use the MERGE statement instead of PL/SQL to do the update.
    Thanks
    Paul

Maybe you are looking for

  • Generating BIP report in RTF format generates blank report

    Hi all, When generating a BIP report in RTF format the report output is blank!? If I run the report in any other format the report displays the data correctly. We're running siebel 8.1.1.2 and BIP 10.1.3.4.1. When looking at the size of the report wh

  • Error in Rcvr File Adapter using FTP ?

    Hi @, I am getting the follwoing error while trying to put file in the folder thru Rcvr File Adapter using FTP and it is giving me following error : java.io.FileNotFoundException :(Permission Denied ) I have verified the permissions on the folder and

  • NewLine Character in the String received from Interactive Adobe Form

    Hello Experts, Following is the issue we have with interactive Adobe Form We have a text area within the form. User enters the text in multiple lines in this text area. We are calling a backend function module designed in SE37 that accepts and proces

  • How much data is needed to download the whole creative suite?

    How much data is needed to download the whole creative suite?

  • Sorting String Value

    Hi All, i have a simple question but don't know how to resolve it i have some files with name like abc_15-06-09 we need to sort these file based on the time stamp appended at the end of the file, in my example "15-06-09" i am not sure how can i sort