Sql Prompt

Hi all:
What is the line to put in glogin.sql
I want to change the default SQL*Plus prompt to something else

It is important to specify your oracle version.
If you are in 10g, you can set the sqlprompt to something else more interesting rather than just 'something else'
SQL >conn / as sysdba
Connected.
SQL> set sqlprompt "_user _privilege>"
SYS AS SYSDBA>conn system/oracle
Connected.
SYSTEM >set sqlprompt "_user _privilege 'on' _date >"
SYSTEM  on 19-MAR-08 >set sqlprompt "_user'@'_connect_identifier>"
SYSTEM@ORCL>~ Madrid
http://hrivera99.blogspot.com/

Similar Messages

  • Error in pakcage table or view does not exist but on sql prompt query works

    Hi
    Can any one help me to understand the error of ORA-00942: table or view does not exist while compiling the package on Oracle 9.2.0.4.0
    The below package compiled in system user and trying to query on view v$session_wait however getting below error.
    PACKAGE BODY SYSTEM.PK_DB_ALERT
    On line: 212
    PL/SQL: ORA-00942: table or view does not exist
    I can execute same query mentioned below from sql prompt from system user and it works fine however it doesn't like from package, Please advice, thank you in advance.
    SELECT SID, seq#, event, wait_time
    FROM v$session_wait
    WHERE event NOT LIKE 'SQL*Net%' AND wait_time <> 0
    ORDER BY 2

    SDD wrote:
    Hi
    Can any one help me to understand the error of ORA-00942: table or view does not exist while compiling the package on Oracle 9.2.0.4.0Which means package owner is granted select on view not directly but via roles. However, roles are ignored by definer rights packages/stored procedures/stored functions/triggers... You need to grant package owner select on view directly.
    SY.
    Edited by: Solomon Yakobson on Jan 21, 2010 4:06 AM

  • How can I execute a Procedure with OUT variable is %ROWTYPE on SQL Prompt

    Hi,
    I have a procedure with OUT variable is %ROWTYPE
    How can I execute the following procedure on SQL prompt.
    (without creating anonymous block)
    CREATE OR REPLACE PROCEDURE zz_sp_EMP(VEMPNO IN EMP.EMPNO%TYPE,
    V_REC IN OUT EMP%ROWTYPE)
    AS
    BEGIN
    SELECT * INTO V_REC FROM EMP WHERE EMPNO = VEMPNO;
    END;
    Thanks & Regards,
    Naresh

    as previous posters said: it's not possible to do this without declaring a variable in the anonymous block.
    With anonymous block it would look like this (had to change it a bit, since i'm using hr-schema on oracle XE):
    declare
    l_rec EMPLOYEES%ROWTYPE;
    begin
    zz_sp_EMP(VEMPNO => 100, V_REC => l_rec);
    DBMS_OUTPUT.PUT_LINE ( 'first_name = ' || l_rec.first_name );
    DBMS_OUTPUT.PUT_LINE ( 'last_name = ' || l_rec.last_name );
    end;
    first_name = Steven
    last_name = King

  • Calling a function in sql prompt

    hi
    i have created one function in pl/sql
    lik following
    create or replace function ff(a number) return number is
    x number;
    begin
    select ann_pct_rate into x from naap30_appproducts where applicant_id = a;
    return x;
    end;
    while i called this in sql prompt i got an error like this
    SQL> select ff(200610000493001) from dual;
    select ff(200610000493001) from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    is it possible to do like this how?
    please advice
    thanks in advance
    sivasankar

    Hi Radha,
    i am very sorry, mistake is min i have wrongly specified the datatype. thanks for remind me. now it is ok
    i have corrected the table like this
    create or replace function ff(a number) return varchar2 is
    x varchar2(50);
    begin
    select ann_pct_rate into x from appproducts where applicant_id = a;
    return x;
    end;
    out put is
    select ff(200610000493001) from dual;
    FF(200610000493001)
    18.5000%
    thanks
    sivasankar

  • Execution of xquery with sql prompt(oracle 11g)

    Hi All I am executing the following query with squl prompt:
    SELECT XMLQuery('xquery version "1.0"; (: :)
    declare default element namespace "eNodeB"; (: :)
    for $m in ora:tokenize('oracle~','~')
    return ($m)'
    RETURNING CONTENT) AS RESULT
    FROM DUAL;
    But its giving the following exception
    for $m in ora:tokenize('deepa~','~')
    ERROR at line 3:
    ORA-19109: RETURNING keyword expected
    2) With the below mentioned query
    SELECT XMLQuery('xquery version "1.0"; (: :)
    declare default element namespace "eNodeB"; (: :)
    for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
    for $m in ora:tokenize('eNodeBTopAttr1~','~')
    let $r:=$x/following-sibling::*[local-name(.)=$m]
    where (exists($x/*[local-name(.)=$m]) or exists($r))
    return (
    if(exists($r) and not(exists($x/*[local-name(.)=$m]))) then
    element{local-name($r)}{data($r)} else(), if(exists($x/*[local-na
    me(.)=$m])) then element{local-name($x/*[local-name(.)=$m])}{data($x/*[local-name(.)=$m])} else()' PASSING p.OBJECT_VALUE AS
    "eNodeBRef"
    RETURNING CONTENT) AS RESULT
    FROM A_ENODEB p
    WHERE
    existsNode(p.OBJECT_VALUE,
    '/eNodeBFile/fileHeader[@fileName="eNodeB_inst_1.xml"]') =1;
    its giving the below error while executing through sql prompt
    *for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
    ERROR at line 3:
    ORA-19109: RETURNING keyword expected*

    Login to SQL Developer as the SYS user for Getting Started tutorial

  • SQL prompts show no data OBIEE 11.1.1.6

    Dear Gurus,
    I have prompt with parameters like:
    Province
    City
    Hospital Name
    I want Hospital Name parameter filtered by Province & City so I use this in my Sql Prompts Syntax:
    SELECT "Dim Hospital"."Hospital Name" FROM "eHealth CCD Vital Sign" WHERE "Dim Region"."Province"='{v_province}'
    I tested it and it show no data (appear search....) in Hospital Name drop down.
    I run it in Firefox, IE, Chrome, still the same.
    It work when I remove WHERE from the syntax.
    Is this bugs?
    I use obiee 11.1.1.6.0
    Any help will be appreciated
    Regards
    JOE
    NB:Sory I have post in wrong section, already move it in OBIEE Foundation.
    Edited by: JoeSSI on Nov 21, 2012 6:55 PM

    If Hospital and Province are columns in the same prompt, you can use the 'Limit values by' functionality in the Hospital column criteria(along with All column values instead of SQL results) and choose Province (or All prompts if indeed need to restrict by all other columns in that prompt). This way the Hospital column will be restricted based on Province as soon as Province is selected (ie without hitting Apply)
    If Hospital and Province are in different prompts then you can use the presentation variable and SQL results method you have been trying.
    Increase the logging level for the user and check what physical query is being fired for populating the Hospital column.

  • Calling a function from SQL prompt that returns a record

    Hi,
    I've been trying to execute a function that is present on a different database. for eg. I am loged on to a database say 'A' and trying to execute a function present in database 'B'. this function is present in a package 'X' which has 2 functions and two procedures. From the packages i am able to execute the two procedures and one of the function.
    So i guess it is not a problem with the access permissions. The function that i am trying to call say function I has got 3 OUT
    parameters and 1 IN parameter. the Function returns a record. When i try to execute this function i get an error. Can you please let me know as to how exactly i need to call this function from the SQL prompt...
    thanx in advance
    null

    Hi Anand,
    As your function has 3 OUT parameters and it returns a record you can not just call it from SQL Plus. You need to write small PL/SQL program and use variables to hold the OUT values and the returned record.
    Good Luck,
    RajKiran
    null

  • How to open notepad from sql prompt?

    Hi to all
    can anyone please let me know how to open notepad from sql prompt.
    I tried ed command but message appears " Cannot create save file "afiedt.buf"
    thanks in advance

    user13480742 wrote:
    can anyone please let me know how to open notepad from sql prompt.
    I tried ed command but message appears " Cannot create save file "afiedt.buf"Create a SQL*Plus shortcut on your desktop.
    Create a SQL folder on your desktop (in your documents folder, or whatever desktop location you have read and write access to).
    Change the +Working Directory+ of the SQL*Plus shortcut to this SQL folder you have created (via editing the properties of the shortcut).
    Launch SQL*Plus via that shortcut.
    It will now run from that SQL directory. This means that it will have read and write access to the current directory (allowing it to create the +afiedt.buf+ file for example). It also means that you can save your SQL scripts in this directory and execute these from the SQL*Plus command line, without having to specify a path.

  • Showing junk characters at SQL Prompt.

    Hi All,
    I m a beginner in Oracle DBA. I have one problem, i m trying to make my database such that it will store HINDI characters. Got that i changed NLs parameters in PFILE,Session as per document given by the Oracle. I also installed HINDI unicode font on my machine. But at SQL prompt its showing junk character when i fired a command
    select sysdater from dual.
    But if i change language to french then its working perfectly. i.e, its showing correct information.
    I also went throught the locale builder utility but there too i m getting square boxes. Can anybody help me out how to solve this problem.
    Regards
    Mahesh Agarwal

    Please review the FAQ and Unicode whitepaper at
    the Globalization home page:
    http://technet.oracle.com/tech/globalization/content.html
    If you need further help you need to specify the database
    version, the database character set, your client OS, the
    client OS language, are you using SQL*Plus etc.

  • How to run the SQL Script in SQL Prompt?

    Hi ExpertGroup,
    I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
    Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
    Let me know, How to Run in SQl Prompt.
    Thanks & Regards,
    Senthil K Kumar.

    This is my SQL Script....
    SET COLSEP '|'
    SET LINESIZE 32767
    SET PAGESIZE 50000
    /* SET LINESIZE 3000
    SET PAGESIZE 50000
    SET DEFINE OFF */
    SET ECHO OFF
    SET FEEDBACK OFF
    --SET HEADING OFF
    SET TRIMSPOOL ON
    SET NEWPAGE NONE
    SET UNDERLINE OFF
    SPOOL &&EnterPath;
    SELECT * FROM &&TableName;
    SPOOL OFF
    SET FEEDBACK ON
    --SET DEFINE ON
    PROMPT Done.
    I am able to run this script in SQL Prompt....
    Its executing fine...
    But, If I am executing again it maynot asking for new set of data....
    alternativily its taking old values only.....
    how can i exeute with new set of data in the sql prompt.....

  • How to run the .sql file in sql prompt?

    i want to run the .sql file in sql prompt

    Hi,
    You can navigate to the directory where the .sql files is stored and launch the SQL Prompt.
    After you login, you can run your script like this :
    SQL>@my_script.sql;
    Regards,
    Sandeep

  • Error while running OWB mapping package from sql prompt

    hi all,
    i have deployed my owb mapping in oracle. Now i want to execute this from the sql prompt. the foolowing error is giving when i try to run.
    SQL> DECLARE
    2 RetVal NUMBER;
    3 P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
    4 BEGIN
    5 RetVal := TEST1.TEST_MAP.MAIN ( P_ENV );
    6 END;
    7 /
    RetVal := TEST1.TEST_MAP.MAIN ( P_ENV );
    ERROR at line 5:
    ORA-06550: line 5, column 19:
    PLS-00302: component 'TEST_MAP' must be declared
    ORA-06550: line 5, column 3:
    PL/SQL: Statement ignored
    pls help me for finding the solution.
    -Regards
    Raj Kumar

    You need to split your data and create (at least 5) worksheet targets.
    For example if you have a ROW_NUMBER column you can use for instance a
    Conditional Split for something like:
    ROW_NUMBER % 5 == 0 for Case 1 (excel 1)
    ROW_NUMBER % 5 == 1 for Case 2 (excel 2)
    ROW_NUMBER % 5 == 2 for Case 3 (excel 3)
    ROW_NUMBER % 5 == 3 for Case 4 (excel 4)
    ROW_NUMBER % 5 == 4 for Case 5 (excel 5)

  • 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

  • SQL prompt for image search

    Hi,
    it seems that many adobe products are based on an SQL-database. So I was wondering whether this was also the case for the Bridge database. If so, would it be possible to add an sql-prompt in addition to the normal image search options? For those who know SQL, this would creatly enhance flexibility and possibly also convenience of doing more complex searches.
    Thanks and best regards
    - spitfire

    I've just learned that Bridge indeed uses MySQL as its database. So, please, developpers, bless us with an SQL-Prompt!
    regards
    - spitfire

  • Setting Sql Prompt to that of the connected Host

    Hi all,
    I work in a multiple Database environment. At times I've various
    sessions open in SqlPlus. My problem is its really tedious to
    keep track of which host my active window is connected to.
    All I want to do is set my sql prompt to that of the Database
    alias or my remote host ... (Automatically on Login)
    Any suggestions ????

    Here's a suggestion from another forum that should help you.
    FYI, the next version of iSQL*Plus will have this feature by
    default, so you'll always know the user and database to which
    you're connected.
    Here is how Tom Kyte does it. The following is an excerpt from
    a response he gave to a similar question:
    I use a login.sql with SQLPlus. I also make sure each and every
    database has a unique global name (alter database rename
    global_name to <some name>) or unique SID (i like the global
    name myself).
    In my login.sql i have:
    column global_name new_value gname
    set termout off
    select lower(user) || '@' ||
    decode(global_name, 'ORACLE8.WORLD', '8.0', 'ORA8I.WORLD',
    '8i', 'ORA8IDEV.WORLD', 'dev8i', global_name ) global_name from
    global_name;
    set termout on
    set sqlprompt '&gname> '
    That makes my sqlprompt look like:
    ops$[email protected]>
    So, now I have my username and database in the prompt. I just
    have to remember to use an @connect -- NOT connect when
    connecting since the login.sql is run ONCE, not after every
    connect. My @connect is simply:
    connect &1
    @login
    If you want to use the ORACLE_SID instead of the global database
    name, just "select instance global_name from v$thread" in the
    above.

  • How to write java hello world to run in oracle sql prompt

    Hi,
    I'm newbie of this chapter. I know JDBC. I wanted to introduce the JDBC process & start executing the same in orcle sql prompt.
    Do enlighten with an example.
    Thnx in Advance

    create or replace and compile java source named helloworld as
    public class HELLOWORLD{public static String HELLOWORLD() {return "Hello World";}}
    create or replace function printhelloworld return varchar2 as
    language java name 'HELLOWORLD.HELLOWORLD() return String';
    SQL> select printhelloworld from dual;
    Hello WorldRegards
    Laurent

Maybe you are looking for