SQL PLUS result give me #######

Does anyone know why my result row is giving me ############# as a record.
All my row is ####### for one of my column...
thanks

It means value precision exceeds number or/and column width or column format is not numeric:
SQL> select 12345 x from dual
  2  /
         X
     12345
SQL> set numwidth 4
SQL> select 12345 x from dual
  2  /
   X
SQL> set numwidth 10
SQL> select 12345 x from dual
  2  /
         X
     12345
SQL> column x format 999
SQL> select 12345 x from dual
  2  /
   X
SQL> column x format 99999
SQL> select 12345 x from dual
  2  /
     X
12345
SQL> column x format a30
SQL> select 12345 x from dual
  2  /
         X
SQL> SY.

Similar Messages

  • When I open SQL Plus then give this error

    Hi Master,
    Sir i install oracle 8i and run but next day i open my SQL Plus then give this error
    ORA-01034 : oracle not available
    ORA-27101 : Shared memory realm does not exist
    please give me idea
    thanking you
    Amir

    I presume you are using Windows, so in Control Panel -> Services, start the Oracle service, and also start the instance, if not started.

  • Query output similar to sql plus results

    Is it possible to configure SQLDeveloper to output the query result similar to sql plus ?
    I want to print the field names of the sql input, something as:
    OWD_ID     seconds   policies/s     COUNT(OWD_ID)     MIN(OWE_PRC_DT)     MAX(OWE_PRC_DT)   
    5174           872       17             14892                 06/11/2009 12:53:31  06/11/2009 13:08:03 Thanks
    Claudio
    Edited by: Claudio Miranda on Nov 10, 2009 11:49 AM
    Edited by: Claudio Miranda on Nov 10, 2009 11:51 AM

    Claudio Miranda wrote:
    Is it possible to configure SQLDeveloper to output the query result similar to sql plus ?
    I want to print the field names of the sql input, something as:
    OWD_ID     seconds   policies/s     COUNT(OWD_ID)     MIN(OWE_PRC_DT)     MAX(OWE_PRC_DT)   
    5174           872       17             14892                 06/11/2009 12:53:31  06/11/2009 13:08:03 Thanks
    Claudio
    As far as I know, no :(

  • SQL Plus not working in Oracle 8i personal edition

    I just installed Oracle 8i personal edition, went through all the steps. When I start SQL* Plus, I give it the SCOTT/TIGER combo, but when it tries to start up the database, it asks for another password, which I can't figurew out.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Meyer ([email protected]):
    I just installed Oracle 8i personal edition, went through all the steps. When I start SQL* Plus, I give it the SCOTT/TIGER combo, but when it tries to start up the database, it asks for another password, which I can't figurew out.<HR></BLOCKQUOTE>
    Fixed the problem yesterday.
    null

  • Oracle:JDBC Call returns no results, SQL*Plus returns 1 record, Please help

    Any help would be greatly appreciated.
    Running 9.2.0.5.0, and using latest 9.2 JDBC 1.4_g drivers in thin mode.
    Execute the following query from SQL*Plus and it returns one row, from JDBC using a PreparedStatement, I get no results. Here's the query, table def, record, etc.:
    Query:
    SELECT
    ID_WEB_FRM,ID_WEB_SIT,CDE_LVL_1_FUNC,
    CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID
    FROM
    WEB_FRM
    WHERE
    ID_WEB_FRM = ' '
    OR
    (ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' '
    AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1
    AND NUM_WEB_PG_ID = 0)
    Record returned from SQL*Plus:
    ID_WEB_FRM ID_WEB_SIT CDE CDE NUM_WEB_FUNC_PG NUM_WEB_PG_ID
    NfRRmc5XZu test u2T 1 0
    Both in the data returned and the query, there are no blanks, but they are a single space instead (hard to see in message here).
    Java code:
    int count = 1;
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++,form.getSiteID());
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++, form.getFunctionID());
    findDBNameStatement.setInt(count++,form.getPageNumber());
    findDBNameStatement.setInt(count++,form.getSectionNumber());
    ResultSet resultSet = findDBNameStatement.executeQuery();
    ResultSetMetaData metaData = resultSet.getMetaData();
    resultSet.next() returns false
    DB table:
    CREATE TABLE web_frm (
    ID_WEB_FRM varchar2(10) NOT NULL,
    ID_WEB_SIT varchar2(20) NOT NULL,
    NAM_WEB_FRM varchar2(40),
    TXT_EMAIL_SUBJ varchar2(50),
    CDE_LVL_1_FUNC char(3),
    CDE_LVL_2_FUNC char(3) NOT NULL,
    NUM_WEB_FUNC_PG int NOT NULL,
    NUM_WEB_PG_ID smallint NOT NULL,
    DTE_WEB_FRM_EFF date NOT NULL,
    DTE_WEB_FRM_TRM date,
    CDE_VLDT_RUL char(3),
    DTE_LAST_EXPRT date,
    TXT_CNFRMN_MSG varchar2(4000),
    IND_UPDT_ALWD char(1) NOT NULL,
    TXT_RECAP_HDR varchar2(4000),
    TXT_RECAP_FTR varchar2(4000),
    CDE_WEB_OBJ char(3),
    NUM_MAX_FRM_WIDTH number(4,0),
    IND_RECAP_PG char(1) NOT NULL,
    IND_CNFRM_PG char(1) NOT NULL,
    IND_DSPL_CNFRM_NUM char(1) NOT NULL,
    CNT_SUBM_MAX int,
    TXT_CHCE_ADD_MSG varchar2(255),
    TXT_CHCE_MOD_MSG varchar2(255),
    TXT_WEB_HDR varchar2(4000),
    TXT_WEB_FTR varchar2(4000),
    TXT_WAIT_LIST_MSG varchar2(255),
    FORMOBJECTHEIGHT int NOT NULL,
    FORMOBJECTWIDTH int NOT NULL
    ALTER TABLE web_frm ADD ( CONSTRAINT PK_web_frm PRIMARY KEY (ID_WEB_FRM));
    ALTER TABLE web_frm ADD ( CONSTRAINT UK_web_frm UNIQUE (ID_WEB_SIT,CDE_LVL_1_FUNC,CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID)) ;
    Thanks,
    Matt

    That's not quite right. From the javadocs:
    next
    public boolean next()
    throws SQLException
    Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.
    If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.
    Returns:
    true if the new current row is valid; false if there are no more rows
    Throws:
    SQLException - if a database access error occurs

  • JDBC Call returns no results, SQL*Plus returns 1 record, Please help!

    Any help would be greatly appreciated.
    Running 9.2.0.5.0, and using latest 9.2 JDBC 1.4_g drivers in thin mode.
    Execute the following query from SQL*Plus and it returns one row, from JDBC using a PreparedStatement, I get no results. Here's the query, table def, record, etc.:
    Query:
    SELECT
    ID_WEB_FRM,ID_WEB_SIT,CDE_LVL_1_FUNC,
    CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID
    FROM
    WEB_FRM
    WHERE
    ID_WEB_FRM = ' '
    OR
    (ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' '
    AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1
    AND NUM_WEB_PG_ID = 0)
    Record returned from SQL*Plus:
    ID_WEB_FRM ID_WEB_SIT CDE CDE NUM_WEB_FUNC_PG NUM_WEB_PG_ID
    NfRRmc5XZu test u2T 1 0
    Both in the data returned and the query, there are no blanks, but they are a single space instead (hard to see in message here).
    Java code:
    int count = 1;
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++,form.getSiteID());
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++, form.getFunctionID());
    findDBNameStatement.setInt(count++,form.getPageNumber());
    findDBNameStatement.setInt(count++,form.getSectionNumber());
    ResultSet resultSet = findDBNameStatement.executeQuery();
    ResultSetMetaData metaData = resultSet.getMetaData();
    resultSet.next() returns false
    DB table:
    CREATE TABLE web_frm (
    ID_WEB_FRM varchar2(10) NOT NULL,
    ID_WEB_SIT varchar2(20) NOT NULL,
    NAM_WEB_FRM varchar2(40),
    TXT_EMAIL_SUBJ varchar2(50),
    CDE_LVL_1_FUNC char(3),
    CDE_LVL_2_FUNC char(3) NOT NULL,
    NUM_WEB_FUNC_PG int NOT NULL,
    NUM_WEB_PG_ID smallint NOT NULL,
    DTE_WEB_FRM_EFF date NOT NULL,
    DTE_WEB_FRM_TRM date,
    CDE_VLDT_RUL char(3),
    DTE_LAST_EXPRT date,
    TXT_CNFRMN_MSG varchar2(4000),
    IND_UPDT_ALWD char(1) NOT NULL,
    TXT_RECAP_HDR varchar2(4000),
    TXT_RECAP_FTR varchar2(4000),
    CDE_WEB_OBJ char(3),
    NUM_MAX_FRM_WIDTH number(4,0),
    IND_RECAP_PG char(1) NOT NULL,
    IND_CNFRM_PG char(1) NOT NULL,
    IND_DSPL_CNFRM_NUM char(1) NOT NULL,
    CNT_SUBM_MAX int,
    TXT_CHCE_ADD_MSG varchar2(255),
    TXT_CHCE_MOD_MSG varchar2(255),
    TXT_WEB_HDR varchar2(4000),
    TXT_WEB_FTR varchar2(4000),
    TXT_WAIT_LIST_MSG varchar2(255),
    FORMOBJECTHEIGHT int NOT NULL,
    FORMOBJECTWIDTH int NOT NULL
    ALTER TABLE web_frm ADD ( CONSTRAINT PK_web_frm PRIMARY KEY (ID_WEB_FRM));
    ALTER TABLE web_frm ADD ( CONSTRAINT UK_web_frm UNIQUE (ID_WEB_SIT,CDE_LVL_1_FUNC,CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID)) ;
    Thanks,
    Matt

    I have verified the parameters and such, and if I run as a Statement instead of a PreparedStatement, the query works fine. After some more troubleshooting, I narrowed the problem down, but not sure of the fix.
    If I eliminate teh extra parameters and simplify things to:
    SELECT ID_WEB_FRM FROM WEB_FRM WHERE ID_WEB_SIT = 'test' AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1 AND NUM_WEB_PG_ID = 0
    The code works. But if I add the additional WHERE clause of CDE_LVL_1_FUNC = ' ' (has single space), it returns no data (record in the DB has single space in this new column. Query that does not work:
    SELECT ID_WEB_FRM FROM WEB_FRM WHERE ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' ' AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1 AND NUM_WEB_PG_ID = 0
    It appears the JDBC Driver is trimming the parameter when it is a space when set through a PreparedStatement.setString(2," ")

  • SQL*plus not displaying the result of XMLELEMENT

    HI,
    I am using SQL*Plus: Release 10.1.0.4.2
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    When I run the following query in SQL*PLUS, I get nothing displayed. However when I run the same query connecting to the same database using SQL Developer then I get the result
    SQL> select XMLELEMENT("form_id",form_id)
    2 FROM collections;
    XMLELEMENT("FORM_ID",FORM_ID)
    In SQL developer
    <form_id>101</form_id>
    I set long and longchuncksize to 32K , and I change linesize, pages, but nothing helped
    Is there any configuration that I have to do, so that SQL*plus display the result of “ select XMLELEMENT("form_id",form_id) query.
    Appreciate you help, thanks

    From a fresh start ;) :
    SQL*Plus: Release 10.1.0.4.2 - Production on Fri Feb 26 15:29:04 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select xmlelement("value", a.object_name )
      2  from   all_objects a
      3  where  rownum <= 5;
    XMLELEMENT("VALUE",A.OBJECT_NAME)
    SQL> select xmlelement("value", (select b.object_name
      2                              from   all_objects b
      3                              where b.object_name = a.object_name
      4                              )
      5                   )
      6  from   all_objects a
      7  where  rownum <= 5;
    XMLELEMENT("VALUE",(SELECTB.OBJECT_NAMEFROMALL_OBJECTSBWHEREB.OBJECT_NAME=A.OBJE
    <value>ICOL$</value>
    <value>I_USER1</value>
    <value>CON$</value>
    <value>UNDO$</value>
    <value>C_COBJ#</value>
    SQL> show all
    appinfo is OFF and set to "SQL*Plus"
    arraysize 15
    autocommit OFF
    autoprint OFF
    autorecovery OFF
    autotrace OFF
    blockterminator "." (hex 2e)
    btitle OFF and is the first few characters of the next SELECT statement
    cmdsep OFF
    colsep " "
    compatibility version NATIVE
    concat "." (hex 2e)
    copycommit 0
    COPYTYPECHECK is ON
    define "&" (hex 26)
    describe DEPTH 1 LINENUM OFF INDENT ON
    echo OFF
    editfile "afiedt.buf"
    embedded OFF
    escape OFF
    FEEDBACK ON for 6 or more rows
    flagger OFF
    flush ON
    heading ON
    headsep "|" (hex 7c)
    instance "local"
    linesize 80
    lno 9
    loboffset 1
    logsource ""
    long 80
    longchunksize 80
    markup HTML OFF HEAD "<style type='text/css'> body {font:10pt Arial,Helvetica,sans-serif; color:blac
    newpage 1
    null ""
    numformat ""
    numwidth 10
    pagesize 14
    PAUSE is OFF
    pno 1
    recsep WRAP
    recsepchar " " (hex 20)
    release 1002000300
    repfooter OFF and is NULL
    repheader OFF and is NULL
    serveroutput OFF
    shiftinout INVISIBLE
    showmode OFF
    spool OFF
    sqlblanklines OFF
    sqlcase MIXED
    sqlcode 0
    sqlcontinue "> "
    sqlnumber ON
    sqlpluscompatibility 10.1.0
    sqlprefix "#" (hex 23)
    sqlprompt "SQL> "
    sqlterminator ";" (hex 3b)
    suffix "sql"
    tab ON
    termout ON
    timing OFF
    trimout ON
    trimspool OFF
    ttitle OFF and is the first few characters of the next SELECT statement
    underline "-" (hex 2d)
    USER is "HR"
    verify ON
    wrap : lines will be wrapped
    SQL>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Numbering query results with a line number in SQL*Plus

    Doesn't it stand to reason that in SQL*Plus there would be a way to number each query results sequentially with line numbers starting at 1 to n -- something option like from a SET command? I'm not talking about linesize.

    There's a column rownum the engine adds into the result sets, just add it to the select list. Can use it to limit the result set (with some limitations) i.e.:
    select rownum, ... from ... where rownum <= 100
    Can't use ">=", that condition will never be met but a subset could be used:
    select * from ( select rownum as linenr, tab1.* from ... ) where linenr between 10 and 20

  • Please give the query to find out primary key in table in Sql plus

    Dear friends,
    Please give me the query to find out the primary key in Sql plus.

    hi
    SQL> DESC user_constraints
    Name                                                                                                  
    OWNER                                                                                                 
    CONSTRAINT_NAME                                                                                       
    CONSTRAINT_TYPE                                                                                       
    TABLE_NAME                                                                                            
    SEARCH_CONDITION                                                                                      
    R_OWNER                                                                                               
    R_CONSTRAINT_NAME                                                                                     
    DELETE_RULE                                                                                           
    STATUS                                                                                                
    DEFERRABLE                                                                                            
    DEFERRED                                                                                              
    VALIDATED                                                                                             
    GENERATED                                                                                             
    BAD                                                                                                   
    RELY                                                                                                  
    LAST_CHANGE                                                                                           
    INDEX_OWNER                                                                                           
    INDEX_NAME                                                                                            
    INVALID                                                                                               
    VIEW_RELATED                                                                                          
    SQL> SELECT constraint_name,table_name,r_constraint_name,status
      2  FROM user_constraints WHERE constraint_type='P';
    CONSTRAINT_NAME                TABLE_NAME                     R_CONSTRAINT_NAME              STATUS
    SYS_C003141                    CUSTOMERS                                                     ENABLED
    PK_DEPT                        DEPT                                                          ENABLED
    SYS_C003139                    SALESREPS                                                     ENABLEDKhurram

  • SQL*PLUS WINDOW DOESNT GIVE AN ERROR MESSAGE.

    HI,
    i FOUND OUT THAT IF I HAD AN ERROR IN MY SQL SCRIPT, THE WINDOW WILL DISAPPEAR AND LOST EVERYTHING THAT I HAVE DONE. IT DOESNT GIVE ME AN ERROR MESSAGE. IM HERE IN CHAP05, BUILDING A RELATIONAL SCHEMA OF ORACLE DATABASE 10G EXPRESS EDITION FOR LINUX. WHAT PARAMETER AM I MISSING IN MY SYSTEM? PLS. HELP ME. THANKS.
    LEN

    Hi,
    Most likely you have to adjust WHENEVER SQLERROR and (or) WHENEVER OSERROR settings.
    Consider an example below:
    C:\> sqlplus /NOLOG
    SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 1 02:55:29 2006
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL> conn max
    Enter password:
    Connected.
    SQL>
    SQL> whenever sqlerror continue
    SQL>
    SQL> exec raise_application_error(-20000, 'Error')
    BEGIN raise_application_error(-20000, 'Error'); END;
    ERROR at line 1:
    ORA-20000: Error
    ORA-06512: at line 1
    SQL> whenever sqlerror exit
    SQL>
    SQL> exec raise_application_error(-20000, 'Error')
    BEGIN raise_application_error(-20000, 'Error'); END;
    ERROR at line 1:
    ORA-20000: Error
    ORA-06512: at line 1
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    C:\>As you can see, with WHENEVER SQLERROR set to EXIT, SQL*Plus session terminates as it encounters any program error.
    Similarly, for OSERROR setting:
    C:\> sqlplus /NOLOG
    SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 1 02:57:08 2006
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL> conn max
    Enter password:
    Connected.
    SQL>
    SQL> start C:\non_existent_file
    SP2-0310: unable to open file "C:\non_existent_file.sql"
    SQL>
    SQL> whenever oserror exit
    SQL>
    SQL> start C:\non_existent_file
    O/S Message: No such file or directory
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    C:\>Hope this helps.

  • Why does SQL*Plus split query result?

    My result is:
    ENAME DEPTNO SAL RUNNING_TOTAL DEPARTMENT_TOTAL SEQ
    CLARK 10 2450 2450 2450 1
    KING 10 5000 7450 7450 2
    MILLER 10 1300 8750 8750 3
    ADAMS 20 1100 9850 1100 1
    FORD 20 3000 12850 4100 2
    JONES 20 2975 15825 7075 3
    SCOTT 20 3000 18825 10075 4
    SMITH 20 800 19625 10875 5
    ALLEN 30 1600 21225 1600 1
    BLAKE 30 2850 24075 4450 2
    JAMES 30 950 25025 5400 3
    ENAME DEPTNO SAL RUNNING_TOTAL DEPARTMENT_TOTAL SEQ
    MARTIN 30 1250 26275 6650 4
    TURNER 30 1500 27775 8150 5
    WARD 30 1250 29025 9400 6
    14 rows selected.
    It is very annoying and I wonder if there is a way to tell SQL*Plus not to split this result into 2 sub-results.

    user8931607 wrote:
    It is very annoying and I wonder if there is a way to tell SQL*Plus not to split this result into 2 sub-results.Well, then you should RTFM. Discover SQL*Plus PAGESIZE property:
    SQL> select ename from emp
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> set pagesize 100
    SQL> select ename from emp
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> SY.

  • Explain plan results are different in SQL Developer than SQL Plus

    My Environment:
    SQL Developer 1.0.0.15.27
    Platform where SQL Developer is running: Windows XP 2002 SP2
    Oracle Database and Client 9.2.0.7
    Optimizer_mode: FIRST_ROWS
    I have the following SQL statement:
    SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE :b2 = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > :b1
    When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
    SELECT STATEMENT                          TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY          NESTED LOOPS                                   INDEX(RANGE SCAN)
    FEDLINK.UX2_TEMP_AU_COMPANY
              INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
    However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 3.58 6.68 28136 29232 0 0
    total 3 3.58 6.69 28136 29232 0 0
    Misses in library cache during parse: 1
    Optimizer goal: FIRST_ROWS
    Parsing user id: 979 (FEDLINK) (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS
    0 TABLE ACCESS FULL AU_COMPANY
    0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
    Notice the FULL access of au_company.
    I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
    Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
    explain plan for SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE '1' = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > '01-MAY-2006';
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
    | 1 | NESTED LOOPS | | 2 | 76 | 2597 |
    | 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
    | 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
    Thanks,
    Brenda

    The explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
    SQL> variable b1 varchar2
    SQL> variable b2 char
    SQL> explain plan for SELECT a1.comp_id
    2 FROM temp_au_company a0, au_company a1
    3 WHERE :b2 = a0.temp_emp_code
    4 AND a0.comp_id = a1.comp_id
    5 AND a0.sls_terr_code != a1.sls_terr_code
    6 AND a1.last_mdfy_date > :b1
    7 /
    Explained.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
    | 1 | HASH JOIN | | 3184 | 118K| 2995 |
    | 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
    | 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
    Any other ideas? They should be the same.
    Brenda

  • Give SQL*PLUS "password" privilege (to change other's password) to a security role

    Hi,
    If you have DBA privileges on a database, you can also use "password" from SQL*Plus to change another user's password. (When changing another users password, you are not prompted for the users old password.) I would like to grant this function only to a security role rather than to the DBA role.
    Please let me know how to set it up.
    Thanks,
    Seizen

    Hi,
    If you have DBA privileges on a database, you can also use "password" from SQL*Plus to change another user's password. (When changing another users password, you are not prompted for the users old password.) I would like to grant this function only to a security role rather than to the DBA role.
    Please let me know how to set it up.
    Thanks,
    Seizen

  • XSQL results differ from SQL Plus

    Hello,
    I have a view table that contains a CAST(MULTISET( statement. Does anyone know the restrictions placed on this statement? If I copy out the 'select' portion of my view table and paste it into SQL Plus, it works every time without problems. However, if I call my XSQL file from within my browser, I get the following:
    <?xml version="1.0" ?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: java.lang.NegativeArraySizeException</ERROR>
    Or, it will display most of the data, but leave out some. I don't understand why it returns some of the data but leaves out other relevant data. Following are portions of my scripts:
    create or replace type exp_descriptive_t as object (
    room_id number(10),
    attribute_id number(10),
    description VARCHAR2(50),
    quantity number(5),
    name VARCHAR2(50)
    create or replace type exp_descriptive_list as table of exp_descriptive_t;
    create or replace type exp_property_t as object (
    P_ID NUMBER(10),
    .(other columns)
    descriptives exp_descriptive_list);
    CREATE OR REPLACE VIEW Exp_Property_View of exp_property_t
    with object OID (p_id)
    AS SELECT
    P_ID,
    (other columns here),
    cast(multiset(select p_attributes.room_id, p_attributes.ATTRIBUTE_ID,a_list.description, p_attributes.quantity, r_list.name
    FROM p_attributes, a_list, r_list WHERE p_attributes.p_id = prop.p_id and p_attributes.attribute_id = a_list.attribute_id and p_attributes.room_id = r_list.room_id )as exp_descriptive_list) descriptives,
    FROM prop
    null

    When stuff like that happens to me it's usually because CF
    and QA are pointing to different databases.

  • How to get th displaye record count through SQL*Plus without result

    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);how to get the record count without resultset display in the sql*plus promt ...?
    plz help me....

    This is my earilier code
    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);
    Then i have tried to execute like this
    declare
    disp SYS_REFCURSOR;
    cv SYS_REFCURSOR;
    cnt number :=0;
    begin
    proc_name (input1, input2, :cv);
    FOR disp in cv --here cv is the set of record set
    LOOP
    --FETCH cv INTO disp;
    EXIT WHEN cv%NOTFOUND;
    cnt := cnt + 1;
    END LOOP;
    dbms_output.put_line(cnt);
    dbms_output.put_line(cv%rowcount);
    CLOSE cv;
    end;
    getting error...
    LOOP
    ERROR at line 8:
    ORA-06550: line 8, column 2:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    . ( % ; for
    The symbol "; was inserted before "LOOP" to continue.
    ORA-06550: line 13, column 2:
    PLS-00103: Encountered the symbol "DBMS_OUTPUT"
    ORA-06550: line 13, column 27:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , * % & - + / at mod rem <an identifier>
    <a double-quoted delimited-identifier> <an exponent (**)> as
    from into || bulk
    I have set of executable procedure script for exec procedure1(input1, input2 :cv); , exec procedure1(input1, input2 :cv);,.... like that. But i want only the record count, while we execute all these scripts in the sql promt...How to do that one.. ?

Maybe you are looking for

  • Loading content from XML help needed, please.

    Hey All, So here's my deal- I have a custom-built FLV Playback component (with captions) and need to load the following items from an XML file named "xml_doc.xml": <?xml version="1.0" encoding="UTF-8"?> <playlist id="Here's The Video" > <vid desc="In

  • Javascript function to determine value in textbox

    This should have been a realtively easy function to write.. but it seems as if there should be a quicker way to do part of it... can anyone give me a hand. I have a text box the the user enters a code representing the page they want to go to. Dependi

  • Configuring v120 as a router

    Hello all I'm trying to configure a v120 (sol8) as router. The exact setup is: 2900 switch | | eri0 eri1 ----------------------> eri0 (node2 v120 sol8) (node1 v120 sol8) so node1 eri0 connects to switch, eri1 connects to eri0 node2. from node 1: I ca

  • How relevant is Java Applet technology in 2006 for wide web deployment?

    How relevant is Java Applet technology in 2006 for wide web deployment? I'm developing a website which requires deployment Internationally to as many users as possible. Many people advise to stay away from Java applets, others say only use Java 1.1 (

  • IPhone WILL NOT SHOW when I have a text... PLease HELP! :(

    Okay so my Iphone 4 will not let me know when I have a text. It is not on silent and it is not on Do Not Disturb mode. Even if I am on the phone when the person texts me back it doesn't let me know. I have to open Messages and check to see. I just go