Select LONG column from Remote table

Hi to all.
I have the following problem: I can't select a LONG column from remote database, when there are Join operation in the query. Example:
SELECT long_column FROM remote_table@DB
-> that's OK, but:
SELECT long_column FROM remote_table@DB INNER JOIN remote_table2@DB ON ...
-> returns: "ORA-00997: Illegal use of LONG datatype"
I cannot even perform (because there a LONG column in the joined table):
SELECT nonlong_column FROM remote_table@DB INNER JOIN remote_table2@DB ON ...
That's very strange to me because:
SELECT long_column FROM local_table INNER JOIN local_table2 ON ...
-> is OK!
Can someone help me to SELECT a long column from remote in SELECT query with JOIN clause!
Thanks a lot!

Hi
"Distributed queries are currently subject to the restriction that all tables locked by a FOR UPDATE clause and all tables with LONG columns selected by the query must be located on the same database. " by otn docs.
I have no idea.
Ott Karesz
http://www.trendo-kft.hu

Similar Messages

  • Select sql running very long when made to select many columns from a table

    Hi,
    I am using an Oracle DB 10g. I have a table with 250 columns and I need to select 200 columns out of them. The table holds around 0.1 million rows. But when I run the select sql it takes 15 mins to return .1 million rows. Where as if I select only 10 or 15 columns the sql runs in less than a minute returning same number of rows. My sql looks like below:
    select p.col1,p.col2,.......,p.col200
    from table Parent p;
    The table also has a Primary key Index but it does not seem to be using it even when I forced an Index hint. Could you pls help?

    961796 wrote:
    I am using an Oracle DB 10g. I have a table with 250 columns and I need to select 200 columns out of them. The table holds around 0.1 million rows. But when I run the select sql it takes 15 mins to return .1 million rows. Where as if I select only 10 or 15 columns the sql runs in less than a minute returning same number of rows. My sql looks like below:
    As Sven points out, it is likely that most of your time is network (and client) time. You are sending 20 times as much data (based on column counts, at any rate) across the network, and concerned that it's taking 15 times as long.
    If you're testing from SQL*Plus then setting the arraysize to a value larger than the default might help.
    If you have control over the SQL*Net settings then you may get some benefit by adjusting the SDU sizes at both ends of the link.
    If you have control over the tcp configuration (transmit and receive buffer sizes) then you may get some benefit by adjusting these.
    Simple test, by the way, if you're on SQL*Plus
    set autotrace traceonly statistics
    select ...This will dump your data in the bit bucket as it arrives giving you
    a) the database time plus network time
    b) some statistics including the volume of data down the network and the number of network round-trips that Oracle saw.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Author: <b><em>Oracle Core</em></b>

  • Selecting only columns from a table

    Could someone help me with a SQL query to select all the columns in a table as an array?

    Hello
    if you are on 9i upward, you can define a pl/sql table of the rowtype and use bulk collect to populate that table, otherwise, you can create separate array types for each column:
    create table dt_test_tab (id number, col1 varchar2(10));
    insert into dt_test_tab values(1, 'X');
    insert into dt_test_tab values(2, 'X');
    insert into dt_test_tab values(3, 'X');
    insert into dt_test_tab values(4, 'X');
    insert into dt_test_tab values(5, 'X');
    commit;
    declare
        type tt_TestTab is table of dt_test_tab%rowtype index by binary_integer;
        type tt_TestTabid IS TABLE OF dt_test_tab.id%type index by binary_integer;
        type tt_TestTabcol1 IS TABLE OF dt_test_tab.col1%type index by binary_integer;
        lt_TestTab     tt_TestTab;
        lt_Id          tt_TestTabId;
        lt_col1        tt_TestTabcol1;
    begin
        --use the rowtype array
        select
             id,
             col1
        BULK COLLECT INTO
             lt_testtab
        FROM
            dt_test_tab;
       --use the individual column arrays
        select
             id,
             col1
        BULK COLLECT INTO
             lt_id,
             lt_col1
        FROM
            dt_test_tab;
        dbms_output.put_line('loop through the rowtype array');
        FOR x in lt_TestTab.FIRST..lt_TestTab.LAST LOOP
           dbms_output.put_line(to_char(lt_TestTab(x).id)||to_char(lt_TestTab(x).col1));
        end loop;
        dbms_output.put_line('loop through the two column arrays');
        FOR x in lt_Id.FIRST..lt_Id.LAST LOOP
           dbms_output.put_line(to_char(lt_Id(x))||to_char(lt_Col1(x)));
        end loop;
    END;

  • Selecting a column from a table conditionally

    I'm trying this select statement (example):
    select np.phone_number from name_phone np, reservation_general_view rgv
    where rgv.resort='HVILLA'
    In this table there is a column called "phone_type" and I only want my column to display values that are associated to the column when the "phone_type" = 'EMAIL'
    I tried this:
    select np.phone_number(select np.phone_number from name_phone np where np.phone_type='EMAIL')
    from name_phone np, reservation_general_view rgv
    where rgv.resort='HVILLA'
    This doesn't seem to work...can someone tell me how to do that?
    Message was edited by:
    JonnyOpera

    select phone_number from name_phone
    where resort='HVILLA'
    and phone_type='EMAIL'

  • Selecting date column from a table

    hi
    I have a problem that looks wierd for me.
    I have a table called blog_post which has a date field called publish_date
    I have done this first.
    alter session set nls_date_format='dd/mm/yyyy';
    then
    SQL> select publish_date from blog_post;
    PUBLISH_DA
    09/07/2007
    02/07/2007
    02/07/2007
    02/07/2007
    09/07/2007
    now the wierd thing is that when i am selectin the same date it is not returning anything
    SQL> select publish_date from blog_post where publish_date='09/07/2007';
    no rows selected
    Thanks for any help.
    Ganesh

    I don't know anything about Hibernate, but the reason why you need to specify the trunc(publish_date) = to_date('09/07/2007','dd/mm/yyyy') is because of the way that Oracle stores date/time internally.
    It's labelled as a date field, but the time is automatically stored as well. So, if you're just wanting to compare the date to another date, you need to ignore the time part of the column - the trunc function does this.
    As for the "to_date(<date>, <date mask>)", well, you want to compare a date to a date, not a string. You could rely on the implicit conversion, governed by the nls settings, but I really, really, really wouldn't. In fact, I can't stress enough how much of a bad idea that would be! It's best to make things explicit.

  • Selecting columns from two table is slow but same

    I am selecting 27 columns from two tables
    which running for more than 30 minutes. but
    if I select count(*) with the same query
    except the columns it is coming in seconds.
    Where is the error?

    If you post
    1) The table definitions for the underlying tables
    2) The indexes that are on the tables
    3) The two SQL statements you're running
    4) The explain plan for both statements
    we can probably be of some assistance.
    My guess is that the count(*) is able to return much more quickly because the optimizer is able to use a significantly faster query plan that is based on an index which the longer-running query cannot utilize. Without the information I've requested, though, it's hard to do more than speculate.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How can I select columns from a table EMP, using Select statement?.

    Hi Friends,
    How can I select columns from a table EMP?.
    I want to select columns of EMP table, using select statement.
    Please reply me urgently.
    Shahzad

    Something like this:
    scott@DBA> select empno,ename,job from emp;
         EMPNO ENAME      JOB
          7369 SMITH      CLERK
          7499 ALLEN      SALESMAN
          7521 WARD       SALESMAN
          7566 JONES      MANAGER
          7654 MARTIN     SALESMAN
          7698 BLAKE      MANAGER
          7782 CLARK      MANAGER
          7788 SCOTT      ANALYST
          7839 KING       PRESIDENT
          7844 TURNER     SALESMAN
          7876 ADAMS      CLERK
          7900 JAMES      CLERK
          7902 FORD       ANALYST
          7934 MILLER     CLERK
    14 rows selected.Check the documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9697
    Message was edited by:
    Delfino Nunez

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • Getting LONG RAW from remote database

    Hi,
    I have a table in my local database that has a LONG RAW column . I have another table of similar structure in a remote database (so it has LONG RAW as well). I would like to transfer data including LONG RAW data from the remote database into the local database table using PL/SQL. I know it is not possible to copy LONG RAW over dblink directly. Can anyone suggest an approach to accomplish this?
    The local table cannot be changed to BLOB, but I have the flexibility to change the remote table to use BLOB. So, can anyone tell me if the following solution would work. If so, can you shed some light on what PL/SQL libraries to use or can you provide me with some sample code to implement steps 3 and 4 below?:
    1. Change the remote table to use BLOB
    2. Create a new temporary table with BLOB in the local database.
    3. Copy data using PL/SQL from remote BLOB to local temporary table BLOB.
    4. Copy data using PL/SQL from BLOB to LONG RAW within the local database from temporary table (w/ BLOB) to the actual target table (w/ LONG RAW).
    I think step 3 can be a direct Insert-Select from remote table (I'll try this myself), but not sure how to go about step 4.
    Thanks for your help.

    There is a chapter in the Oracle Application Developer's Guide on calling external procedures
    I don't know enough about VB and the available VB APIs to know for sure. I would assume that VB could be configured to generate a DLL with a C call specification. I would also assume that there was a VB API that would allow you to manipulate LONG RAW and BLOB data. Unfortunately, though, I don't know which VB API's have that functionality.
    Justin

  • Select LONG column into CLOB variable

    Hi all,
    I am trying retrieve the data present in a LONG column into a CLOB variable.
    However I am getting an error, pls let me know how I can resolve it.
    DECLARE
    v_text CLOB;
    BEGIN
    SELECT TO_LOB(trigger_body)
    INTO v_text
    FROM
    user_triggers
    WHERE
    ROWNUM <= 1;
    END;
    ERROR at line 8:
    ORA-06550: line 8, column 20:
    PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    ORA-06550: line 8, column 5:
    PL/SQL: SQL Statement ignored
    Let me know if there is an alternate to this. I would like to get the data present in the LONG column into a variable.
    The reason why I am not retrieving the LONG column into LONG variable is stated below (from Oracle Website):
    You can insert any LONG value into a LONG database column because the maximum width of a LONG column is 2**31 bytes.
    However, you cannot retrieve a value longer than 32760 bytes from a LONG column into a LONG variable.
    Thanks and Regards,
    Somu

    There are couple of things I did (listed in order):
    1) Create Global Temporary Table containing a CLOB column
    2) Select LONG column and convert to CLOB by using TO_LOB and insert into Global Temporary Table containing a CLOB column
    2) Select from this Global Temporary Table (which already contains data in CLOB) and assign it to a CLOB variable.
    This is done because you can not directly use TO_LOB in a select statement to assign the value to a CLOB variable.
    Stated below is an example:
    -- Create Temporary Table
    CREATE GLOBAL TEMPORARY TABLE glb_tmp_table_lob(
    time TIMESTAMP WITH LOCAL TIME ZONE,
    text CLOB
    ON COMMIT DELETE ROWS;
    -- PL/SQL Block to Execute
    DECLARE
    v_clob CLOB;
    BEGIN
    -- Insert into Temporary Table by converting LONG into CLOB
    INSERT INTO glb_tmp_table_lob (
    time ,
    text
    SELECT
    sysdate ,
    TO_LOB(dv.text)
    FROM
    dba_views dv
    WHERE
    ROWNUM <= 1
    -- Select from the Temporary table into the variable
    SELECT
    gt.text
    INTO
    v_clob
    FROM
    glb_tmp_table_lob gt;
    COMMIT;
    -- Now you can use the CLOB variable as per your needs.
    END;
    /

  • Count(*) , group by with multiple columns from multiple tables involved

    Hi all,
    I am relatively new to SQL.
    Currently I have these few requirements, to display quite a number of fields from 3 tables for display of report.
    In my query I need to:
    1.) count(*)
    2.) select quite a number of fields from table 1,2,3
    However when count(*) is used, grouped by has to be used to.
    How do I actually use group by with so many columns to be selected?
    I have actually used the query below, but the count(*) returns 1, the correct output should be 3 instead.
    select count(*), table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    from table1, table2, table3
    where
    <conditions>........................
    group by table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    I know this group by statement looks very unrefined. How can I select multiple fields from different tables, and yet get the count(*) correctly?
    Thank you so much for your time.

    Hmm yes it actually does return count as 1 for each row. But there are 3 rows returned. E.g.
    ctr table1.col1 table1.col2 ..........
    1 value1 value1
    1 value2 value3
    1 value3 value4
    If I put the count(*) outside, it returns 3 , the correct output
    ctr
    3
    select count(*) from
    select table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    from table1, table2, table3
    where
    <conditions>
    group by table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    Thus I was wondering if it was the group by of multiple colns that resulted in the count stucked at value 1.

  • Including column from fact table reduces number of rows returned

    Hello
    I am facing this issue where in a report I select 5 columns from a fact table. Out of these five columns one of the column is "Amount" for which the aggregation rule is defined as Sum in RPD.
    When I include these five column and filter results based on some criterion , I get all the rows (three rows) that satisfy the criterion. No I add a sixth column to my report and suddenly I only see one row returned by my report. Addition of this sixth column does not affect the criterion as the criterion is not based on this column. But this sixth column is a calculated column.
    I tried different things but because the report was just getting columns from one table (fact) and suddenly inclusion of one column leads to reduction in number of rows , I was unable to find any reason why would that happen.
    So I thought that some one in community may know that in what scenario this happens.
    Thanks

    Are there any repeated values? I'm wondering if what you're seeing is actually suppression of repetition in the results. Edit the analysis, go to the criteria tab, click column properties, go to the Column Format tab, and change the setting for value suppression from 'Suppress" to "Repeat". Repeat for each of your 6 columns and check the outcome.
    Otherwise, I would try testing with other calculations and also bring in some columns from dimension tables to see how this affects the result. You should be able to come up with a case-by-case scenario to work out exactly what causes the rows to be suppressed which will get us one step to closer to working out why the rows get suppressed.
    Thanks,
    George

  • Select a row from a table and throw an url

    Hi experts,
    I'm trying to select a row from a table in Visual Composer. What I need to do it's to click over this row and throw an Url. At the moment, I've added a column with a Pushbutton with the formula to show the link; it works fine. But I need to do it without buttons just selecting the row.
    Is there anyboby who knows about that?
    Thanks a lot.
    Belen

    Hi
    To do this you will have to use a data store and a guard condition on the line which is triggered by the select action. You need to store a value in the data store each time a select action is performed. The guard condition should check for this and only perform the action when the value in the data store is greater than 0.
    Jarrod Williams

  • Columns from different tables displayed in an ADF table format

    I have a many to one relationship between 2 tables (checklist -> subcontract). I would like to display columns from each table on a web page in an ADF Read Only Table format. I created a method that returns the data I need from the tables. When I drag that method over to my page JDev I'm only allowed to select columns from either the checklist table OR the subcontract table. I need one column from the subcontract table and several columns from the checklist table. I'm using JDev 10.1.3.2 and an Oracle 11g database. Thank you in advance.
    -Wade

    Thank you for your response. I ended up creating a new getter in the Checklist table which refers to the column in the Subcontract table. Then I was able to create a table column for that returned value.
    Thanks again!
    -W

  • Combining the same column from 2 tables with distinct result.

    I have 2 tables with identical name columns. One is current people and the other is historical people. I want a select that returns any name that is in either table. I want each name listed only once. I want to see 1 entry for each name if it is in the current table, the historical table, or both tables. I can easily do a select distinct on each table but how do I join the queries to get 1 result set with no duplicates? The name column is not a key field and I don't want any other columns from either table.

    Just a simple UNION:
    select name
      from current
    union
    select name
      from historical;

Maybe you are looking for

  • Open Skillbuilders modal page from report

    I want to open the Skillbuilders modal page from within a report. The first column in a report represents the primary key of the table the report shows. What is the best way to do that? The idea is this: in the report region, there's a button CREATE

  • Problems maintaining network connectivity in hotels

    I have a problem maintaining internet connectivity when I use hotel WiFi services where you have to "login" first via the web browser. I don't have a problem with the WiFi per se and I have no problems with initial connectivity -- I can login and bro

  • How do you un-disable your iPhone online?

    i accedently typed my password in wrong too many times and now it is disabled for an hour and i finally figured out the right password but i dont know how to un-disable it. i thought you could do it online. HELP.

  • Need help with scripting Jumps

    Hi - hope someone can help me. I'm in over my head. I have a long (4 hrs.) commercial video track separated by dozens of markers (placed earlier in FCP). All my menu buttons work fine, but I want to include a button which serves as an "In-Store" demo

  • Export Quicktime with leading header out of AE CS4

    Hi everyone, I have to get a workflow with the Rosendahl bonsaiDRIVE (portable video and audio multitrack recorder) and After Effects up and running. Unfortunately the only files that server accepts via Ethernet are Uncompressed 8-bit 4:2:2 Quicktime