SQL *Plus Function

Is there a reason why my system account is not listed when I try and generate the listing of users assigned the sqlplus function? I'm using the query "select * from product_profile"
Edited by: 997626 on Apr 2, 2013 2:03 PM

Hi,
Welcome to the forum!
Nothing in product_profile applies to SYSTEM, so I wouldn't expect it to contain any references to SYSTEM.
As far as I know, the product_profile that you see only contains information related to the current user. It is like many of the data dictionary views, including all the ones whose names begin with USER_ or ALL_.

Similar Messages

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • How to "end" function definition in SQL plus?

    I am using Oracle 11g and SQL plus.
    I am trying to define a function and get back to the SQL prompt, but it is just not exiting the function definition.
    SQL> create function dept_count (dept_name varchar(20))
    2 returns integer
    3 begin
    4 declare d_count integer;
    5 select count (* ) into d_count
    6 from instructor
    7 where instructor.dept_name = dept_name
    8 return d_count;
    9 end
    10 ;
    11
    12
    13
    14
    15
    16 ;;;
    17 end dept_count;
    18 ;
    19
    20 ; <--- I was expecting the SQL> prompt here but it doesn't appear.
    What should I do? Please help. Thanks.

    And, to answer probably the most frequently asked question when I was an Oracle instructor ...
    If you are saving this statement in a file to execute later, after the "/" at the bottom, hit return, so that your file contains a line feed after the /, rather than your file ending with the /
    Otherwise you get the annoying, but completely harmless, error message "Input truncated after (number) characters" when you compile the program.

  • How do I test sql function in sql*plus?

    Hi,
    I was given the syntax for a sql function and need to test this in SQL*Plus. What syntax do I use to test this?
    p_UserName IN OUT SMUser.Name%type,p_PW IN OUT SMUser.
    Password%type) RETURN INTEGER IS
    nRet INTEGER :=1;
    nCount NUMBER := 0;
    BEGIN
    select count(*) into nCount from smUser where smUser.Name = p_UserName
    and smUser.Password = p_PW;
    IF (nCount = 1) THEN
    SELECT smUser.Name into p_UserName from smUser where smUser.Name =
    p_UserName and smUser.Password = p_PW;
    SELECT smUser.Password into p_PW from smUser where smUser.Name =
    p_UserName and smUser.Password = p_PW;
    RETURN 0;
    END IF;
    RETURN nRet;
    END paulsoraclefunction;
    Thanks,
    Paul

    This should work. You will need to make sure that the variables are declared as the same data type as in the function. Unfortunately, you cannot use %TYPE in declaring SQL*Plus variables.
    VARIABLE p_username VARCHAR2(30);
    VARIABLE p_pw VARCHAR2(30);
    BEGIN
    :p_username := 'PAUL';
    END;
    SELECT paulsoraclefunction(:p_username,:p_pw) FROM dual;
    SELECT :p_username,:p_pw FROM dual;
    TTFN
    John

  • Calling a function from sql*plus

    I can call my procedure from sql *plus
    by doing
    sql>call Proc_name(x,y);
    How do you call a function?
    null

    John,
    I think moifying the statement
    CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
    TO
    CREATE OR REPLACE FUNCTION "OGUSER"."OGX1" (user_county in integer, user_permit in integer ) return NUMBER is
    AND before end you will have to add a return statement
    (Probably
    return 0;
    exception
    when others then
    return 1;
    end;
    This will change your procedure to a function but I am not sure you'll be able to see your dbms_output's, if you call the function using select ...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by john saucer ([email protected]):
    I want to turn my procedure into a function.
    So I can call it with a select statement.
    I'm kind of having problems with the return statement at the top and bottom.
    I don't quite understand how to declare the type in the return. My procedure calculates 2 pl/sql tables....
    My procedure looks like.
    CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
    as
    i integer :=0;
    j integer :=0;
    type dept_table_type is table of ogxtest%rowtype
    index by binary_integer;
    type dept2_table_type is table of ogxtest%rowtype
    index by binary_integer;
    my_dept_table dept_table_type;
    my_dept2_table dept2_table_type;
    v_cotemp number := user_county;
    v_permittemp number := user_permit;
    v_origcotemp number := user_county;
    v_origpermittemp number := user_permit;
    v_count number(2) :=1;
    v_count2 number(2) := 1;
    v_oldcount number(2) :=1;
    v_oldcount2 number(2) := 1;
    begin
    select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    select count(*) into v_oldcount from ogxtest where nco=v_cotemp and npermit=v_permittemp;
    while v_count >= 1 LOOP
    i := i+1;
    v_count2 := v_count2 +1;
    select *
    into my_dept_table(i)
    from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    v_cotemp := my_dept_table(i).nco;
    v_permittemp := my_dept_table(i).npermit;
    select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    end loop;
    while v_oldcount >= 1 LOOP
    j := j+1;
    v_oldcount2 := v_oldcount2 +1;
    select *
    into my_dept2_table(j)
    from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
    v_origcotemp := my_dept2_table(j).oco;
    v_origpermittemp := my_dept2_table(j).opermit;
    select count(*) into v_oldcount from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
    end loop;
    for i in 1..v_count2-1
    loop
    dbms_output.put_line(' reassigned to - orig county ' | |my_dept_table(i).oco | | ' orig permit ' | |my_dept_table(i).opermit| | ' new county ' | |
    my_dept_table(i).nco | | ' new permit ' | |my_dept_table(i).npermit );
    end loop;
    for j in 1..v_oldcount2-1
    loop
    dbms_output.put_line(' reassigned from - orig county ' | |my_dept2_table(j).oco | | ' orig permit ' | |my_dept2_table(j).opermit| | ' new county ' | |
    my_dept2_table(j).nco | | ' new permit ' | |my_dept2_table(j).npermit );
    end loop;
    end;
    <HR></BLOCKQUOTE>
    null

  • Run Functions on sql plus

    Dear all,
    Can anyone assist me to run my function on sql plus. I have created a function already using sql plus. I would like to execute my function.
    Thanks in advance

    Please read about [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a90842/ch5.htm#1006009]Running PL/SQL Blocks, [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a90842/ch6.htm#1007557]Using Bind Variables in the manual.

  • XE: Cant connect to sql*plus, APEX  seems to function

    Hi! I am a beginner in oracle.
    I installed oracle XE 10g, both the server and the client on mandriva linux, using the supplied RPM's. After that I ran /etc/init.d/xe/configure and accepted the default values. Then I performed the post-installation steps as mentioned in APEX insstallation guide (sourcing the shell scripts).
    In the APEX interface I can see the database, its staistics and I created a user. But when I try to connect using sql*plus, the connection is refused:
    SQL> conn sys as sysdba
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Judging from the output of commands below, there is something missing. Any ideas?
    *> tnsping XE*
    TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 27-APR-2009 20:47:20
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Message 3511 not found; No message file for product=network, facility=TNSTNS-03505: Message 3505 not found; No message file for product=network, facility=TNS
    *> lsnrctl status*
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 27-APR-2009 20:45:35
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Message 1053 not found; No message file for product=network, facility=TNSMessage 1020 not found; No message file for product=network, facility=TNSMessage 1021 not found; No message file for product=network, facility=TNSMessage 1022 not found; No message file for product=network, facility=TNSMessage 1023 not found; No message file for product=network, facility=TNSMessage 1026 not found; No message file for product=network, facility=TNSMessage 1034 not found; No message file for product=network, facility=TNSMessage 1024 not found; No message file for product=network, facility=TNSMessage 1025 not found; No message file for product=network, facility=TNSMessage 1040 not found; No message file for product=network, facility=TNSMessage 1422 not found; No message file for product=network, facility=TNSMessage 1033 not found; No message file for product=network, facility=TNSMessage 1028 not found; No message file for product=network, facility=TNSMessage 1415 not found; No message file for product=network, facility=TNS Message 1050 not found; No message file for product=network, facility=TNS
    Message 1050 not found; No message file for product=network, facility=TNS
    Message 1050 not found; No message file for product=network, facility=TNS
    Message 1029 not found; No message file for product=network, facility=TNSMessage 1411 not found; No message file for product=network, facility=TNS
    Message 1408 not found; No message file for product=network, facility=TNS
    Message 1411 not found; No message file for product=network, facility=TNS
    Message 1408 not found; No message file for product=network, facility=TNS
    Message 1411 not found; No message file for product=network, facility=TNS
    Message 1408 not found; No message file for product=network, facility=TNS
    Message 1411 not found; No message file for product=network, facility=TNS
    Message 1408 not found; No message file for product=network, facility=TNS
    Message 1052 not found; No message file for product=network, facility=TNS

    The messages tell me that you do not have the ORACLE_HOME variable set correctly. This has been discussed umpteen times, but since search is beyond the call of duty, I'll copy/paste one of my recent responses
    In Linux and Unix Oracle REQUIRES that variables ORACLE_HOME and ORACLE_SID be set properly. And *nix REQUIRES that an executable be in the PATH or explicitly referenced. The easiest way of setting those consistently and correctly is to source the oraenv routine which is placed in /usr/local/bin by the installer. To use that, and assuming you are using Linux,
    1) Find out the ORACLE_SID for your reference
    tail /etc/oratab
    and note the last line. The first field will be the SID.
    2) Source oraenv
    . oraenv
    [ oracle ]?: enter the SID here
    and if you want to put this into a script, enter something like
    ORAENV_ASK=NO
    ORACLE_SID={enter your SID ehere}
    . oraenv
    ORAENV_ASK=
    Many people will suggest you set these variables in your profile. In the long term that is a bad idea (and DBAs should always be thinking in the long term) since most DBAs end up with a second database, ORACLE_HOME, upgrade or product and oraenv ensures that there will be no conflicts.

  • A question about the impact of SQL*PLUS SERVEROUTPUT option on v$sql

    Hello everybody,
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0  Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    OS : Fedora Core 17 (X86_64) Kernel 3.6.6-1.fc17.x86_64I would like to ask a question about the SQL*Plus SET SERVEROUTPUT ON/OFF option and its impact on queries on views such as v$sql and v$session. Here is the problem
    Actually I define three variables in SQL*Plus in order to store sid, serial# and prev_sql_id columns from v$session in order to be able to use them later, several times in different other queries, while I'm still working in the current session.
    So, here is how I proceed
    SET SERVEROUTPUT ON;  -- I often activate this option as the first line of almost all of my SQL-PL/SQL script files
    SET SQLBLANKLINES ON;
    VARIABLE mysid NUMBER
    VARIABLE myserial# NUMBER;
    VARIABLE saved_sql_id VARCHAR2(13);
    -- So first I store sid and serial# for the current session
    BEGIN
        SELECT sid, serial# INTO :mysid, :myserial#
        FROM v$session
        WHERE audsid = SYS_CONTEXT('UserEnv', 'SessionId');
    END;
    PL/SQL procedure successfully completed.
    -- Just check to see the result
    SQL> SELECT :mysid, :myserial# FROM DUAL;
        :MYSID :MYSERIAL#
           129   1067
    SQL> Now, let's say that I want to run the following query as the last SQL statement run within my current session
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;According to Oracle® Database Reference 11g Release 2 (11.2) description for v$session
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3016.htm#REFRN30223]
    the column prev_sql_id includes the sql_id of the last sql statement executed for the given sid and serial# which in the case of my example, it will be the above mentioned SELECT query on the employees table. As a result, right after the SELECT statement on the employees table I run the following
    BEGIN
        SELECT prev_sql_id INTO :saved_sql_id
        FROM v$session
        WHERE sid = :mysid AND serial# = :myserial#;
    END;
    PL/SQL procedure successfully completed.
    SQL> SELECT :saved_sql_id FROM DUAL;
    :SAVED_SQL_ID
    9babjv8yq8ru3
    SQL> Having the value of sql_id, I'm supposed to find all information about cursor(s) for my SELECT statement and also its sql_text value in v$sql. Yet here is what I get when I query v$sql upon the stored sql_id
    SELECT child_number, sql_id, sql_text
    FROM v$sql
    WHERE sql_id = :saved_sql_id;
    CHILD_NUMBER   SQL_ID          SQL_TEXT
    0              9babjv8yq8ru3    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;Therefore instead of
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;for the value of sql_text I get the following value
    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES);Which is not of course what I was expecting to find in v$sql for the given sql_id.
    After a bit googling I found the following thread on the OTN forum where it had been suggested (well I think maybe not exactly for the same problem) to turn off SERVEROUTPUT.
    Problem with dbms_xplan.display_cursor
    This was precisely what I did
    SET SERVEROUTPUT OFFafter that I repeated the whole procedure and this time everything worked pretty well as expected. I checked SQL*Plus documentation for SERVEROUTPUT
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Could anyone kindly make some clarification?
    thanks in advance,
    Regards,
    Dariyoosh

    >
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Hi Dariyoosh,
    SET SERVEROUTPUT ON has the effect of executing dbms_output.get_lines after each and every statement. Not only related to system view.
    Here below what Tom Kyte is explaining in this page:
    Now, sqlplus sees this functionality and says "hey, would not it be nice for me to dump this buffer to screen for the user?". So, they added the SQLPlus command "set serveroutput on" which does two things
    1) it tells SQLPLUS you would like it <b>to execute dbms_output.get_lines after each and every statement</b>. You would like it to do this network rounding after each call. You would like this extra overhead to take place (think of an install script with hundreds/thousands of statements to be executed -- perhaps, just perhaps you don't want this extra call after every call)
    2) SQLPLUS automatically calls the dbms_output API "enable" to turn on the buffering that happens in the package.Regards.
    Al

  • Maximum length of SQL*Plus Command?

    I'm typing a long query into SQL*Plus (Linux, version 9.2.0.1... yes, I know it's ancient).
    If I run this query, all works fine:
    select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE')  then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$')
    else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
    'UPDATEMYAUDITING_TABLESETTEST_DETAILS='''||GRANTEE||'''WHEREMYAUDIT_REFNO=''A.F
    update myauditing_table set test_details='AUDIT_TRAIL is set to: DB' where myaud
    it_refno='A.FE';(In other words, is SQL that generates other SQL: if AUDIT_TRAIL is set to something interesting, tell me who has access to the AUD$ table. And it's working fine... the agg_concat function mentioned is simply Tom Kyte's stragg function under another name, as lifted word-for-word from http://www.sqlsnippets.com/en/topic-11591.html)
    Now this is what happens if I take out the linebreak after the mention of AUD$, so that the command is submitted as one single line of code:
    SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE')  then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
    SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.The error message indicates that the text has been 'split' at the 'AUDIT_TRAIL is set to...' bit, so that "s set to" is being treated as a new command, which is of course syntactically invalid. There is definitely no other change in text between the two versions, apart from the removal of a carriage return before the "else" statement.
    Possibly a coincidence, but the first "s" in "s set to" appears at position 258 in the entire text... close to a possible 255 or 256 character limit, perhaps?
    The same problem happens whether I run the command as a script (@mysql.sql) or typed in directly into a client SQL*Plus session. Is there some inherent limit to the length of commands that SQL*Plus can process in this version? My code runs fine on 10g and 11g databases/clients, whether it's on one line or two. Anyone know of a bug in 9i regarding this? And if there's a workaround (other than the obvious one of upgrading, of course!)

    As mentioned, it's choking at the 258th character, not the 240th. Also, it's a SELECT statement, not a COPY command (one relates to the database, the other is an internal SQL*Plus feature). And someone else also kindly pointed out that SQL*Plus has a command limit length (i.e., database-related commands) of 2500 characters. So I don't think that's the issue.
    I can be a bit more specific about this one now, though. I've a sequence of Solaris boxes running 9.2.0.1 up, and the results are that 9.2.0.1 is affected; and it's a problem for 9.2.0.7:
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE    9.2.0.1.0       Production
    TNS for Solaris: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE')  then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
    SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.And...
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    PL/SQL Release 9.2.0.7.0 - Production
    CORE    9.2.0.7.0       Production
    TNS for Solaris: Version 9.2.0.7.0 - Production
    NLSRTL Version 9.2.0.7.0 - Production
    SQL> select 'update myauditing_table set test_details='''||grantee||''' where myaudit_refno=''A.FE'';' from (select case when upper(value) in ('DBO','TRUE')  then (select agg_concat(grantee) from dba_tab_privs where table_name='AUD$') else (select 'AUDIT_TRAIL is set to: '||value from dual) end as grantee from v$parameter where upper(name)='AUDIT_TRAIL' order by grantee);
    SP2-0734: unknown command beginning "s set to: ..." - rest of line ignored.But in 10.2.0.1, the problem disappears.
    I am not sure, but it is perhaps related to metalink note 285913.1, since we did get some ORA-00600: internal error code, arguments: [qernsRowP], [1] errors in the alert log with a slightly different version of the above query. Changing the query obviously alters the test, though, so it may be completely unrelated.
    Either way, I think it's definitely a version-specific SQL*Plus bug (though it would be nice if any other 9i owners out there could try it and report back!)
    Anyway, the workaround is simply to submit the command on two separate lines, wherever possible. And of course... to upgrade.

  • GREATER THAN symbol appearing as &gt ; in SQL*Plus

    Version:11.2.0.3
    OS : RHEL 5.4
    We are a Software vedor firm.We have sent our SQL files to our client to execute. But the codes for various procedures and functions were failing
    because, in their SQL*Plus session (in Putty) the LESS THAN character < was appearing as &lt ; and GREATER THAN character > was appearing as &gt ;
    In the original code which we had sent to them has no problems with > or < characters.
    Original code
    Cursor feb_cur IS
      SELECT user_pwid
        FROM carton_hdr_dtl
       WHERE MODIFIED_DATE >= D_Last_Run_Date
       UNION
      SELECT user_pwid
        FROM carton_hdr_dtl_bkp
       WHERE (modified_date >= D_Last_Run_Date OR
              deleted_date >= D_Last_Run_Date);  But in the execution log file sent by our client, I can see &gt ; instead of > character.
    54   Cursor feb_cur IS
    55    SELECT user_pwid
    56        FROM carton_hdr_dtl
    57       WHERE MODIFIED_DATE &gt ;= D_Last_Run_Date
    58       UNION
    59    SELECT user_pwid
    60        FROM carton_hdr_dtl_bkp
    61       WHERE (modified_date &gt ;= D_Last_Run_Date OR
    62              deleted_date &gt;= D_Last_Run_Date);What are they doing wrong? They use putty. We use putty too but we don't have any issues.
    Edited by: Max on Dec 17, 2012 2:42 AM

    Thank you Blushadow, Nicosa for providing this clue.
    I checked with my client. They have put our scripts in Collabnet SVN version control and the implementor DBA will be provided the http URL .
    Apparently SVN is accessed using http protocol and yes you are right it is opened through a browser by typing an URL like below
    http://10.80.16.214:79839/svn/brcf/DBfiles/2012/WMHReleasel8/hrtb_pkt_wave.sqlFor most of the end users , the GREATER THAN character appears as > without any issues . For some users it appears as &gt ; . One potential cause is the difference in Internet Explorer version. They are currently looking into this.
    THANK YOU BLUSHADOW and NICOSA for shedding light on this.
    Hi Nicosa,
    A forum formatting question:
    How did you manage to get &gt_; (without the underscore) printed ? When I tried it the forums editor was converting it to > . This is why I placed a space/underscore between t and semi colon. Is there some escape character ?

  • Select from in SQL Developer fails - SQL*Plus works

    Hello All,
    I've got the HS connection to MySLQ working correctly and most of the requirements I have with respect to the data is working.
    However, i"m only able to test my procedures and functions in SQL*PLus. IN SQL Developer 4.0.0.12 there is always a problem and query results are never displayed.
    Thanks in advance for any advice.
    Sincerely
    JS

    Actually Mike,
    The white spaces are appended to the end of the resulting string. I've included the NLS setting for bother Oracle adn MySQL as well as my odbc.ini file
    select '"'|| "User" ||'"' as Username from "user"@MYODBC5;
    Results (there is white spaces added right after the username, as the result shoudl have been "intm","root" as opposed to "intm                                "
    ===============================================================================================================
    USERNAME
    "intm
    USERNAME
    "root
    NLS _SETTINGS  ORACLE
    ==============================================================
    Oracle:
    ======
    NAME                      
    VALUE$
    NLS_LANGUAGE              
    AMERICAN
    NLS_TERRITORY             
    AMERICA
    NLS_CURRENCY              
    $
    NLS_ISO_CURRENCY          
    AMERICA
    NLS_NUMERIC_CHARACTERS    
    NLS_CHARACTERSET          
    AL32UTF8
    NLS_CALENDAR              
    GREGORIAN
    NLS_DATE_FORMAT           
    DD-MON-RR
    NLS_DATE_LANGUAGE         
    AMERICAN
    NLS_SORT                  
    BINARY
    NLS_TIME_FORMAT           
    HH.MI.SSXFF AM
    NAME                      
    VALUE$
    NLS_TIMESTAMP_FORMAT      
    DD-MON-RR HH.MI.SSXF
    F AM
    NLS_TIME_TZ_FORMAT        
    HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT   
    DD-MON-RR HH.MI.SSXF
    F AM TZR
    NLS_DUAL_CURRENCY         
    $
    NLS_COMP                  
    BINARY
    NLS_LENGTH_SEMANTICS      
    BYTE
    NLS_NCHAR_CONV_EXCP       
    FALSE
    NAME                      
    VALUE$
    NLS_NCHAR_CHARACTERSET    
    AL16UTF16
    NLS_RDBMS_VERSION         
    11.2.0.2.0
    NLS _SETTINGS  MYSQL
    ==============================================================
    Oracle:
    ======
    NAME :
    +--------------------------+----------------------------+
    | Variable_name            | Value                      |
    +--------------------------+----------------------------+
    | character_set_client     | utf8                       |
    | character_set_connection | utf8                       |
    | character_set_database   | latin1                     |
    | character_set_filesystem | binary                     |
    | character_set_results    | utf8                       |
    | character_set_server     | latin1                     |
    | character_set_system     | utf8                       |
    | character_sets_dir       | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    ===========================================================ODBC INI
    [myodbc5]
    Driver = /usr/lib64/libmyodbc5a.so
    Description = Connector/ODBC 5.3.4 Driver DSN
    SERVER = 127.0.0.1
    PORT = 3306
    USER = intm
    PASSWORD = *********
    DATABASE = mysql
    OPTION = 0
    TRACE = OFF

  • Is the SQL * Plus Worksheet included in the Oracle 10g Express Edition?

    Hello All,
    I need to install Oracle 10g for a SQL class that I will be taking this year. I will be installing it in my laptop (Pentium 4, 1GB RAM). I was told by the Professor that I needed to have the SQL*Plus Worksheet. I would like to know which version of Oracle do I need to install, and If it includes the SQL*Plus Worksheet.
    This is my first time working & installing Oracle, so I would appreciate if anyone could guide me thru this process.
    Thanks a lot,
    Ed

    No, it is not included.
    However, the same functionality, and more, is in Oracle SQL Developer - also available free and download-able from the same area as Oracle Express Edition.
    Ask your prof why he want Worksheet. If it's only for the ability to scroll and correct previous SQL (eg: easier time correcting mistakes), and loading scripts, ask if SQL Developer would be allowed. It's much superior and allows you to use XE, which will not sink your laptop like the EE version will.

  • Error when connecting to SQL*PLUS via ODBC to Excel

    OS: Windows 2000 Professional
    Oracle DB: 9i release 2
    SQL*Plus: Release 9.2.0.1.0
    MS Excel: 2000
    ===================
    When I try to connect to SQL*PLUS via ODBC to Excel with "connect scott/tiger@odbc:libro" I get the following error:
    ORA-03121: no interface driver connected - function not performed

    SQL Server objects are commonly case sensitive, so please surround the column and table names by double quotes:
    SELECT "Type_PK_ID" FROM "dbo"."boundaries"@sqlserver
    SIDE NOTE: Oracle is by default not case sensitive and all object names are stored in upper case. To get case sensitive objects they need to be surrounded by double quotes. In HSODBC case sensitive table names were commonly found even when not surrounded by double quotes as the gateway used internal SQL Server methods to find the correct table nameing - this method does not work for column names. So to be able to query a case sensitive column it needs to be surrounded by double quotes and the table name must be written as stored in the source database.

  • How to cancel a search in SQL*Plus

    Once a search is initiated in SQL*Plus Worksheet, how can you stop it? I am on Windows NT. The normal Ctrl-C, Ctrl-Break, Esc don't work. I found an obscure reference in the SQL*Plus documentation about a cancel function, but it didn't give the keystrokes.

    I actually managed to crash an 8.0.5 database by hitting Ctrl-C in the middle of a query.
    Oracle Support advised me that this was a known bug. The solution?
    Don't hit Ctrl-C in the middle of a query!
    null

  • Where its not possible to use a variable (&&var) in SQL*PLUS ?

    SQL*Plus Command Reference - DEFINE
    Whenever you run a stored query or script, SQL*Plus substitutes the value of variable for each substitution variable referencing variable (in the form &variable or &&variable)
    The question is which are the limits of this. Can eg even be between a 'STR&&varING' passed as parameter to some function? Or as parameter I can pass only a single variable and there isnt such auto-casting level ?
    I have created DBCA Scripts to batch create a DB. So I want inside these scripts to replace the DBNAME with a variable. So I can create different DBS with these prescriptions from an API tool.
    E.g here there are 6 different scenarios where I might need to pass the variable. I dont know
    1. On which of the bellow scenarios I can inject the &&var
    2. On which I cant and thus have to create a 2nd VAR to inject the 1st one
    3. Which dont accept variables at all - but only static text
    @D:\app\admin\DBNAMEY\scripts\CreateDB.sql
    spool D:\app\admin\DBNAMEY\scripts\CreateDB.log append
    startup nomount pfile="D:\app\admin\DBNAMEY\scripts\init.ora";
    CREATE DATABASE "DBNAMEY"
    DATAFILE 'D:\app\oradata\DBNAMEY\system01.dbf' SIZE ...
    GROUP 2 ('D:\app\oradata\DBNAMEY\redo02.log') SIZE 51200K,
    I may not start testing the scripts 6 times fearing corrupting my Workstation on half executed scripts.

    GoodfireGeorge wrote:
    SQL*Plus Command Reference - DEFINE
    Whenever you run a stored query or script, SQL*Plus substitutes the value of variable for each substitution variable referencing variable (in the form &variable or &&variable)
    The question is which are the limits of this. Can eg even be between a 'STR&&varING' passed as parameter to some function? Or as parameter I can pass only a single variable and there isnt such auto-casting level ?
    I have created DBCA Scripts to batch create a DB. So I want inside these scripts to replace the DBNAME with a variable. So I can create different DBS with these prescriptions from an API tool.
    E.g here there are 6 different scenarios where I might need to pass the variable. I dont know
    1. On which of the bellow scenarios I can inject the &&var
    2. On which I cant and thus have to create a 2nd VAR to inject the 1st one
    3. Which dont accept variables at all - but only static text
    @D:\app\admin\DBNAMEY\scripts\CreateDB.sql
    spool D:\app\admin\DBNAMEY\scripts\CreateDB.log append
    startup nomount pfile="D:\app\admin\DBNAMEY\scripts\init.ora";
    CREATE DATABASE "DBNAMEY"
    DATAFILE 'D:\app\oradata\DBNAMEY\system01.dbf' SIZE ...
    GROUP 2 ('D:\app\oradata\DBNAMEY\redo02.log') SIZE 51200K,
    I may not start testing the scripts 6 times fearing corrupting my Workstation on half executed scripts.
    If you can't test because you are afraid the test might fail, you need to address that issue first.  No one on the web is going to give you iron-clad assurance that some code you write is going to work exactly as you expect.
    Your script is trying to create a database?  What's the worst thing that can happen if it doesn't work?  Do you know how to manually dis-mantle whatever your script does?  If not, you need to learn.  The knowledge you will gain from that exercise will go a long way to improving your understanding of how these things interrelate.

Maybe you are looking for

  • Address Bubble for Google Maps

    On my website I am using the Google Map to display the position of a church. To position it accurately I am using the lat & long (e.g. 53.75135, -2.50707). However, the lat and long show up in the address bubble when I view the web page; I would rath

  • Which metadata table in the BODS repository has data about CPU utilization of every job that gets executed?

    I have to create a performance dashboard where I need to make a graph showing CPU Utilization for individual workloads. If every job corresponds to a particular workload, is there any metadata table that would contain how much CPU Utilization corresp

  • LCD Projector

    Use a projector frequently for presentations and am new to the Mac. Used to be able to toggle the projector and computer displays on and off with the F7 key. Anything like that on the MacBook Pro?

  • R/3 Contracts Do Not Show as Source of Supply in SRM/EBP

    We are implementing SRM4.0 connecting to a backend R/3 Enterprise (470) instance in a classic mode.  "Standard" functionality should allow us to see backend R/3 contracts (by material group) when in the source of supply tab in the SRM shopping cart. 

  • Content status

    I have a content rule on a CSS 11501 running version 07.40.1.03 that has two services assigned to it. If both of these services are down the content rule still shows as alive on the css. What I would like the ability to do is to either use snmp to mo