MS-SQL - Oracle SELECT INTO conversion problem...

Under MS-SQL (T-SQL) Select statement is defined as follows:
SELECT select_list
[INTO new_table_]
^^^^^^^^^^^^^^^^^^^^^
FROM table_source
[WHERE search_condition]
[GROUP BY group_by_expression]
[HAVING search_condition]
[ORDER BY order_expression [ASC | DESC] ]
Q:How under PL/SQL can one redirect sorted (ORDERed BY) results
from SELECT query to another table.
Slawek
null

I have asked the question because of the following reason:
I have a large select query that returns rows from a table in
different sort orders depending on user inputs, and I wonder if
there is any way to return just the rows between two specified
positions.
I figured that I'm going to either create one temporary table
with all the data (1000 records for example), sort the data in
the prefered order and use the rownum method to obtain the row
range (works fine under T-SQL). Other way is to try an inline
view that return the rownumber. I can then restrict the numer of
fields, e.g.
select empid, rowNumber from emp,
(select empid as id, rownum as rowNumber from emp) x
where empid = id
and rowNumber between 2 and 5
The problem is that under Oracle the subquery is not allowed to
have an ORDER BY clause (even if it had, rownum reflects row
numbers before they were sorted) and there is no SELECT into
TABLE_NAME.
Michael Malicky (guest) wrote:
: Slawek (guest) wrote:
: : Under MS-SQL (T-SQL) Select statement is defined as follows:
: : SELECT select_list
: : [INTO new_table_]
: : ^^^^^^^^^^^^^^^^^^^^^
: : FROM table_source
: : [WHERE search_condition]
: : [GROUP BY group_by_expression]
: : [HAVING search_condition]
: : [ORDER BY order_expression [ASC | DESC] ]
: : Q:How under PL/SQL can one redirect sorted (ORDERed BY)
results
: : from SELECT query to another table.
: : Slawek
: Order by is irrelevant when creating a new table out of a
: query, as the rows are NOT stored in any order in a table.
: The syntax for creating a new table out of an existing one
: is:
: CREATE TABLE new_table AS
: SELECT select_list FROM old_table
: WHERE ...
: etc.
: /mike
null

Similar Messages

  • Oracle select  into

    why this Oracle sql query doesn't support "select ... into ..", what is the error ? or it has to be used in PL/SQL ?
    Thanks.
    select orders.cno, zipcodes.city
    into tmp_back
    from orders, employees, customers, zipcodes
    where
    orders.eno = employees.eno
    and
    orders.cno = customers.cno
    and
    employees.zip = zipcodes.zip

    Hi,
    user533361 wrote:
    why this Oracle sql query doesn't support "select ... into ..", what is the error ? or it has to be used in PL/SQL ?Exactly.
    <tt>SELECT ... INTO</tt> only works in PL/SQL.
    In SQL*Plus, you can use <tt>COLUMN ... NEW_VALUE</tt> to set substitution variables
    After running this
    COLUMN  cno     NEW_VALUE v_cno
    COLUMN  city    NEW_VALUE v_city
    select orders.cno, zipcodes.city
    from orders, employees, customers, zipcodes
    ...The substitution variables &v_cno and &v_city will have whatever values were in the last row of the result set.

  • Pl/sql process select into

    hi all
    i created some items on page
    p102_a1,p102_a2,p_102_a3....p102_a6
    i want to do a process before header with a loop which will insert to this items some value from table
    for i in 1..6 do
    loop
    select employee_id
    into :p102_a ||to_char (i)
    from employees where serial = 1
    so he will insert to all the items(p102_a1..p102_a6) the employee_id
    which returns only one row and the same row
    is it possible to do such a thing in pl/sql ?
    please help
    thanks

    "user622321",
    You are exhibiting very, very, bad manners here on this OTN forum. You've been posting the same questions (about Application Express) in the Database forum, the 10g Grid Control forum, and here. Then in this forum you found an existing thread that had nothing to do with your question, then you changed the subject of the thread and tacked your question on the end. What are you thinking?
    Finally, your questions are unclear. They are the kind of questions that invite others to do work for you, first by requiring them to ask you for more information. For questions like this, you should write one or two very clear paragraphs describing your situation, explain what approaches you have already tried or thought about, and what specific aspects you need help with.
    You need to go to the Application Express home page (http://www.oracle.com/technology/products/database/application_express/index.html) and look through all the links, especially the Documentation and Tutorials resources. Complete the 2-Day Plus Developer's Guide and look at the Advanced Tutorials. Download the User's Guide and study it.
    Finally, change your handle so that it shows a friendlier name, preferably one that includes your first name. Also put at least your first name in your profile.
    If you will please abide by rules of etiquette like these and show that you are willing to put in some work on your end, you'll find the contributers here very helpful and friendly. And most of them aren't even as grumpy as I am.
    Scott

  • MS SQL Server 2005 Data Conversion Problem

    Hello all,
    I'm using the Microsoft JDBC Driver with SQL Server 2005 and getting an exception from the database server indicating that it is attempting to convert an nvarchar to an int (SQL Error 8114). This is the stack trace and code. I've exhausted all my resources... anybody have an idea?
    com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type nvarchar to int.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getPrepExecResponse(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement (Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
    at com.boeing.ict.workmonitor.swing.JMainFrame$33.insertIntoDB (JMainFrame.java:986)
    at com.boeing.ict.workmonitor.utils.SafeUDPWorker.respond(SafeUDPWorker.java:65)
    at com.boeing.ict.workmonitor.utils.SafeNetWorker.runWork(SafeNetWorker.java:113)
    at com.boeing.ict.workmonitor.utils.SafeNetWorker.access$000 (SafeNetWorker.java:21)
    at com.boeing.ict.workmonitor.utils.SafeNetWorker$1.run(SafeNetWorker.java:59)
    at java.lang.Thread.run(Unknown Source)
        private void listenToCOTMessages() {
            // the listener has not started yet.
            if (cotMessageWorker == null) {
                cotMessageWorker = new SafeUDPWorker() {
                    public void insertIntoDB(Iterator<NameValuePair> nvPairs) {
                        try {
                            int numParameters = 0;
                            if (isDebugMode()) {
                                System.err.println("Entered insertIntoDB");
                            while (nvPairs.hasNext()) {
                                NameValuePair pair = nvPairs.next();
                                // Aircraft callsign
                                if (pair.getName().equalsIgnoreCase("callsign")) {
                                    cotStatement.setString(1, pair.getValue());
                                    // debug code
                                    System.err.println("{1} " + pair.getValue());
                                    cotStatement.setString(2, pair.getValue());
                                    // debug code
                                    System.err.println("{2} " + pair.getValue());
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                // Aircraft altitude (meters)
                                else if (pair.getName().equalsIgnoreCase("hae")) {
                                    int height = Integer.parseInt(pair.getValue());
                                    height = (int)((height * 39.37) / 12);
                                    cotStatement.setInt(3, height);
                                    // debug code
                                    System.err.println("{3} " + height);
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                // aircraft latitude N/S (+/-)
                                else if (pair.getName().equalsIgnoreCase("lat")) {
                                    String rawLatitude = pair.getValue();
                                    // we have a south latitude
                                    if (rawLatitude.charAt(0) == '-') {
                                        // we need to append an " S"
                                    } else {
                                        rawLatitude = rawLatitude.substring(1) + " S";
                                    cotStatement.setString (4, rawLatitude);
                                    System.err.println("{4} " + rawLatitude);
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                // aircraft longitude E/W (+/-)
                                else if (pair.getName ().equalsIgnoreCase("lon")) {
                                    String rawLongitude = pair.getValue();
                                    // we have a west longitude
                                    if (rawLongitude.charAt (0) == '-') {
                                        rawLongitude = rawLongitude.substring(1) + " W";
                                    cotStatement.setString(5, rawLongitude);
                                    // debug code
                                    System.err.println("{5}" + rawLongitude);
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                // aircraft course
                                else if (pair.getName().equalsIgnoreCase("course")) {
                                    cotStatement.setString(6, pair.getValue());
                                    // debug code
                                    System.err.println("{6} " + pair.getValue());
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                // we have a speed number
                                else if (pair.getName ().equalsIgnoreCase("speed")) {
                                    cotStatement.setInt(7, Integer.parseInt(pair.getValue()));
                                    System.err.println("{7} " + pair.getValue ());
                                    numParameters++;
                                    if (numParameters > 7)
                                        break;
                                else {
                                    continue;
                            // execute the callable statement
                            cotStatement.execute();
                        } catch (SQLException ex) {
                            ex.printStackTrace();
                            // statusPanel.getStatusTextArea().append( ex.getMessage());
                // set the debugging mode
                cotMessageWorker.setDebugMode(debugMode);
                // set the output area for the worker
                cotMessageWorker.setMessageArea(cotTextArea);
                String portField = cotPortTextField.getText();
                // get the port setting from the portTextField
                if (portField.length() != 0) {
                    try {
                        cotMessageWorker.setPort(Integer.parseInt(portField));
                    } catch (NumberFormatException nfe) {
                        cotPortTextField.setBackground(Color.RED);
                cotMessageWorker.setStatusArea(statusPanel.getStatusTextArea());
                // set the java.sql.Statement object to do the data insertion
                if (cotStatement != null)
                    cotMessageWorker.setSqlStatement(cotStatement);
                cotMessageWorker.start();
            } else { // the listener has started
                // there are no errors generated for making multiple resume requests
                cotMessageWorker.resumeRequest();
        }

    Ideas? Not really, there's nothing wrong-looking about your code, but maybe I could ask some dumb questions.
    Has this code never worked, or does it usually work but occasionally this error occurs? Have you just switched to SQL Server 2005 from 2000 and the error started happening?
    Does the table you are inserting to only have those 7 columns, or are there others that are getting default values? Does it contain auto-generated identity columns? Are you sure you're using the right table in the right database?

  • Problems with loading source model using omw from sql server 7 into oracle 9i

    I am migrating data from sql servr 7 into oracle 9i. when doing capture phase i get the following error.
    ==>failed to load source model.[microsoft][odbc sql server][sql server]select permission
    denied on column 'password' of object 'syslogins', database master, owner dbo.
    Why is this so...is it bcz of something with my odbc link...
    also is there any way to load only tables and not system tables when doing capture phase.
    any help asap will be much appreciated.
    thanks

    Hi,
    You must ensure that you have the correct password to login to SQL Server.
    The Workbench requires some of the tables in the Master database.
    Regards
    John

  • Native SQL: insert data into oracle database, no return message.

    hi,
    the statement : insert into <TableName> values (Source)
    how can I know if the data have already insert to the database table?
    now I have a program have this problem: the data has already exist, but there's no error message return when insert the same data again.
    data: dbs like dbcon-con_name value 'HRGK',
                       dbtype type dbcon_dbms.
    data: sqlerr_ref type ref to cx_sql_exception,
             exc_ref    type ref to cx_sy_native_sql_error,
             error_text type string.
    data: cnt type i,
            i(2) type c.
    set locale language 'E'.
    EXEC SQL.
      CONNECT TO :DBS
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION :DBS
    ENDEXEC.
    EXEC SQL.
      SELECT COUNT(*) from org_unit into :cnt
    ENDEXEC.
    write: / cnt.
    *do.
    i = 'A'.               
    try.
        EXEC SQL.
          BEGIN
           insert into ORG_UNIT ( ORGAN_ID, UNIT_NO, UNIT_NAME, PARENT_ID)
                         values ( 'A', '123412', 'SDFSG', 'DDS');                     " ORGAN_ID is primary key
    " If the data 'A' has already exist in database ORG_UNIT, it will show error message
    " But if I use :I instead 'A', it will not show error message.
            IF SQL%FOUND THEN
               COMMIT;
            END IF;
          END;
        endexec.
        EXEC SQL.
          SELECT COUNT(*) from ORG_UNIT into :cnt
        ENDEXEC.
        write: / cnt.
    catch cx_sy_native_sql_error into exc_ref.
        error_text = exc_ref->get_text( ).
        write: / error_text.
      catch cx_sql_exception into sqlerr_ref.
        perform handle_sql_exception using sqlerr_ref.
    endtry.
    EXEC SQL.
      disconnect :DBS
    ENDEXEC.
    *enddo.
    *&      Form  handle_sql_exception
    form handle_sql_exception
      using p_sqlerr_ref type ref to cx_sql_exception.
      format color col_negative.
      if p_sqlerr_ref->db_error = 'X'.
        write: / 'SQL error occured:', p_sqlerr_ref->sql_code,
               / p_sqlerr_ref->sql_message.                     "#EC NOTEXT
      else.
        write:
          / 'Error from DBI (details in dev-trace):',
            p_sqlerr_ref->internal_error.                       "#EC NOTEXT
      endif.
    endform.                    "handle_sql_exception
    please help to see the words:
    *" If the data 'A' has already exist in database ORG_UNIT, it will show error message*
    *" But if I use :I instead 'A', it will not show error message.*
    in the program.
    Thanks a lot!

    resumption and jer,
    Sorry I cannot format the code for easy reading!
    The page is submitting to itself. See action = \"$uri\". I used the same logic to enter SELECT querries into the database. It pulls and displays data back on the webpage. The code I used for this is below. Compare it with the one above for inserting data into the table.
    <?php
    // connect to oracle
    $username = "xxxxx";
         $paswd = "yyyyy";
         $dbstring = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)".
              "(HOST=patriot.gmu.edu)(PORT=1521))".
              "(CONNECT_DATA=(SID=COSC)))";
         $db_conn = ocilogon($username, $paswd, $dbstring);
    // username and password will be unset if they weren't passed,
    // or if they were wrong
    if( !isset($query)) {
    // just print form asking for account details
    echo "<form action=\"$uri\" method=post>\n";
    echo "<p>Enter Query: ";
    echo "<input type=text size=100 maxlength=200 name=query value=\"$query\">\n";
    echo "<br><input type=submit name=submit value=Submit>\n";
    echo "</form>\n";
    exit;
    // remove unwanted slashes from the query
    $query = stripslashes($query);
    // run the query
    $stmt = OCIParse($db_conn, $query);
    OCIExecute($stmt, OCI_DEFAULT);
    // Open the HTML table.
    print '<table border="1" cellspacing="0" cellpadding="3">';
    // Read fetched headers.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="e">'.ocicolumnname($stmt,$i).'</td>';
    print '</tr>';
    // Read fetched data.
    while (ocifetch($stmt))
    // Print open and close HTML row tags and columns data.
    print '<tr>';
    for ($i = 1;$i <= ocinumcols($stmt);$i++)
    print '<td class="v">'.ociresult($stmt,$i).'</td>';
    print '</tr>';
    // Close the HTML table.
    print '</table>';
    OCIFreeStatement($stmt);
    OCILogoff($db_conn);
    ?>

  • Converting MS-Access select * into... to run in Oracle

    I have this stored procedure in MS Access:
    create procedure foo as
    begin
    if exists(select name from sysobjects where name='cif_retail)
    drop table 'cif_retail'
    select * into cif_retail from cif where cstresf=1
    end
    The above stored procedure checks if table cif_retail exists and if it exists it drops it and then it creates a new table cif_retail with data from cif with the condition cstresf=1.
    How can I do the above in Oracle SQL? I tried the following but it comlains about the drop command, and when i remove it, it complains about the create table command too. Please help:
    create or replace procedure foo as
    begin
    drop table w;
    CREATE TABLE w AS SELECT * FROM x;
    end;
    Thanks,
    Theodora

    You can Also Use
    FORMS_DLL
    Example
    PROCEDURE Create_N_Column_Number_Table (n NUMBER) IS
    my_stmt VARCHAR2(2000);
    BEGIN
    my_stmt := 'create table tmp(COL1 NUMBER';
    FOR I in 2..N LOOP
    my_stmt := my_stmt||',COL'||TO_CHAR(i)||' NUMBER';
    END LOOP;
    my_stmt := my_stmt||')';
    ** Now, create the table...
    Forms_DDL(my_stmt);
    IF NOT Form_Success THEN
    Message ('Table Creation Failed');
    ELSE
    Message ('Table Created');
    END IF;
    END;

  • Oracle to Mysql character set conversion problem!!! PLZ IGNORE

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    I have another post in Heterogeneous Connectivity forum
    Re: Oracle to Mysql character set conversion problem!!! PLZ HELP
    Kindly update your comments there,
    @@@@@@@@@@@@@@2
    Appreciate your help,
    regards
    Edited by: user10243788 on Apr 21, 2010 3:25 AM

    It is OK to post a globalization-related question in this forum in addition to the forum pertaining to the main technology. Not all experts follow all possible forums on OTN. Of course, you should cross-link the posts to let people merge the answers.
    Regarding the problem itself, make sure that SQL*Plus has the right NLS_LANG setting in the environment. On Windows, in the Command Prompt:
    C:\> set NLS_LANG=.WE8PC850
    C:\> sqlplus ...On Unix:
    $ setenv NLS_LANG .WE8ISO8859P1   (or NLS_LANG=.WE8ISO8859P1; export NLS_LANG)
    $ sqlplus ...-- Sergiusz

  • "Select * into table internal_table from database_table" in native SQL

    Dear All,
    Is it possible to insert into internal table from database table in native sql instead of open sql? Regarding single values it's clear, just to use ":variable_name". But how to map internal table? RDBMS Oracle version > 9. If it's possible and you know how to do it, please, give some code example.
    Thank you,
    Pavel

    Hi ,
    Here is the code snippet for the native sql .
    select * from zwf_role into table i_wfroles." where role_id ='CAO'.
      loop at i_wfroles into wa_wfroles.
        EXEC sql.
          insert into   ROLES_MASTER_SAP
                 values (:wa_wfroles-ROLE_ID,:wa_wfroles-ROLE_NM,
                        :wa_wfroles-ROLE_DESC,:wa_wfroles-PAR_ROLE_ID,
                        :wa_wfroles-WF_ROLE_ORDER,:wa_wfroles-ROLE_TYPE )
        ENDEXEC.
        if sy-subrc = 0 .
          suc_rec_cnt = suc_rec_cnt + 1.
        else.
          fail_rec_cnt = fail_rec_cnt + 1.
        endif.
    *              ( ROLE_ID,ROLE_NAME, ROLE_DESC,PARENT_ROLE_ID,ROLE_ORDER,
    *                  ROLE_TYPE )
      endloop.
    zwf_role database table has the same files
    Regards
    Girish

  • SQL: select into

    Hello. In both sybase and sql server, you
    can create on-the-fly tables in sql by
    simply doing a
    select column
    into newtable
    from oldtable
    where blahblahblah
    When I do the same in sql (not pl/sql)
    I get the following error:
    SQL> select empno
    2 into myemp
    3 from emp
    4 where ename = 'SMITH';
    into myemp
    ERROR at line 2:
    ORA-00905: missing keyword
    Is it possible to do this kind of select into
    in Oracle?
    Thanks!

    I believe the syntax you're looking for is:
    create table <tablename>
    as select *
    from (<original statement>)
    More examples are available in the Migration Workbench docs

  • Pl/SQL Select Into

    Hello,
    is there a difference between the command 'select into' in Regions with 'pl/sql function returning Query' and 'Pl/sql amonymous block'.
    select MAX(maxgroups) into groupno from Table where trackid=:P_ITEM2 and col1=:P_ITEM2;
    This statement works only in the Region-'Pl/sql amonymous block.
    Can somebody help me please,
    I really can't find the reason!
    Moni

    Hi Marc,
    I' ve found out that the select statement works, the problem is that the items have no value.
    When I display the content of the item in the Region-Topic ‚Test – &P32_Item.’ it is displayed correctly.
    Maybe I’m calling the item in the pl/sql in a wrong way??
    lg
    Moni

  • I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "manage local device storage usage." How?

    I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "Cannot Download.  There is not enough available local storage to download these items.  You can manage your local device storage usage in Settings."
    How can this be the case when I haven't changed any apps from before updrading to iOS6, and I don't have any music yet on the phone?  Why is it telling me there is not enough local space?

    Hi RileyAvaCadenRiver,
    If you recently updated your iPhone to iOS7, you will need to update iTunes on your computer to iTunes 11.1 or newer for it to correctly recognize the iPhone. You may find the following link helpful:
    Apple: iTunes 11.1.1
    http://support.apple.com/kb/DL1614
    Regards,
    - Brenden

  • Oracle SQL*PLUS has encountered a problem and needs to close

    When I have done like below,
    C:\Documents and Settings\himanshu.chaudhari>sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 14 07:38:22 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn sys@dev as sysdba
    Enter password:
    Connected.
    SQL> spool e:/spool/test.log
    SQL> @e:/spool/ms_script.sql
    Got error like ,
    Oracle SQL*PLUS has encountered a problem and needs to close. We are sorry for the inconvenience.
    AppName: sqlplus.exe     AppVer: 0.0.0.0     ModName: oranls10.dll
    ModVer: 10.2.0.1     Offset: 0005d6ff
    I am using,
    Operating System: Microsoft Windows XP Professional Version 2002 Service Pack 3,
    Have two different oracle client on same drive
    1) 10.2.0.1.0
    2) 8.1.7.4.0
    I have tried,
    Run selecthome.bat from BIN but got same error,
    Run sqlpus.exe from particular home then also got same error..
    So , Please anyone can have some idea regarding the same ?

    Is there any other error in error.log file?
    What do you run in that (ms_script) script?
    Have you used both sqlplus?
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Oracle SQL*PLUS has encountered a problem and needs to close.  We are sorry

    I have installed oracle10g release2(10.2.0.1.0) in my system
    my porblem when i am trying to issue command
    SQL> commit;
    Commit complete.
    SQL> cl scr;
    then it is show below mentioned error
    Oracle SQL*PLUS has encountered a problem and needs to close. We are sorry for the inconvenience.
    Please can anybody help for me.
    with regards,
    srinivas.

    When working with mixed environments you should make sure the path environment variable is consistent with the executables you are currently running, and try not to mix them, i.e. if you are working with the sqlplus from 9i, make sure you execute the sqlplus.exe file from the 9i oracle home and temporarily by means of a batch file put your Oracle Home 9i executables prior to those of 10g , and the other way around, when executing from the 10g make sure all executables and paths are consistent. It should be easier since when installing oracle, oracle configures the PATH environment variable so it can be seen first in the path environment variable.
    In your case you are using two compatible versions, but if the dll's get mixed there could be unexpected results.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • SELECT INTO clause strange problem

    Hi all,
    I need some help with a very strange select into statement.Select into throws NO DATA exception even if table has data.
    I am trying to invoke procedure from BPEL.Inside the procedure,I am trying to get "name' from definitions table.But it always throws Data NOT Found exception.But table has relevant data and i am able to see the data by executing the same query outside the BPEL environment/flow(SQL PLUS).
    Also,I kept dummy test table for Debugging purpose and it inserted with temp value '103'.
    My procedure looks like below
    temp:='103';
    INSERT INTO test
    VALUES ('Test-1' ||dummy,sysdate);
    commit;
    SELECT name
    INTO p_name
    FROM definitions
    WHERE id =temp;
    Please help me in this regards
    Thanks in advance.

    Hi Frank,
    Thanks for quick response.
    My actual query is
    dummy:=assume getting_valid_value from BPEL(also same dummy inserting into temp value);
    SELECT organization_code
    INTO p_warehousename
    FROM org_organization_definitions
    WHERE .organization_code = dummy;
    What are the schemas involved? APPS
    (Who owns the table?
    Who own the procedure? APPS
    Is it defined with "AUTHID CURRENT_USER"? NO IDEA
    Who runs it when you get the error? Thru BPEL actually
    What runs the same query in SQL*Plus and sees a row?). v*alid value(ALF)*
    I checked with low level security query as it returns nothing.
    thanks

Maybe you are looking for