Query performance : TOAD Vs SQL Plus, and caching of query output

Hi,
I have one query which takes more than 2 minutes in TOAD, but the same one takes less than 30 secs when executed in SQL Plus. Can some body please tell me why the performance is so different in the two. Is this a known issue? Can i get the actual time required for a query?
Also when I execute the same query in TOAD for the second time in succession, the execution time reduces drastically from 2 mins to 10 secs. Does caching occur in TOAD? Can I disable it. I am using TOAD for Oracle, Version 9.0.0.160.
Thanks,
Rahul.

user641207 wrote:
Hi,
I have one query which takes more than 2 minutes in TOAD, but the same one takes less than 30 secs when executed in SQL Plus. Can some body please tell me why the performance is so different in the two. Is this a known issue? Can i get the actual time required for a query?
Also when I execute the same query in TOAD for the second time in succession, the execution time reduces drastically from 2 mins to 10 secs. Does caching occur in TOAD? Can I disable it. I am using TOAD for Oracle, Version 9.0.0.160.Rahul,
it's unlikely but possible that the session established via TOAD has different settings than the session established via SQL*Plus.
You can check V$SQL and V$SQL_SHARED_CURSOR to find out if the SQL you're executing has different plans, which would result in multiple rows in V$SQL for the same SQL_ID (10g) or ADDRESS, HASH_VALUE (pre-10g) with different CHILD_NUMBERs and V$SQL_SHARED_CURSOR can tell you why they can't share the plan, in case you've got multiple plans.
In addition you can use V$SES_OPTIMIZER_ENV to find out if the optimizer related settings differ for the TOAD and SQL*Plus session.
The caching effect is probably the caching of the database rather than anything else. I don't think that TOAD caches the result on the client side.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/

Similar Messages

  • How to connect to SQL*Plus and issue a query all in one command?

    Hi everyone,
    Does anyone know of a way to connect to a db with SQL*Plus, and issue a simple query, all with one command?
    I know that I can save a .sql script with a query, then do this:
    sqlplus user/pwd@db @myscript.sql
    But I'm wondering if there's any way to put the actual query right into the connect command, something like:
    sqlplus user/pwd@db "select count(*) from dba_tables;"
    Does anyone know of a way to do this?

    you didn't mention windows or unix. so, here's a link with both
    Re: windows sql script
    it also has a link to another thread on how to deal with the parens when using ehco in dos.

  • SQL*Plus and NLS_DATE_FORMAT

    So, I haven't visited this topic in a long time, so I'm trying to refresh my memory on how everything works ...
    We set our NLS_DATE_FORMAT at the system level ... what ... 4 years ago to 'MM/DD/RR'. Despite the fact that I set this to something more commonly-used than the default of 'DD-Mon-RR', we've adopted the standard of always using TO_DATE() with an explicit format, just in case it's ever changed.
    There were some applications that missed the standard, and now that a driver (for ColdFusion) has been updated, these SQL statements are now failing.
    When I started looking into it, I realized that the system-level default of 'MM/DD/RR' should work fine. But, after experimenting in SQL*Plus and TOAD, I am thinking that either:
    1) the system-level format is not being used
    2) and/or there are login scripts which are setting these to something else
    Coincidentally, both SQL*Plus and TOAD return the exact same query results:
    SQL> select *
         from NLS_INSTANCE_PARAMETERS
         where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> select *
         from NLS_SESSION_PARAMETERS
         where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                DD-MON-RRSo I looked into the glogin.sql script (which both tools share), and there's nothing mentioned about the NLS_DATE_FORMAT
    -- Copyright (c) 1988, 2003, Oracle Corporation. 
    -- All Rights Reserved.
    -- NAME
    --   glogin.sql
    -- DESCRIPTION
    --   SQL*Plus global login "site profile" file
    --   Add any SQL*Plus commands here that are to
    --   be executed when a user starts SQL*Plus, or
    --   uses the SQL*Plus CONNECT command
    -- USAGE
    --   This script is automatically run
    -- Used by Trusted Oracle
    COLUMN ROWLABEL FORMAT A15
    -- Used for the SHOW ERRORS command
    COLUMN LINE/COL FORMAT A8
    COLUMN ERROR    FORMAT A65  WORD_WRAPPED
    -- Used for the SHOW SGA command
    COLUMN name_col_plus_show_sga FORMAT a24
    COLUMN units_col_plus_show_sga FORMAT a15
    -- Defaults for SHOW PARAMETERS
    COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
    COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
    -- Defaults for SHOW RECYCLEBIN
    COLUMN origname_plus_show_recyc   FORMAT a16 HEADING 'ORIGINAL NAME'
    COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
    COLUMN objtype_plus_show_recyc    FORMAT a12 HEADING 'OBJECT TYPE'
    COLUMN droptime_plus_show_recyc   FORMAT a19 HEADING 'DROP TIME'
    -- Defaults for SET AUTOTRACE EXPLAIN report
    COLUMN id_plus_exp FORMAT 990 HEADING i
    COLUMN parent_id_plus_exp FORMAT 990 HEADING p
    COLUMN plan_plus_exp FORMAT a60
    COLUMN object_node_plus_exp FORMAT a8
    COLUMN other_tag_plus_exp FORMAT a29
    COLUMN other_plus_exp FORMAT a44
    -- Used to alter the TOAD environment so that users do not have to
    -- use the SET DEFINE OFF command prior to compiling code
    -- Charles Forbes 10.17.2005
    SET scan offIf I expressly go into either tool and execute, the following, setting the format to that already delcared at the system-level:
    alter session set nls_date_format = 'MM/DD/RR'Then these SQL statements start running just fine again.
    There's something that I'm missing in my basic understanding of how this works. I assumed that the driver update for ColdFusion perhaps enabled a different "glogin.sql"-type script equivalent for that tool ... until ... I started checking into how the NLS_DATE_FORMAT is supposed to work ... but isn't. Could someone help me clarify where the hole is in my understanding?
    Thanks,
    Chuck

    chuckers wrote:
    What's the difference, then, between NLS_SESSION_PARAMETERS and NLS_INSTANCE_PARAMETERS in my initial post? The glogin.sql script isn't altering the NLS_DATE_FORMAT for the desktop version of SQL*Plus, so I'm perplexed that the SESSION format differs from the INSTANCE format.NLS_SESSION_PARAMETERS are the NLS parameters that are in force for your particular session (i.e. the particular connection you have). Most client applications cause things like NLS_DATE_FORMAT to be set, overriding the NLS_INSTANCE_PARAMETERS. Instance-level NLS settings are most commonly used only for purely back-end processing (i.e. background jobs scheduled via DBMS_JOB or DBMS_SCHEDULER, etc.) 9 times out of 10, the client application is going to override the instance-level paramters.
    I even opened SQL Developer, and got
    select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE                                   
    NLS_DATE_FORMAT                DD-MON-RR                               
    1 rows selected
    select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT'
    PARAMETER                      VALUE                                   
    NLS_DATE_FORMAT                MM/DD/RR                                
    1 rows selected
    That's not unexpected. Java applications are going to use the Java regional properties at least to specify a date format. SQL Developer has a config option for the date format, so it may well be specifying a different format.
    They're all 3 (Toad, SQL*Plus, TOAD) so suspiciously consistent, that I'm questioning some of the fundamentals of the NLS setup.
    I went ahead and looked via SQL*Plus from the server-side, & things are looking more consistently in-line with my expectations:
    [oracle@dvsrvr13 ~]$ sqlplus forbesc@d13
    SQL*Plus: Release 10.1.0.4.0 - Production on Thu Mar 19 12:44:57 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    [oracle@dvsrvr13 ~]$ locate glogin.sql
    /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
    [oracle@dvsrvr13 ~]$ more /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
    -- Copyright (c) 1988, 2003, Oracle Corporation.  All Rights Reserved.
    -- NAME
    --   glogin.sql
    -- DESCRIPTION
    --   SQL*Plus global login "site profile" file
    --   Add any SQL*Plus commands here that are to be executed when a
    --   user starts SQL*Plus, or uses the SQL*Plus CONNECT command
    -- USAGE
    --   This script is automatically run
    -- Used by Trusted Oracle
    COLUMN ROWLABEL FORMAT A15
    -- Used for the SHOW ERRORS command
    COLUMN LINE/COL FORMAT A8
    COLUMN ERROR    FORMAT A65  WORD_WRAPPED
    -- Used for the SHOW SGA command
    COLUMN name_col_plus_show_sga FORMAT a24
    COLUMN units_col_plus_show_sga FORMAT a15
    -- Defaults for SHOW PARAMETERS
    COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
    COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
    -- Defaults for SHOW RECYCLEBIN
    COLUMN origname_plus_show_recyc   FORMAT a16 HEADING 'ORIGINAL NAME'
    COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
    COLUMN objtype_plus_show_recyc    FORMAT a12 HEADING 'OBJECT TYPE'
    COLUMN droptime_plus_show_recyc   FORMAT a19 HEADING 'DROP TIME'
    -- Defaults for SET AUTOTRACE EXPLAIN report
    COLUMN id_plus_exp FORMAT 990 HEADING i
    COLUMN parent_id_plus_exp FORMAT 990 HEADING p
    COLUMN plan_plus_exp FORMAT a60
    COLUMN object_node_plus_exp FORMAT a8
    COLUMN other_tag_plus_exp FORMAT a29
    COLUMN other_plus_exp FORMAT a44
    [oracle@dvsrvr13 ~]$ So in all, I'm just perplexed by the differences.
    --=cfI'm not surprised that SQL*Plus from the Unix database server is going to have session-level settings that match the instance-level settings because there is probably nothing set in the Unix environment that would override the instance-level settings. There is probably no NLS_LANG or NLS_DATE_FORMAT set as environment variables and probably no central place to look for regional settings. Most applications, particularly Windows and Java apps, are going to have multiple places to look for that sort of information.
    Justin

  • How to know query execution time in sql plus

    HI
    I want to know the query execution time in sql plus along with statistics
    I say set time on ;
    set autotrace on ;
    select * from view where usr_id='abcd';
    if the result is 300 rows it scrolls till all the rows are retrieved and finally gives me execution time as 40 seconds or 1 minute.. (this is after all the records are scrolled )
    but when i execute it in toad it gives 350 milli seconds..
    i want to see the execution time in sql how to do this
    database server 11g and client is 10g
    regards
    raj

    what is the difference between .. the
    statistics gathered in sql plus something like this and the one that i get from plan_table in toad?
    how to format the execution plan I got in sqlplus in a proper understanding way?
    statistics in sqlplus
    tatistics
             0  recursive calls
             0  db block gets
           164  consistent gets
             0  physical reads
             0  redo size
         29805  bytes sent via SQL*Net to client
           838  bytes received via SQL*Net from client
            25  SQL*Net roundtrips to/from client
             1  sorts (memory)
             0  sorts (disk)
           352  rows processedexecution plan in sqlplus... how to format this
    xecution Plan
      0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=21 Card=1 Bytes=10
             03)
      1    0   HASH (UNIQUE) (Cost=21 Card=1 Bytes=1003)
      2    1     MERGE JOIN (CARTESIAN) (Cost=20 Card=1 Bytes=1003)
      3    2       NESTED LOOPS
      4    3         NESTED LOOPS (Cost=18 Card=1 Bytes=976)
      5    4           NESTED LOOPS (Cost=17 Card=1 Bytes=797)
      6    5             NESTED LOOPS (OUTER) (Cost=16 Card=1 Bytes=685)
      7    6               NESTED LOOPS (OUTER) (Cost=15 Card=1 Bytes=556
      8    7                 NESTED LOOPS (Cost=14 Card=1 Bytes=427)
      9    8                   NESTED LOOPS (Cost=5 Card=1 Bytes=284)
    10    9                     TABLE ACCESS (BY INDEX ROWID) OF 'USR_XR
             EF' (TABLE) (Cost=4 Card=1 Bytes=67)
    11   10                       INDEX (RANGE SCAN) OF 'USR_XREF_PK' (I
             NDEX (UNIQUE)) (Cost=2 Card=1)
    12    9                     TABLE ACCESS (BY INDEX ROWID) OF 'USR_DI
             M' (TABLE) (Cost=1 Card=1 Bytes=217)
    13   12                       INDEX (UNIQUE SCAN) OF 'USR_DIM_PK' (I
             NDEX (UNIQUE)) (Cost=0 Card=1)
    14    8                   TABLE ACCESS (BY INDEX ROWID) OF 'HDS_FCT'
              (TABLE) (Cost=9 Card=1 Bytes=143)
    15   14                     INDEX (RANGE SCAN) OF 'HDS_FCT_IX2' (IND
             EX) (Cost=1 Card=338)
    16    7                 TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_
             COMM' (TABLE) (Cost=1 Card=1 Bytes=129)
    17   16                   INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK'
              (INDEX (UNIQUE)) (Cost=0 Card=1)
    18    6               TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_CO
             MM' (TABLE) (Cost=1 Card=1 Bytes=129)
    19   18                 INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK' (
             INDEX (UNIQUE)) (Cost=0 Card=1)
    20    5             TABLE ACCESS (BY INDEX ROWID) OF 'PROD_DIM' (TAB
             LE) (Cost=1 Card=1 Bytes=112)
    21   20               INDEX (UNIQUE SCAN) OF 'PROD_DIM_PK' (INDEX (U
             NIQUE)) (Cost=0 Card=1)
    22    4           INDEX (UNIQUE SCAN) OF 'CUST_DIM_PK' (INDEX (UNIQU
             E)) (Cost=0 Card=1)
    23    3         TABLE ACCESS (BY INDEX ROWID) OF 'CUST_DIM' (TABLE)
             (Cost=1 Card=1 Bytes=179)
    24    2       BUFFER (SORT) (Cost=19 Card=22 Bytes=594)
    25   24         INDEX (FAST FULL SCAN) OF 'PROD_DIM_AK1' (INDEX (UNI
             QUE)) (Cost=2 Card=22 Bytes=594)

  • How to improve the query performance in to report level and designer level

    How to improve the query performance in to report level and designer level......?
    Plz let me know the detail view......

    first its all based on the design of the database, universe and the report.
    at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
    at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
    and when you create a paremeter try to get it match with the key fields in the database.
    good luck
    Amr

  • SQL Plus and ODBC w/different database types

    In order to connect to Oracle lite, we go through ODBC in SQL Plus (ex:login/pw@ODBC:polite)
    Can I utilize this method to connect SQL Plus to a SQL Server 7 database and from there run the COPY TO command to copy data into my Oracle database? If so, what do I need to install to make this work? Is there a specific version of SQL Plus that this works with?

    examples:
    - optimizer_mode is 'RULE' when I select using SQL*Plus and 'CHOOSE' when I use SQL*Plus Worksheet.
    - large_pool_size is 32Mb when I select using SQL*Plus and 108Mb when I use SQL*Plus Worksheet.
    etc.

  • Sql Plus and Unicode (or utf-8) characters.

    Hello,
    i have problem with Sql Plus and unicode files. I want to execute Start {filename}, where {filename} is file in unicode format (this file have to contains german and polish characters). But i receive error message. It is possible to read from unicode (or utf-8) file and execute commands from this file)?
    Thanks in advance.
    Pawel Przybyla

    What is your client operating system characterset?

  • Performance Problem - MS SQL 2K and PreparedStatement

    Hi all
    I am using MS SQL 2k and used PreparedStatement to retrieve data. There is strange and serious performance problem when the PreparedStatement contains "?" and using PreparedStatement.setX() functions to set its value. I have performed the test with the following code.
    for (int i = 0; i < 10; i ++) {
    try {
    con = DBConnection.getInstance();
    statement = con.prepareStatement("SELECT * FROM cardno WHERE car_no = '" + cardNo + "'");
    // statement = con.prepareStatement("SELECT * FROM cardno WHERE car_no = ?");
    // statement.setString(1, cardNo);
    rs = statement.executeQuery();
    if (rs.next()) {
    catch(SQLException e) {
    e.printStackTrace();
    finally {
    try {
    rs.close();
    statement.close();
    catch(SQLException e) {
    e.printStackTrace();
    Iteration Time (ms)
    1 961
    10 1061
    200 1803
    for (int i = 0; i < 10; i ++) {
    try {
    con = DBConnection.getInstance();
    // statement = con.prepareStatement("SELECT * FROM cardno WHERE car_no = '" + cardNo + "'");
    statement = con.prepareStatement("SELECT * FROM cardno WHERE car_no = ?");
    statement.setString(1, cardNo);
    rs = statement.executeQuery();
    if (rs.next()) {
    catch(SQLException e) {
    e.printStackTrace();
    finally {
    try {
    rs.close();
    statement.close();
    catch(SQLException e) {
    e.printStackTrace();
    Iteration Time (ms)
    1 1171
    10 2754
    100 18817
    200 36443
    The above test is performed with DataDirect JDBC 3.0 driver. The one uses ? and setString functions take much longer to execute, which supposed to be faster because of precompilation of the statement.
    I have tried different drivers - the one provided by MS, data direct and Sprinta JDBC drivers but all suffer the same problem in different extent. So, I am wondering if MS SQL doesn't support for precompiled statement and no matter what JDBC driver I used I am still having the performance problem. If so, many O/R mappings cannot be used because I believe most of them if not all use the precompiled statement.
    Best regards
    Edmond

    Edmond,
    Most JDBC drivers for MS SQL (and I think this includes all the drivers you tested) use sp_executesql to execute PreparedStatements. This is a pretty good solution as the driver doesn't have to keep any information about the PreparedStatement locally, the server takes care of all the precompiling and caching. And if the statement isn't already precompiled, this is also taken care of transparently by SQL Server.
    The problem with this approach is that all names in the query must be fully qualified. This means that the driver has to parse the query you are submitting and make all names fully qualified (by prepending a db name and schema). This is why creating a PreparedStatement takes so much using these drivers (and why it does so every time you create it, even though it's the same PreparedStatement).
    However, the speed advantage of PreparedStatements only becomes visible if you reuse the statement a lot of times.
    As about why the PreparedStatement with no placeholder is much faster, I think is because of internal optimisations (maybe the statement is run as a plain statement (?) ).
    As a conclusion, if you can reuse the same PreparedStatement, then the performance hit is not so high. Just ignore it. However, if the PreparedStatement is created each time and only used a few times, then you might have a performance issue. In this case I would recommend you try out the jTDS driver ( http://jtds.sourceforge.net ), which uses a completely different approach: temporary stored procedures are created for PreparedStatements. This means that no parsing is done by the driver and PreparedStatement caching is possible (i.e. the next time you are preparing the same statement it will take much less as the previously submitted procedure will be reused).
    Alin.

  • SQL plus and  Spatial tables

    I have some spatial tables in 10g. I can use 'select query' on non spatial attributes but if try
    select * or
    select geom then my SQL plus gives error ::
    Program Error - sqlplusw.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created.
    <Cancel>
    But I am able to use isqlplus without any errors.
    Earlier SQL plus used to work fine. I don't understand what happened to it in between.
    How can I bring my SQL plus working again.

    I created a copy for a spatial table using.
    create table copy as select * from original, and it was successful .
    Other than that I haven't done anything other than select queries.

  • Error with Sql*Plus and Spatial

    When i create a new table with a column SDO_GEOMETRY (spatial), i insert a new field.
    When i do a simple select * from this table, i receive this error :
    SP2-0591: Unable to allocate dynamic space needed (37748736 bytes)
    I can't find any information about this error. I thougth it was an error of the configuration on the server, but i've found that SQL*PLUS use lot of virtual space on my PC when i query on 'Spatial table' and don't free this space. After three execution of my query, I receive an error NT 'Not enough virtual space'!
    What do i have to do ?
    Thanks

    Yeah, I am also encountering this problem too! Can anyone help?
    null

  • Is it possible to use MERGE with sql*plus and if yes how?

    Hello everybody,
    I have an xls file and I have to load its data with sql*loader, but instead of "APPEND" operation stated in the control file I need MERGE operation.Here is what my control file contains:
    LOAD DATA
    INFILE 'C:\WORK\DSK_WH\LOAD_FIRST\sqlldr\data.csv'
    BADFILE 'C:\WORK\DSK_WH\LOAD_FIRST\sqlldr\p_badfile.txt'
    APPEND
    INTO TABLE D_ACCOUNT_NAMES_TMP
    FIELDS TERMINATED BY ";"
    TRAILING NULLCOLS
    (account_number , consignment, sub_consignment, consign_sub_consign, account_name_bg, account_number_2, consign_parent_2, account_name_bg_2, account_number_3, account_name_bg_3, account_number_4, account_name_bg_4, account_number_5 , ACCOUNT_NAME_BG_5 ).
    How can I use merge in this case , instead of insert ?
    Regards,
    Maria

    I'm not sure if there is any MERGE thing in SQL*Loader, but you can have a backup table which gets loaded by SQL*Loader and then use MERGE statement from backup to the original table, if your data is not huge to become a performance barrier. This is just a suggestion, may be you can try some reading of SQL*Loader here.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/part2.htm#436160
    Cheers
    Sarma.

  • Oracle 9.0.1 SQL*Plus and PL/SQL

    Having just upgraded from Oracle 8.0.1 to the above, can anyone suggest a good book for learning the above languages as I believe there is quite a lot of difference in the codes, which also contains some good exercises for trying them out.
    Phil.

    I would take a look at this for PL/SQL:
    Oracle PL/SQL Programming, 3rd Edition
    If you want to learn SQL, you can try this book, which some people I know have liked: Mastering Oracle SQL
    For the extra features of SQL*Plus, the Oracle manual is very complete and should be sufficient.

  • SQL*Plus and Oracle 9i Lite

    What is the trick to connecting to Oracle 9i Lite using SQL*Plus?
    I am using the following:
    Username: system
    Password: aaa
    Host String: ODBC:POLite
    I recieve an ORA-12203: TNS:unable to connect to destination: Function not performed
    do I need an entry in my tnsnames.ora file? If yes what? Also, if yes, where in the docs is this discussed?
    Thanks in advance

    Try format
    ODBC:POLITE:datasource
    for Polite:
    ODBC:POLITE:POLITE
    But since 4.0.1 Oracle Lite you can't use SQL plus.
    Use new tool named msql (<ora home>\Mobile\SDK\BIN\msql.exe) or SQL Worksheet in Oracle9i JDeveloper.

  • Input with sql*plus and Output it with PL/SQL

    Hi everyone,
    I try to understand how can I get input and input by using sqlplus and plsql together. I get output like this:
    Get User Input
    Given Name: Iron
    Family Name: Man
    old   6:        Given_Name := '&GivenName';
    new   6:        Given_Name := 'Iron';
    old   7:        Family_Name := '&FamilyName';
    new   7:        Family_Name := 'Man';
    Given Name: Iron
    Family Name: Man
    PL/SQL procedure successfully completed.My Codes:
    PROMPT Get User Input
    ACCEPT GivenName PROMPT "Given Name: "
    ACCEPT FamilyName PROMPT "Family Name: "
    DECLARE
         Family_Name Varchar(15);
         Given_Name Varchar(15);
    BEGIN
         Given_Name := '&GivenName';
         Family_Name := '&FamilyName';
         DBMS_OUTPUT.PUT_LINE('Given Name: ' || Given_Name); 
         DBMS_OUTPUT.PUT_LINE('Family Name: ' || Family_Name);
    END;
    /My question is why I get
    old   6:        Given_Name := '&GivenName';
    new   6:        Given_Name := 'Iron';
    old   7:        Family_Name := '&FamilyName';
    new   7:        Family_Name := 'Man';this bit?Is there something wrong in my code? Thanks.

    Hi,
    From SQL*Plus reference:
    After you enter a value at the prompt, SQL*Plus lists the line containing the substitution variable twice: once before substituting the value you enter and once after substitution. You can suppress this listing by setting the SET command variable VERIFY to OFF.
    So. you can remove current output with
    SET VERIFY OFF
    and enable your PL/SQL output by
    SET SERVEROUTPUT ON
    Regards
    Peter

  • SQL*Plus and Oracle

    Hi, i have recently started a new course where i am required to learn sql using the sql*plus program and several books. I have downloaded the instant client and the sql*plus program so that i can run them on my computer at home so i can learn at home. However i get a problem where i cannot logon to sql*plus.
    I believe this may be because i do not have an oracle server running on my pc, i am however not sure, would be gratefull for any help.

    Yes, you will need an Oracle Server to connect to. On your personal system, you can download Oracle XE (Express Edition) from OTN and use that. It contains both the server and client (SQL*Plus) components.

Maybe you are looking for