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

Similar Messages

  • How to change the default directory from within SQL*Plus ?

    Hello,
    I want to change the default directory directly from within SQL*Plus to be able to launch my command files with simple instructions like :
    @my_command.sql
    If I haven't launched SQL*Plus from the directory containing the file my_command.sql, how do I change the default directory to the directory of my command files ?
    I've searched through the Oracle documentation, there's no SET DEFAULTDIR or something like that. When I do a SHOW ALL, there's no variable containing the default directory.
    If you have an idea...
    regards,
    Jérôme.

    Hi Jérôme (J鲴me ?),
    You cannot directly do that, but you can use @@ instead of @ to run subscripts in the same directory as the superscript
    # head /tmp/tl30/xxx/[xyz].sql                    
    ==> /tmp/tl30/xxx/x.sql <==
    prompt call y
    @y
    prompt call z
    @@z
    quit
    ==> /tmp/tl30/xxx/y.sql <==
    prompt i am in y
    ==> /tmp/tl30/xxx/z.sql <==
    prompt i am in z
    # pwd                                             
    /root
    # sqlplus -s scott/tiger@lsc62 @/tmp/tl30/xxx/x.sql
    call y
    SP2-0310: Datei "y.sql" konnte nicht geöffnet werden
    call z
    i am in zKind regards
    Laurent Schneider
    OCM DBA

  • Selecting from a SQL Server 2005 with long column names ( 30 chars)

    Hi,
    I was able to set up a db link from Oracle 11.2.0.1 to SQL Server 2005 using DG4ODBC.
    My problem is that some column names in the Sql Server are longer than 30 chars and trying to select them gives me the ORA-00972: identifier is too long error.
    If I omit these columns the select succeeds.
    I know I can create a view in the sql server and query it instead of the original table, but I was wondering if there's a way to overcome it with sql.
    My select looks like this:
    select "good_column_name" from sometable@sqlserver_dblink -- this works
    select "good_column_name","very_long_column_name>30 chars" from sometable@sqlserver_dblink -- ORA-00972Thanks

    I tried creating a view with shorter column names but selecting from the view still returns an error.
    create view v_Boards as (select [9650_BoardId] as BoardId, [9651_BoardType] as BoardType, [9652_HardwareVendor] as
    HardwareVendor, [9653_BoardVersion] as BoardVersion, [9654_BoardName] as BoardName, [9655_BoardDescription] as BoardDescription,
    [9656_SlotNumber] as SlotNumber, [9670_SegmentId] as SegmentId, [MasterID] as MasterID, [9657_BoardHostName] as BoardHostName,
    [9658_BoardManagementUsername] as BoardManagementUsername, [9659_BoardManagementPassword] as BoardManagementPassword,
    [9660_BoardManagementVirtualAddress] as BoardManagementVirtualAddress, [9661_BoardManagementTelnetLoginPrompt] as
    MANAGEMENTTELNETLOGINPROMPT, [9662_BoardManagementTelnetPasswordPrompt] as MANAGEMENTTELNETPASSPROMPT,
    [9663_BoardManagementTelnetCommandPrompt] as MANAGEMENTTELNETCOMMANDPROMPT FROM Boards)performing a select * from this view in sqlserver works and show the short column names
    this is the error i'm getting for performing a select * from v_boards@sqlserver_dblink
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Microsoft][SQL Native Client][SQL Server]Invalid column name 'BoardManagementTelnetLoginProm'. {42S22,NativeErr = 207}[Microsoft]
    [SQL Native Client][SQL Server]Invalid column name 'BoardManagementTelnetPasswordP'. {42S22,NativeErr = 207}[Microsoft][SQL Native
    Client][SQL Server]Invalid column name 'BoardManagementTelnetCommandPr'. {42S22,NativeErr = 207}[Microsoft][SQL Native Client][SQL
    Server]Statement(s) could not be prepared. {42000,NativeErr = 8180}
    ORA-02063: preceding 2 lines from sqlserver_dblinkI also tried replacing the * with specific column names but it fails on the columns that have a long name (it doesn't recognize the short names from the view)
    what am I doing wrong?
    Edited by: Pyrocks on Dec 22, 2010 3:58 PM

  • Refcursor not returning rows when called from non SQL*Plus IDE or other

    Hi all,
    I have a very weird problem.
    We have recently performed a minor upgrade to our oracle database and are now using:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    5 rows selected.We have a crystal report selecting data from a refcursor returned by a stored procedure.
    The stored procedure updates data when called as well as returning the refcursor in question.
    Observe the following test scenario executed in SQL*Plus:
    SQL> create table testtab (teststr varchar2(100));
    Table created.
    Elapsed: 00:00:00.00
    SQL> insert into testtab values ('X');
    1 row created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure testtabproc (p_listcur in out sys_refcursor)
      2  as
      3  begin
      4 
      5     open p_listcur for
      6        select *
      7          from testtab
      8         where teststr = 'X';
      9 
    10 
    11     update testtab
    12        set teststr = 'Y';
    13 
    14        commit;
    15 
    16  end;
    17  /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> declare
      2 
      3  v_list_cur sys_refcursor;
      4 
      5  type t_out_rec is record (teststr varchar2(100) );
      6 
      7 
      8 
      9  v_out_rec t_out_rec;
    10 
    11  v_rec_count   number := 0;
    12  v_count_limit number := 10000;
    13 
    14  begin
    15 
    16  dbms_output.put_line('about to call proc');
    17
    18  testtabproc(v_list_cur);
    19 
    20  dbms_output.put_line('about to fetch records');
    21 
    22  fetch v_list_cur into v_out_rec;
    23  while v_list_cur%found loop
    24     v_rec_count := v_rec_count + 1;
    25     if v_rec_count <= v_count_limit then
    26       dbms_output.put_line(v_out_rec.teststr);
    27     end if;
    28  fetch v_list_cur into v_out_rec;
    29  end loop;
    30  dbms_output.put_line('complete. selected '||v_rec_count||' records.');
    31 
    32 
    33  end;
    34  /
    about to call proc                                                                                                                 
    about to fetch records                                                                                                             
    X                                                                                                                                  
    complete. selected 1 records.                                                                                                      
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from testtab;
    TESTSTR
    Y
    1 row selected.
    Elapsed: 00:00:00.00
    SQL> as you can see, the cursor returns data and the table is updated.
    now, our problem is with crystal and also when I use the same test case via another IDE like TOAD.
    No data is returned from the list but the table is still updated.
    We suspect that something is happening that is causing the table to be updated before the refcursor is opened, or at least before the predicates are applied.
    has anyone else encountered this problem before?

    Tubby wrote:
    WhiteHat wrote:
    nope - it works from sqlplus itermitantly (i.e. we always get the debug output but the cursor only sometimes fetches the rows).
    it is almost as if the commit is being executed before the cursor is opened.
    I still havn't been able to reproduce it except with the actual scenario that I am working with...Is the code you are dealing with exactly the same as the skeleton you've posted in your original post? Do you perhaps have a generic exception catcher in there somewhere (perhaps catching and hiding an ORA-01555) when the cursor is being fetched?
    Not that i expect it to make any difference, but i'm curious as to why you've declared your cursor as IN / OUT ?
    p_listcur in out sys_refcursor
    the code structure in the real example is almost identical to that test case I produced - the exception handler is only catering for no_data_found, all other errors should be raised as normal.
    edit: sorry I forgot to add - it's in/out because apparently that's what crystal reports needs in order to use the refcursor..... I'm not a crystal guy so I can't be any more specific than that sorry......
    Edited by: WhiteHat on Oct 11, 2010 9:34 AM

  • Select from a linked server fails when executed as a join to database tables

    Hi
    I have been using the following TSQL to update a results table for several years it is currently running on SQL Express version 11.0.2100.60 (I have successfully run this on various versions and editions from 2005 onwards)
    select c.Race_id , r.Runner_id , i.Time_secs
      from CHAMPS INPUT]...Results I
      join  [dbo].[Race] c
      on rtrim(I.Race)COLLATE SQL_Latin1_General_CP1_CI_AS
      = rtrim(c.Race_name)COLLATE SQL_Latin1_General_CP1_CI_AS
      join  [dbo].[Runner] r
      on rtrim(I.[Name]) COLLATE SQL_Latin1_General_CP1_CI_AS
      = rtrim(r.First_Name)COLLATE SQL_Latin1_General_CP1_CI_AS + ' '
      + rtrim(r.Surname)COLLATE SQL_Latin1_General_CP1_CI_AS
     where i.Time_secs > 0
    This worked earlier today then with no obvious change stopped working
    No error is given but no rows are returned
    running select * from [CHAMPS INPUT]...Results where Time_secs > 0 returns the expected rows
    Any ideas where to look for the problem

    Erland thanks for your reply. I have resolved the issue, it was caused by an error in updating the joined race table. I was looking for a problem with the linked server and missing the obvious.
    Hi philpits,
    You can try to use SQL Profiler to capture some events while run your query.
    In addition, can you get expected result while run the query on remote server? Please also check your underlying tables.
    Regards,
    Elvis Long
    TechNet Community Support

  • ORA-12154: TNS:could not resolve... - sql plus works, env vars are set...

    Hi,
    I am getting this error message in my ASP.Net apps (namespace Oracle.DataAccess.Client) and any app that tries to use the Oracle Provider for OLE DB.
    Error:
    ORA-12154: TNS:could not resolve the connect identifier specified
    Here is what I do know:
    - My ORACLE_HOME is set to C:\oracle\product\11.1.0\client_1\
    - My path has C:\oracle\product\11.1.0\client_1\network\admin;C:\oracle\product\11.1.0\client_1\bin;
    - I installed Oracle Client 11g, previously 10g was working but one of the devs wanted to upgrade
    - I can connect using sqlplus user/pass@tnsname
    - I can test tns entries successfully in Net Manager
    Here is what I don't know:
    - When using OLE connections, why does Oracle Provider for OLE DB not pick up on the environment variables - sql plus seems to, that's why it works.
    - In ASP.Net, why does the connection object from Oracle.DataAccess.Client not pick up the correct environment variables?
    - How do the Oracle drivers pick up the location of the TNS names?
    Thanks,
    Michael
    Edited by: user2750352 on 04-May-2009 07:51

    Hi,
    What "environment variables" are you referring to that you have set? You shouldnt have to set any, unless you're talking about TNS_ADMIN just to avoid having to configure multiple TNSNames.ora's if you have multiple homes.
    Your PATH doesnt need to include OH\network\admin, but thats not hurting anything. PATH is for dll loading, not for finding config files.
    Do you still have 10g installed? When you connect using sqlplus user/pass@tnsname, are you using 11g sqlplus? Or is that coming from the 10g client? Multiple homes arent aware of each other, so if you have a 10g home and an 11g home, you'd have to configure tnsnames.ora for both (or use tns_admin).
    As far as I know, the client software picks up tnsnames.ora by checking:
    1) the local working directory
    2) the tns_admin directory
    3) the network\admin directory of the client home being used.
    Hope it helps,
    Greg

  • Why does "SELECT * FROM [database].[schema].[table]" not work in Azure ?

    Hi all
    In Microsoft Azure I have 2 databases.
    I work since more than 10 years with T-SQL and I always use
    fully qualified object names, means "[database].[schema].[table]".
    When I now make a connection to my database "A" in Azure and
    write a Query against database "B" ("SELECT * FROM [B].[schema].[table]")
    I get an exception. Of course when I connect to database "B" it works
    but again not to database "A". When I use "SELECT * FROM [schema].[table]"
    with the right database connected, it also works in Azure.
    Hope you understand what I mean :-)
    In MS-SQL, this of course works fine.
    Well my question is: What sense does this make ??
    Do I now have to re-write everything just for azure or will this behavior changed sometimes ?
    I know MS-SQL is not the same like Azure-SQL, but hey; does Microsoft think all projects have only one database ?? :-)
    Thanks for any answer
    Frank

    Hi Frank,
    According to your description, you want to retrieval data cross database in SQL Azure, right?
    As June said, Currently cross database joins are not supported in SQL Azure. Also you cannot change database mid query so you cannot, for example, put a USE [MyDB] in your query either. Please refer to the link below to see the details.
    http://www.britishdeveloper.co.uk/2011/11/cross-database-joins-in-sql-azure.html
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Package fails, execute in sql*plus works

    SQL> execute toa.toa_security.change_password('testuser','testpassword');
    ALTER USER testuser IDENTIFIED BY testpassword
    BEGIN toa.toa_security.change_password('testuser','testpassword'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "TOA.TOA_SECURITY", line 77
    ORA-06512: at line 1
    Here is the code
    PROCEDURE CHANGE_PASSWORD (userid VARCHAR2, passwd VARCHAR2) IS
      sqlstr VARCHAR2(500);
    BEGIN
      sqlstr :=
        'ALTER USER '||userid||' IDENTIFIED BY '||passwd;
      EXECUTE IMMEDIATE sqlstr;
    END CHANGE_PASSWORD;Line 77: EXECUTE IMMEDIATE sqlstr;
    No matter what user I run this as it fails (even the owner who has DBA priv). I have other procedures and functions in this package and they all run fine for the owner and a "simple" user. So obvioulsy it is not a privilege missing for the user on the package even though I did "grant execute on toa_security to <user>;".
    I'm stumpped and baffled. And, I'm probably blind as to what is wrong.
    Any ideas?

    What William Robertson said is correct. Here's what happened on my system, I had to grant ALTER USER to myself directly:
    SQL> show user
    USER is "SYSTEM"
    SQL> CREATE OR REPLACE
      2  PROCEDURE CHANGE_PASSWORD (userid VARCHAR2, passwd VARCHAR2) IS
      3
      4  BEGIN
      5
      6    EXECUTE IMMEDIATE 'ALTER USER '||userid||' IDENTIFIED BY '||passwd;
      7
      8  END CHANGE_PASSWORD;
      9  /
    Procedure created.
    SQL> exec change_password('HR','blah');
    BEGIN change_password('HR','blah'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SYSTEM.CHANGE_PASSWORD", line 5
    ORA-06512: at line 1
    SQL> grant alter user to system;
    Grant succeeded.
    SQL> exec change_password('HR','blah');
    PL/SQL procedure successfully completed.
    SQL> conn hr/blah
    Connected.
    SQL>

  • Restricting user from ODBC, SQL PLus, Toad etc

    Hello,
    We would like to restrict user accessing database from anyODBC driver, s/w like Toad or sqlplus. They can only access dataabse through loggin to Application. Is there a way to do it.
    I have been looking into VPD but could not find any info there.
    Thanks
    Suhail

    Don't you need to be able to create a session before you can invoke a secure application role?
    What, exactly, are you trying to prevent. Are you trying to prevent well-meaning users from discovering that they can use Access to "fix" the data in the database when there are problems? Or are you trying to prevent a rogue employee from being able to access the database with anything other than your application?
    If it is the former, something simple like a login trigger that checks the program used to log in would probably work. If it is the latter, I fear you are out of luck. If your application can connect, a moderately competent hacker can access the database rather quickly, particularly if he has access to your application executable.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Supp Open Interface Import concurent program submit from Pl/Sql not Working

    Hi,
    I am new to Financials and using R12.1. We are integrating the Supplier Master from the Operations system from a different platform. The records are inserted into the interface tables and subsequently we need to trigger the concurrent programs from the backend which is failing when the request set was triggered. The STAGE10 onwards the concurrent programs are not getting submitted.
    The following is the code used for triggering the concurrent program for supplier site independently.
    declare
    lv_req_status               boolean;
    begin
    Fnd_global.apps_initialize(1175,50597,200);
    lv_req_status := fnd_submit.submit_program ('SQLAP',
    'APXSSIMP',
    'STAGE20',
    'ALL',
    1000,
    'N',
    'N',
    'N'
    end;
    Please help me in troubleshooting the same.
    Thanks in advance,
    rahul

    Hello,
    Is it supplier invoices that you are loading?
    Here is a piece of code for AP invoices:
    L_requestId := Fnd_Request.submit_request(application =>'SQLAP'
    ,program => 'APXIIMPT'
    ,sub_request => FALSE
    ,argument1 => NULL
    ,argument2 => <SOURCE_NAME>
    ,argument3 => NULL
    ,argument4 =>'NA'
    ,argument5 => NULL
    ,argument6 => NULL
    ,argument7 => NULL
    ,argument8 => 'N'
    ,argument9 => 'Y');
    COMMIT;
    Note: this piece of code is for Oracle R12.
    Hope this solve your issue,
    Vik
    Edited by: Vikram Awotar on Apr 17, 2010 11:12 PM
    Edited by: Vikram Awotar on Apr 17, 2010 11:15 PM

  • Select from  Berkeley DB through java code not working

    Hi,
    I have developed an application using Jdeveloper 11g where in the Database Navigator I have created a new connection say Conn1 ,selected Generic Jdbc as the connection type and org.sqlite.Jdbc as the Driver Class.The JDBC URL is for example jdbc:sqlite:C:\Temp\ABC\abc.db .I have created a table say zipcodes. Now,I developed an ADF Fusion Web App in Jdev and selected View Obj in the model part.In the subsequent steps I selected the Berkley DB Connection as Conn1 and thus created the App Module and View Object.I then created a java class in the model part with code as
    package abc;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Properties;
    public class MainClass {
    public static void main(String[] args)
    try {
    String driver = "org.apache.derby.jdbc.EmbeddedDriver";
    Class.forName(driver).newInstance();
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:derby:C:\Temp\ABC\abc.db");
    Statement s = conn.createStatement();
    ResultSet rs = s.executeQuery("SELECT city, state, zipcode FROM zipcodes");
    while(rs.next()) {
    System.out.println("City : "+ rs.getString(1));
    System.out.println("State : "+ rs.getString(2));
    System.out.println();
    rs.close();
    s.close();
    conn.close();
    } catch(Exception e) {
    System.out.println("Exception: "+ e);
    e.printStackTrace();
    I imported db.jar, dbexample.jar, sqlite.jar ,derby.jar. and in the view part selected a jsf page and drag and dropped an attribute from the view control...Now when I run the application the error is that: Application module not connected to a database...
    What can be the possible problem?????How do I resolve it
    Thank you.

    Hello,
    What is the OS platform and version of Berkeley DB being used?
    abc.db is the Berkeley DB database right?
    Thanks,
    Sandra

  • Select from function with named parameters doesn't work

    Hello,
    I'm trying to execute the next sql statement:
    SELECT mypack.getvalue(user_id => 231, status => 'closed') AS someAlias FROM DUAL;
    I'm getting the next Error:
    Error: ORA-00907: missing right parenthesis
    But the next works fine:
    SELECT mypack.getvalue(231,'closed') AS someAlias FROM DUAL;
    What I'm doing wrong?
    Is there a way to call a Function and return it's result as a single-row query?
    Thanks for any suggestions.

    Thanks for your answers.
    Just want to explain what I want to accomplish:
    I want to create PL/SQL statement which:
    1) Calls Function in named notation way;
    2) Returns a query which contains a single row - a Function result.
    I know in Transact-SQL I can accomplish this the next way:
    DECLARE @return_value INT
    EXEC[myproc]
    @id=2,
    @status='ok',
    @ret_param=@return_value OUTPUT
    SELECT @return_value AS my_return_value
    The last SELECT call returns a query with one row in it.
    How can I do the same in Oracle?
    Thanks a lot!

  • PL/SQL cursors vs. SQL*plus Select statement

    Hi folks, hope you're doing well,
    Here is a question that kept me wondering:
    Why would I use cursors when i can achieve the same thing with a SQL+ Select statement which is much easier to formulate than a cursor (e.g. you need no declaration, loops etc)?.
    Thanks so much,
    -a

    There is no such thing as a SQL*Plus SELECT statement. The SELECT command is part of the SQL Language - not part of the SQL*Plus (very limited small vocabulary) macro language.
    All SQL SELECTs (from client languages) winds up in the SQL Engine as SQL cursors. A SQL Cursor is basically the:
    - SQL source code
    - SQL "compiled" code (instructions on how to fetch the rows)
    On the client side, client cursors (not to be confused with SQL cursors) are used. A client cursor is created in the client language when it makes SQL calls via the database client driver (called the OCI/Oracle Call Interface for Oracle clients).
    Typically this is what a client does. It makes a connection to the database and gets a database handler in return. The database handler is the "communication channel" from the client to the db. In Oracle, the database handler in the client refers to the Oracle session (for that client) on db server.
    A SQL statement (source code) is used by the client. This can be a SELECT statement you type in at the SQL*Plus command line. It can be a SELECT statement for the PL/SQL cursor command in a stored procedure.
    The client creates a SQL handle for this SQL statement, by calling the Oracle client driver. Note that this SQL handle is a client handle - a client cursor for that SQL statement.
    E.g.
    a) sqlHandle = CreateSQL( databaseHandle, 'SELECT ... FROM ...')
    b) sqlHandle.Parse
    c) sqlHandle.Execute
    After the SQL handle (client cursor) has been executed, the client can fetch rows from it.
    This is what SQL*Plus does automatically for you, without you having to write the code to do it. SQL*Plus CONNECT command create a database connection handle. You enter a SELECT statement and SQL*Plus creates a SQL handle (client cursor), executes it, fetches from it, displays the rows, and closes the SQL handle when done.
    The same applies to PL/SQL. You can use a SELECT statement just like that in PL/SQL. E.g.
    declare
      i integer;
    begin
      select count(*) into i from emp where deptid = 123;
    end;This is called an implicit cursor. PL/SQL creates (just like SQL*Plus) an implicit client cursor. It creates and disposes of that client SQL handle for you - you do not need to do it.
    Or, you can create an explicit cursor. E.g. declare
      cursor c is select count(*) from emp where deptid = 123;
      i integer;
    begin
      open c;
      fetch c into i;
      close c;
    end;The question as to when to use implicit (client) cursors versus explicit (client) cursors depends on your requirements. Do you need to cycle through the results of the SQL? Etc.
    And keep in mind that in either case, the SQL Engine creates a SQL cursor anyway on its side.

  • SQL*Plus and chinese characters

    Hi all,
    I have following scenario:
    1. Database 10.1.0.5 with following NLS-Parameter:
    SQL> select * from NLS_DATABASE_PARAMETERS;
    NLS_LANGUAGE AMERICAN
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_RDBMS_VERSION 10.1.0.5.0
    SQL> select * from NLS_SESSION_PARAMETERS;
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY GERMANY
    NLS_CURRENCY €
    NLS_ISO_CURRENCY GERMANY
    NLS_NUMERIC_CHARACTERS ,.
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD.MM.RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH24:MI:SSXFF
    NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF
    NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
    NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR
    NLS_DUAL_CURRENCY €
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    SQL> select * from V$NLS_PARAMETERS;
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY GERMANY
    NLS_CURRENCY €
    NLS_ISO_CURRENCY GERMANY
    NLS_NUMERIC_CHARACTERS ,.
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD.MM.RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH24:MI:SSXFF
    NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF
    NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
    NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR
    NLS_DUAL_CURRENCY €
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    2. Windows Language is german
    I should be possible to insert the chinese characters into the table from the SQL*Plus (sqlplusw.exe) and SQL*Plus should be able to show the chinese characters from that table.
    Is there any Step-By-Step Tutorial for the changes, that I should provide?
    Can anybody help me?
    Thanks

    I have a table CHINESE with one column STRING
    NVARCHAR2(250). There I will store the chinese
    character and display the content in SQL*Plus.
    Into the table I will insert with SQL*Plus with
    INSERT Statement.
    To store the character you could use e.g.
    insert unistr(<unicode value expression>) into table But Sql*Plus does not support Unicode display. Use SQL Developer instead for displaying your table data.
    You could also use select dump(column,1016) from table to verify that character data is correctly converted and stored.
    Windows Codepage is 1252.
    What do you mean under "what is your corresponding
    NLS_LANG client char set setting" ?With acp 1252, your NLS_LANG should contain .WE8MSWIN1252 - this tells Oracle your acp setting.
    Note however that windows-1252 does not define any Chinese characters.
    http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx
    http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm
    You can read more about Unicode string literals in Oracle in chapter 7 Programming with Unicode, Globalization Support guide in 10.2. Also you probably should read about NCHAR literal replacement (available only in 10.2 and above).
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/toc.htm
    Message was edited by:
    orafad

  • 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.

Maybe you are looking for

  • Adobe Photoshop CS6 registration failed

    My Adobe Photoshop CS6 product registration failed. "Failed" message appear on my screen. Anyone here can help me to solve this issue? Thanks, Sally D

  • Polling with HTTPS (SOAP sender adapter)

    Hi, we are using SAP PI 7.1 EHP 1 and we have to set up a scenario, in which a business partner is going to send us IDocs over HTTPS. Now our security team has objections, that incoming messages could be too risky. So we have to figure out if it's al

  • Coloring a Pattern

    Hi, I just used a Basic Graphic_Dots pattern in a piece I'm working on. I can't for the life of me figure out how to color the polka dots? I would really like the dots to NOT be black.

  • IMP-00017: following statement failed with ORACLE error 2304

    Hi, in 9i DB when importing I have : IMP-00017: following statement failed with ORACLE error 2304: "CREATE TYPE "T_NUMBER" TIMESTAMP '2007-04-02:10:02:26' OID '6B4C21C0310143B" "A97211E5E8301C09E' " " as table of number" IMP-00003: ORACLE error 2304

  • Signature error after signing into securedoc

    i tried to restore my thinkpad t61 to the way i received when i bought it using the thinkvantage tool.  after the computer rebooted and i got past securedoc I receive a message that reads, "There has been a signature failure."  Is there any way to ge