Oracle SQL command

I have read this statement on these forums many times:
Just keep 1 thin in mind... CR will send any SQL statement, exactly as it is written, to the database. That means that if you can execute it from TOAD or the Oracle SQL Developer, you should be able to do it from CR as well.
I have an SQL command that I have simplified so that it contains just a snippet from the original that populates a temporary table.
Since there is a DECLARE there must be a BEGIN and END.  The required SELECT * to get the fields to show up in the field explorer will not work before the END statement.  If I put it after the END statement I get an ORA-06550 error.  "FOUND SELECT WHEN EXPECTING..." .   I got on the ORACLE website and they told me to put / before and after the SELECT.  When I try this in CR SQL command, I get ORA-06550 "ENCOUNTERED /".
I have tried this in SQL Plus and don't get any errors.
DECLARE Pallet  VARCHAR2(8);
        Box     VARCHAR2(8);
        ItemBox VARCHAR2(8);
        CODE    VARCHAR2(6);
BEGIN   
    CODE := '20151';
    CODE := CONCAT(CODE, '%');
    DELETE LoadItems_temp;
   COMMIT;
END;
SELECT * FROM LOADITEMS_TEMP;

Just keep 1 thin in mind... CR will send any SQL statement, exactly as it is written, to the database. That means that if you can execute it from TOAD or the Oracle SQL Developer, you should be able to do it from CR as well.
Sounds like that may have come from me...
99% of my reporting is done using SQL Server as a back end so I can't say if the rules change when using Oracle any of the Oracle drivers.
That said, I can create and drop temp tables as well as declare and set variables without any issues in SQL Server... And do so regularly.
Looking at your code... (and bear in mind that I don't know PL-SQL specific syntax...) I don't see where you are creating the temp table LoadItems_temp.
I did a quick Google search on ORA-06550 and it appears to be syntax error. So if the code is executing in SQL-Plus without any issues but bombs in CR, my guess would be that you aren't using the right driver for your database.
HTH,
Jason

Similar Messages

  • Oracle sql commands use

    my question is will it possible to use oracle sql commands in toad and genterate the reprot like I have below.
    my second question is can I embede this oralc sql command in my apps. to have the out put I have below. I tried and got an error message. I am wondering if this is possible
    SQL> -- Multiple COMPUTEs are also allowable.
    SQL>
    SQL> SET echo off
    SQL> BREAK ON city skip1 ON start_date
    SQL> COMPUTE sum max min of salary ON city
    SQL> COMPUTE sum of salary ON start_date
    SQL> SET verify off
    SQL> SELECT id, first_name, salary, city FROM employee ORDER BY city
      2  /
    ID   FIRST_NAME     SALARY CITY
    07   David         7897.78 New York
    06   Linda         4322.78
                       4322.78 minimum
                       7897.78 maximum
                      12220.56 sum
    01   Jason         1234.56 Toronto
                       1234.56 minimum
                       1234.56 maximum
                       1234.56 sum
    05   Robert        2334.78 Vancouver
    08   James         1232.78
    03   James         6544.78
    02   Alison        6661.78
    04   Celia         2344.78
                       1232.78 minimum
                       6661.78 maximum
                       19118.9 sum

    Hi,
    All of theose SQL*Plus features can be duplicated in Oracle SQL. For example, "GROUP BY ... ROLLUP" can give you an minimum, maximum and total for each city.
    You can create a view that looks exactly like the SQL*Plus output (for example, the city column with values like 'New York', NULL, '**********', and 'minimum'), if you really need to. CASE is very useful for things like this, as are some analytic functions. (E.g., ROW_NUMBER can help in telling which is the first row for each city.)
    To make such a view, you may find it convenient to do a UNION of two queries:
    (1) One that produces one row per employee
    (2) One that produces a fixed number of rows (four, to get the results you posted) per city

  • Convert IIF Access SQL to Oracle SQL...

    I am in the process of converting a MS Access application to VB.Net with Oracle database behind. However I am having a problem converting an MS Access Query that contains IIF statements into an Oracle SQL command. Below is the MS Access SQL code:
    SELECT PDTABLE_132.UNIQUE_CLASH_ID, CISClashStatusTbl.Approval_Type AS Clash_Status, CISClashTypeTbl.Clash_Type, *IIf([TEMP_ACTION_DISCIPLINE] Is Null,"UNALOCATED",[TEMP_ACTION_DISCIPLINE]) AS ACTION_DISCIPLINE*, *IIf([CISDisciplineTbl].[Discipline] Is Null,[PD_2910A_PDTABLE_111].[DISCIPLINE_NAME],[CISDisciplineTbl].[Discipline]) AS TEMP_ACTION_DISCIPLINE*
    FROM ((((((((((((PDTABLE_132 INNER JOIN PD_2910A_PDTABLE_113 ON PDTABLE_132.MODEL_INDEX_NO_A = PD_2910A_PDTABLE_113.MODEL_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_113 AS PD_2910A_PDTABLE_113_1 ON PDTABLE_132.MODEL_INDEX_NO_B = PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 ON PD_2910A_PDTABLE_113.MODEL_INDEX_NO = PDTABLE_119.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 AS PDTABLE_119_1 ON PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO = PDTABLE_119_1.MODEL_INDEX_NO) LEFT JOIN CISClashStatusTbl ON PDTABLE_132.IF_APPROVAL_STATUS = CISClashStatusTbl.Approval_Code) LEFT JOIN CISClashTypeTbl ON PDTABLE_132.RECENT_CLASH_TYPE = CISClashTypeTbl.Clash_Code) INNER JOIN PD_2910A_PDTABLE_112 ON PD_2910A_PDTABLE_113.AREA_INDEX_NO = PD_2910A_PDTABLE_112.AREA_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_112 AS PD_2910A_PDTABLE_112_1 ON PD_2910A_PDTABLE_113_1.AREA_INDEX_NO = PD_2910A_PDTABLE_112_1.AREA_INDEX_NO) LEFT JOIN CISOwnerTbl ON PDTABLE_132.UNIQUE_CLASH_ID = CISOwnerTbl.UNIQUE_CLASH_ID) LEFT JOIN CISDisciplineTbl ON CISOwnerTbl.Discipline_Code = CISDisciplineTbl.Discipline_Code) LEFT JOIN PD_2910A_PDTABLE_111 ON PDTABLE_132.ACTION_DISCIPLINE = PD_2910A_PDTABLE_111.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_1 ON PDTABLE_132.DISCIPLINE_INDEX_A = PD_2910A_PDTABLE_111_1.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_2 ON PDTABLE_132.DISCIPLINE_INDEX_B = PD_2910A_PDTABLE_111_2.DISCIPLINE_INDX_NO
    ORDER BY PDTABLE_132.UNIQUE_CLASH_ID;
    Any help would really be appreshiated.
    Thanks in advance
    Simon
    Edited by: user8275408 on 21-Jan-2010 07:25

    Hi, Simon,
    Welcome to the forum!
    An Oracle equivalent of
    IIf(TEMP_ACTION_DISCIPLINE Is Null,"UNALOCATED",TEMP_ACTION_DISCIPLINE) AS ACTION_DISCIPLINEis
    CASE
         WHEN  TEMP_ACTION_DISCIPLINE Is Null
         THEN  'UNALOCATED'
         ELSE  TEMP_ACTION_DISCIPLINE
    END          AS ACTION_DISCIPLINE, This assumes that temp_action_discipline is a string. (All THEN and ELSE clauses must return the same data type, or at least compatable types.)
    CASE is the most general way of doing IF-THE-ELSE logic in Oracle SQL.
    For certain special situations, there may be shorter ways.
    Testing a variable to see whether it is NULL or not is one of those situations, so you could also say
    NVL2 ( TEMP_ACTION_DISCIPLINE
         , TEMP_ACTION_DISCIPLINE
         , 'UNALOCATED'
    This site noramally compresses whitespace. Whenever you post formatted text here (and code should always be formatted), type these 6 characters:
    (all small letters, inside curly brackets) before and after formatted sections.
    Edited by: Frank Kulash on Jan 21, 2010 10:41 AM
    After reading Bluefrog's answer, I realized that you're testing and possibly returning the same thing, temp_action_discipline.
    In that case, NVL, like Bluefrog suggested, is the best thing to do.  CASE and NVL2, as shown above, will give the right results, but they're more complicated than you need for this job.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to execute command(program) from external file in Oracle SQL developer

    Hi,
    Does anyone know, Oracle SQL developer version 1.0.0.14.67 got any function that can execute command from an external file?
    Example, i have 100 insert SQL inside a text file,
    and i want to use Oracle SQL developer to execute it. How do i read from my text file? Thanks a lots.

    If you're new to Oracle, do yourself and us a favour: read some tutorials and manuals. What sqldev's worth, better download the latest version (1.1.2), lots of fixes and enhancements...
    Now for the big popper: to run an external file: @file
    Best of luck,
    K.

  • Howto: multiple sql-commands in oracle-xe

    Hi,
    just installed the oracle-xe. Now I want to create tables, indexes etc within the sql-command tool.
    For example:
    CREATE TABLE ZUSTAENDIGKEIT (
         INSTITUTION_ID      VARCHAR2(30) NOT NULL,
         FUNKTION_ID      NUMBER(4) NOT NULL,
         LIEGENSCHAFT_ID      VARCHAR2(30) NOT NULL);
    CREATE UNIQUE INDEX UX_ZUSTAENDIGKEIT
         ON ZUSTAENDIGKEIT (LIEGENSCHAFT_ID,FUNKTION_ID)
    Executing this as one command I receive an error ora-00911.
    Executing this in two parts it works?
    Thanks for any help.
    grassu

    Here is just a sample that should work as a script in the web interface:
    -- BVM
    -- Benoetigte Sequence numbers
    -- Globale Sequence
    DROP SEQUENCE bvm_seq;
    CREATE SEQUENCE bvm_seq
           MINVALUE         1
           MAXVALUE         999999999
           INCREMENT BY     1
           START WITH       1
           CACHE            20
           NOORDER
           NOCYCLE
    -- Log Sequence
    CREATE SEQUENCE BVM_LOG_SEQ 
           MINVALUE         1
           MAXVALUE         999999999
           INCREMENT BY     1
           START WITH       1
           CACHE            20
           NOORDER
           NOCYCLE
    ;Note: no "/" (you need these only after trigger, procedures, etc.)
    You need to execute this in the script section, not in the command section of the web interface.
    C.

  • How to get the correct sql command in oracle?

    Hi sir,
    i am using this query in sql that is :
    SELECT C.*,ISNULL(P.Comp_Name,'') + ' (' + ISNULL(P.Comp_ID,'') + ')' Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID Where C.Comp_ID='004'
    so i am getting in parent column value like this: "PARIS GROUP (001)"
    but the same command i converted in sql developer that is:
    SELECT C.* ,NVL(P.Comp_Name, ' ') || ' (' || NVL(P.Comp_ID, ' ') || ')' as Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID WHERE C.Comp_ID ='004'
    but not getting in parent column value its coming only ( )
    help me.
    thanks

    Welcome to Oracle.
    It has manuals.
    http://tahiti.oracle.com/
    Choose your version, which you continue to keep a mystery
    E.g.
    http://www.oracle.com/pls/db112/homepage
    Including Oracle SQL syntax
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
    Which you will find useful since Oracle does not run Microsoft SQL as you continue to find over and over again.
    And there is a 2 day getting started as a developer guide, which you appear to desperately need,
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm
    If you have any specific questions about anything you read in there, come back in a couple of days after you have finished reading them.

  • UTL_HTTP, different error codes: APEX SQL Commands vs. Oracle SQL Developer

    Hi, omniscient all!
    I have a code sample where I try to request some URL from an inactive server:
    declare
      l_text varchar2(32000);
    begin
      l_text := utl_http.request('http://inactive.url:7777');
    exception
      when others then
        declare
          l_errcode number := utl_http.get_detailed_sqlcode;
        begin
          dbms_output.put_line(l_errcode);
          dbms_output.put_line(sqlerrm(l_errcode));
        end;
    end;
    /When I run it in Oracle SQL Developer it shows:
    anonymous block completed
    -12541
    ORA-12541: TNS:no listenerWhen I run it in the APEX 4.0 SQL Commands window it shows:
    -29263
    ORA-29263: HTTP protocol error
    Statement processed.The question is: why?
    In real world, I need to make a HTTP POST request (no problem) and catch some exceptions. But instead of the usual ORA-12541 error APEX throws an ORA-29261 one.

    Any thoughts?

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • How execute pl/sql command from Oracle ADF Business Components

    can't find examples for how execute pl/sql command from Oracle ADF Business Components and how call pl/sql package procedure from ADF Business Components.
    insert,update,delete rows in view object instance cache is good but if i must do some complex operations while insert,update,delete rows..it's more better for me to call
    pl/sql procedure from oracle db.Am i wrong ????

    Roman,
    this should be similar to how it worked in JDeveloper 9.0.3. hava a look at <JDev903 Home>\BC4J\samples\StoredProc for a code example.
    Frank

  • Oracle Express 10g - a way to terminate in SQL Command Line interface

    I've downloaded Oracle Express 10g and use the SQL Command Line interface to execute SQL*Plus -- a really simple window / interface without hardly any smarts. In other Oracle installations' SQL*Plus, I'm used to be able to do a Ctrl C to terminate the current SQL that's being executed and the session is still active and I can keep using it. But with the Oracle Express 10g SQL Command Line interface, when I do a Ctrl C the currrent SQL is terminated -- but so is the whole dang session and the window goes away too. There must be a way in the Oracle Express 10g SQL Command Line interface to simply terminate th current SQL results without losing the whole dang session!!! This is so incredibly frustrating it's not even funny. HELP!!!!

    I think your answer is in this thread:
    Re: stopping a query
    Regards, Marc

  • Tell me the COMMAND to see the Explain Plain in Oracle SQL * Plus

    HI all,
    Tell me the COMMAND to see the Explain Plain in Oracle SQL * Plus?
    Regards,
    Balaji.C

    SET AUTOT TRACE EXPor EXPLAIN PLAN ... and @?/rdbms/admin/utlxpls
    SCOTT@lsc01> explain plan for select * from dept where deptno=10;
    Explained.
    SCOTT@lsc01> @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 2852011669
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     1 |    20 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| DEPT    |     1 |    20 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | PK_DEPT |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("DEPTNO"=10)

  • Sql command example in oracle 9

    Hi,
    I want to use oracle 9
    select * from tab .
    And use the output to issue "desc XXX " for every row of output in select statement...
    How can I do it automatically ???
    Any example ???

    You cannot issue sql commands in plsql. Try this way:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  cursor c1 is select * from all_tab_Cols where table_name = 'ALL_OBJECTS';
      3  BEGIN
      4  FOR I IN C1 LOOP
      5  DBMS_OUTPUT.PUT_LINE(I.table_name||' : '||I.column_name||' '||I.data_type||'('||I.data_length||
      6  END LOOP;
      7* END;
    SQL> set serveroutput on
    SQL> /
    ALL_OBJECTS : OWNER VARCHAR2(30)
    ALL_OBJECTS : OBJECT_NAME VARCHAR2(30)
    ALL_OBJECTS : SUBOBJECT_NAME VARCHAR2(30)
    ALL_OBJECTS : OBJECT_ID NUMBER(22)
    ALL_OBJECTS : DATA_OBJECT_ID NUMBER(22)
    ALL_OBJECTS : OBJECT_TYPE VARCHAR2(18)
    ALL_OBJECTS : CREATED DATE(7)
    ALL_OBJECTS : LAST_DDL_TIME DATE(7)
    ALL_OBJECTS : TIMESTAMP VARCHAR2(19)
    ALL_OBJECTS : STATUS VARCHAR2(7)
    ALL_OBJECTS : TEMPORARY VARCHAR2(1)
    ALL_OBJECTS : GENERATED VARCHAR2(1)
    ALL_OBJECTS : SECONDARY VARCHAR2(1)
    PL/SQL procedure successfully completed.
    SQL>

  • SQL commands of Oracle

    Help needed, guys! Could anyone tell me where to find full list and description of SQL commands of Oracle?

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/toc.htm

  • Oracle SQL Prompt commands

    1) How to identify the problem of Oracle database from SQL command prompt
      By executing a set of SQL commands one by one after connecting /as sysdba
      2)what could be possible errors and how to resolve from SQL prompt
      e.x db corrupt
            not mounted
            recovery
          .....etc
    Please give more example
    Thanks in ton

    Ok,
    I am locking this topic.
    SDN is not a substitute for training.
    go get your self trained with SAP course ADM505
    more about this at http://www12.sap.com/services/education/catalog/netweaver/globaltabbedcourse.epx?context=%5b%5bADM_DB%7cADM505%7c%7c%7c%7cG%7c%5d%5d%7c

  • Oracle Express 10g - SQL Command Line - copy and paste?

    Is there a special key to copy and paste SQL statement in the SQL command line?
    I'm doing a spool and this can only be achieved through the SQL command line. Thanks for the help if any.

    It uses the functionality of the shell it is running in.
    If you're using Windows, right-click on the title bar, select Edit then Paste from the menu that pops up.
    If you select Properties from the menu, you can enable Quick Edit mode, which lets you paste using the right mouse button.
    You can use the up arrow key to recall previous commands.
    If you're using Linux, I think you can paste with the right mouse button. (Or is it the middle mouse button?)

Maybe you are looking for

  • Oracle 10.2 Install in RedHat5 - Error in invoking 'ntcontab.o' of makefile

    Guru's, I am trying to install Oracle 10.2 on RHEL 5. ./runInstaller -ignoreSysPrereqs Checking operating system requirements ... Expected result: One of redhat-3,redhat-4,SuSE-9,asianux-1,asianux-2 Actual Result: redhat-Red Hat Enterprise Linux Serv

  • Blocking Invoice due to Quality.

    Hi, In our organization, we want to Block Invoice, if GR Inspection is Pending or Rejected. This functionality seems to be a standard one, but struggling to get this thing work for me. In QM configuration, I have created a Control key for Invoice Blo

  • Dock + mission control

    When using different desktops in mission control, I want to be able to hide the dock for a certain desktop. I have this set up as a remote connection to PC and thus the dock just gets in the way. Can this be done on a desktop by desktop basis (hide d

  • IDV error

    When will we get this error in IDV server "scheduled for outbound processing"? What is the reason for that error? How to solve?

  • Need Help: How do you download the free trial of Cs6 for a Mac Snow Leopard?

    How do you download the free trial of Cs6 for a Mac Snow Leopard?