Illegal use of LONG datatype error message when i create materialized view

Hello to all
I want create read only materialized view replication environment two of our tables have LONG datatype when i create materialized view against on them
I recieve this error message
CREATE MATERIALIZED VIEW MDB.TOAD_PLAN_TABLE TABLESPACE aramis REFRESH FORCE WITH ROWID AS SELECT * FROM MDB.TOAD_PLAN_TABLE@arahisto
Error report:
SQL Error: ORA-00997: illegal use of LONG datatype
00997. 00000 - "illegal use of LONG datatype"
Do you know any resort solution for it?
thanks

You can not use longs in materialized views over a database link, you can however take a part of a long over to a materialized view.
I have gotten this to work in the past l had to create a PL/SQL function that you can use to extract the character data from the long column and use that to
as part of the function you will need to pass in the columns of the table that will identify the unique records so you can pick out the long column
example function
-- you will need to make sure this funtion is in the remote location as you can not select longs accross a DB LINK.
CREATE OR REPLACE FUNCTION MDB.TOAD_PLAN_LONG_CONV
(pass in the primary key columns for the table)
RETURN VARCHAR2
IS
v_long VARCHAR2(32767) ;
BEGIN
BEGIN
-- need to select the long column into the PL/SQL variable
SELECT long_column
INTO v_long
FROM MDB.TOAD_PLAN_TABLE
WHERE key_columns = passed columns ;
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = '-01406' THEN
NULL ;
ELSE
RAISE ;
END IF ;
END ;
RETURN SUBSTR(v_long,1,4000) ;
END ;
Then when you create the materialized view utilize that function on the long column.
create or replace materialized view MDB.TOAD_PLAN_TABLE TABLESPACE aramis REFRESH FORCE WITH ROWID
AS
SELECT column1, .... columnx,
MDB.TOAD_PLAN_LONG_CONV@arahisto (primary key column list) as long_column_name
FROM MDB.TOAD_PLAN_TABLE@arahisto ;
See if this will work for you? Keep in mind however this solution will not get the entire long column only as much as a PL/SQL variable will hold of it.
Mike

Similar Messages

  • Illegal use of LONG datatype

    While I was insert a rows into the same table I am getting an error. I am having one long column in table list. I am getting following error while I was inserting a row.
    ORA-00997: illegal use of LONG datatype
    Please let me know how do I insert long data type values for this kind of insert.

    [duplicate thread|http://forums.oracle.com/forums/message.jspa?messageID=3770321#3770321]

  • ORA-00997: illegal use of LONG datatype - while inserting a record

    Hello,
    I have this table:
    create table TEST
    USER VARCHAR2(20) not null,
    WINCFG LONG RAW
    There are a few records, some with user='OLDUSER'.
    I want to add new records with a statement like this one:
    insert into TEST
    select 'NEWUSER',wincfg from TEST where user='OLDUSER'
    But Oracle returns the error:
    "ORA-00997: illegal use of LONG datatype"
    I have no idea...
    Thank you

    SQL> insert into TEST
      2  (
      3  select 'NEWUSER',wincfg from TEST where user='OLDUSER'
      4  );
    select 'NEWUSER',wincfg from TEST where user='OLDUSER'
    ERROR at line 3:
    ORA-00997: illegal use of LONG datatype
    SQL> copy from scott/tiger@mydb insert test using select * from test;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
       1 rows selected from scott@mydb.
       1 rows inserted into TEST.
       1 rows committed into TEST at DEFAULT HOST connection.Hope it help

  • I keep getting an error message when I try to view downloaded TV programme, I keep getting an error message when I try to view downloaded TV programme

    Ive downloaded a TV programme on itunes and when I click to view it I get an error message "itunes has stopped working" and it shuts down
    Please help

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • ORA - 00997 Illegal Use Of Long Datatype when no Long is used

    I have a query that was working fine for years. We have upgraded to 10.2.0.5 on a test instance and we now get this error.
    The view in the FROM clause is an org specific view on xxc_affi_relation_headers_all. All of the fields in the view and underlying table are either VARCHAR2, NUMBER, or DATE.
    I have simplified the query to one that still gives the error.
    The query is:
    SELECT *
    FROM xxc_affi_relation_headers xarh
    WHERE xarh.affi_relation_id = (select xarh.affi_relation_id
    from xxc_affi_relation_headers xarh
    where xarh.execute_vendor_id = 125
    connect by prior xarh.affi_relation_id = xarh.parent_relation_id
    start with xarh.affi_relation_id = 214
    If I run the sub query by itself, as below, there is no error and the result is 214.
    select xarh.affi_relation_id
    from xxc_affi_relation_headers xarh
    where xarh.execute_vendor_id = 125
    connect by prior xarh.affi_relation_id = xarh.parent_relation_id
    start with xarh.affi_relation_id = 214
    If I run the main query and replace the sub query with 214, as below, thre is no error.
    Is there something that would cause an implicit conversion to a LONG datatype in this query? I am not able to find a reason for this error message that fits the query.
    The original query that caused the error was:
    SELECT xarh.affi_relation_id
    FROM
    xxc_affi_relation_headers xarh
    WHERE NOT EXISTS (SELECT 1 FROM xxc_oe_order_line_dist xold
    WHERE xold.line_id = p_line_id AND xold.dist_type = 'I'
    AND xold.affi_relation_id = xarh.affi_relation_id)-- 1704
    AND v_creation_date
    BETWEEN NVL(xarh.start_date,v_creation_date-1) AND NVL(xarh.end_date,v_creation_date+1) --ES fix not a valid month
    AND xarh.sale_segment1 = (SELECT gcco.segment1 --RT 9631
    FROM oe_transaction_types_all otty, ra_cust_trx_types_all rctt, gl_code_combinations gcco
    WHERE otty.transaction_type_id = p_order_type_id
    AND otty.cust_trx_type_id = rctt.cust_trx_type_id
    AND rctt.gl_id_rev = gcco.code_combination_id )
    AND EXISTS(SELECT 1 FROM xxc_affi_relation_lines xarl WHERE xarl.affi_relation_id = xarh.affi_relation_id
    AND NVL(xarl.element_value,v_item_type) = v_item_type)
    connect by prior xarh.parent_relation_id = xarh.affi_relation_id
    Start with
    xarh.affi_relation_id = (select xarh.affi_relation_id
    from xxc_affi_relation_headers xarh
    where xarh.execute_vendor_id = p_vendor_id
    AND xarh.affi_relation_id != p_parent_relation_id
    AND NOT EXISTS (SELECT 1 FROM xxc_affi_relation_headers xarh2
    WHERE xarh2.parent_relation_id = xarh.affi_relation_id)
    AND v_creation_date BETWEEN NVL(xarh.start_date,v_creation_date-1) AND NVL(xarh.end_date,v_creation_date+1)--ES fix not a valid month
    start with xarh.affi_relation_id = p_parent_relation_id
    connect by prior xarh.affi_relation_id = xarh.parent_relation_id)
    --ORDER BY NVL(parent_relation_id,-1), NVL2(xarl.element_value,1,2)
    ;

    Its a bug
    See this Oracle Document
    Bug 9726739 - ORA-997 from SQL with CONNECT BY and UNION [ID 9726739.8]
    Best Regards
    mseberg

  • Firefox 4.0 is my default browser, and I am receiving a script error message when I try to view online images in Family Tree Maker 2011, a genealogy program. Have not had problems until Firefox 4.0. Can't seem to find a setting in Firefox to fix this.

    Error is as follows: Line: 63 Char: 4344 Error: Unable to get value of the property 'offsetHeight': object is null or undefined Code: 0 URL: http://yui.yahooapis.com/combo?2.8.0/build/yuiloader-dom- event/yuiloader-dom-event.js&2.8.0/build/dragdrop/dragdrop- min.js&2.8.0/build/stylesheet/stylesheet- Do you want to continue running scripts on this page? Y/N buttons."

    I see. Well, I just tried to make IE my default browser, but it did not solve the problem. I receive the same script error when I view the image. (I may not have explained this thoroughly enough at first - I do get to view the image after answering the error message, but the print button embedded in the window doesn't work. Before, I never had a problem with viewing or printing.)
    I imagine that at this point I will either need to communicate this to the IE people, or possibly revert to an older version of IE.

  • Error Message when we create a Service Ticket in SAP CRM 2007

    Hi All we are having a serious production issue when we create a S.Ticket in SAP CRM 2007 We get the following error message we are not trying to send any information to R/3 We have a planned go live this saturday. So any help would be greatly appreciated.
    An error occurred in system EDIES during account assignment
    Message no. CRM_ORDER_MISC 060
    Diagnosis
    Errors occurred when assigning an account assignment object to a business transaction. To view the error message, see the accompanying log file.
    Transfer Log
    No controlling type could be determined (Notification E IAOM 012)
    No controlling type could be determined (Notification E IAOM 012)
    Regards
    Sathya

    Hi,
    I have looked into your issue.
    For this service ticket, kindly check the Org Unit maintained in Transaction and table OFIC_BILLORG_SRV are same. If not same kindly make changes in the following path in SPRO.
    ==> SAP Implementation Guide
    ==> Customer Relationship Management
    ==> Organizational Management
    ==> Cross-System Assignment of Organizational Units
    ==> Assign Billing Units to Service/Sales Organizations
    If the above information is not helpful kindly take a look at note 861116.
    I hope this helps.
    Regards,
    Venkat

  • Error message when trying create image from RAID

    I am trying to backup my RAID (697 GB) by creating an image (Disk Utility) on an external firewire drive. The settings are Read Only - I get an error message "image/device is too large"
    Is my RAID too large at 697GB to create an image?
    Thanks,
    Steven
      Mac OS X (10.4.3)  

    You have all 4 drives striped on the external drive?
    I'm not sure it will work -- an image may need to have 2x its actual size during creation. I'd have to check to be 100% sure.
    I think, though, it would be a lot better if you just did a pure "dupe," of the files from one volume onto another, rather than creating an image. It will be a ton easier.

  • ORA-00997 - Illegal use os LONG Datatype

    Hello
    I'm having this error in my query, and I know I can't use one column LONG with a INSERT statement, but I can't change this column to VARCHAR2(4000) because of the short space.
    Somebody have the solution for this? Or how I make this insert? Some function or procedure... anything...
    Tnks
    Rafael

    Since you cannot use LONG into a INSERT...SELECT... statement, you may use a procedure with a loop.
    By the way, what about CLOB ?
    Nicolas.

  • Illegal use of LONG

    I create on table say "TAB" with a column as long datatype
    create table tab
    (name long);
    now i need to create another table structure similar to "TAB" say "TMP_TAB"
    create table tmp_tab
    as
    select * from tab;
    But this gives the following error..< ORA-00997: illegal use of LONG datatype >
    Can anyone please explain me the reason for the following error?

    If you have Oracle 9i, then
    Quick and correct solution: Don't use LONG - Datattype !
    It's obsolete, use CLOB instead.
    If LONG- Datatype is inevitable (why ?), then
    declare
    v_sql VARCHAR2(32767);
    begin
    select dbms_metadata.get_ddl('TABLE', 'TAB', 'SCOTT') INTO v_sql
    from dual;
    v_sql := replace (v_sql, '"SCOTT"."TAB"', '"SCOTT"."TMP_TAB"');
    execute immediate v_sql;
    end;
    /but it's a bit tricky ....

  • Create Materialized view Error ORA-22818

    Hi,
    I am creating a materialized view based on a complex query with inline queries, below is a simplified version of the query:
    CREATE MATERIALIZED VIEW CM_FA_PEND_mvu
    TABLESPACE CISTS_TH
    BUILD IMMEDIATE
    REFRESH COMPLETE
    ENABLE QUERY REWRITE
    AS
    SELECT/*+ index (a,XT094S3) index (b,XT232S1) index (c, XM143P0) index (d, XM185S1)*/
    a .fa_id,
    a.fa_type_cd,
    a.fa_status_flg,
    a.disp_grp_cd,
    (SELECT dl.descr
    FROM ci_disp_grp_l dl
    WHERE dl.disp_grp_cd = a.disp_grp_cd AND dl.language_cd = 'ENG')
    disp_grp_cd_descr
    FROM ci_fa a,
    ci_sp_mtr_hist b,
    ci_mtr_config c,
    ci_reg d,
    ci_fapr_faty e
    WHERE a.fa_type_cd = e.fa_type_cd
    AND a.sp_id = b.sp_id(+)
    AND b.mtr_config_id = c.mtr_config_id(+)
    AND c.mtr_id = d.mtr_id(+)
    AND a.fa_status_flg = 'P'
    AND e.fa_type_prof_cd = 'METERED'
    AND ( (b.removal_dttm IS NULL))
    I am getting error "ORA-22818: subquery expressions not allowed here". the problem is in columns "disp_grp_cd_descr" (when I remove this column from the query, the MView is created successfully)
    Is using inline queries as columns a limitation on creating materialized view?
    Is there a workaround ?
    Thanks
    AK

    No version and no exception ... the full text is necessary the number alone insufficient ... to help you much other than recommend you read this:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10810/basicmv.htm#DWHSG8195
    where it says:
    "The SELECT clause in the materialized view creation statement defines the data that the materialized view is to contain. Only a few restrictions limit what can be specified. Any number of tables can be joined together. Besides tables, other elements such as views, inline views (subqueries in the FROM clause of a SELECT statement), subqueries, and materialized views can all be joined or referenced in the SELECT clause. You cannot, however, define a materialized view with a subquery in the SELECT list of the defining query. You can, however, include subqueries elsewhere in the defining query, such as in the WHERE clause."
    Something you could have found in a second or two in the docs at http://tahiti.oracle.com by searching for "Materialized Views Restrictions"
    But without your version and the actual error message this may not apply.

  • I bought a mac companion for my desktop mac running os x but received the following error message when I tried to install the quikprotect software download:  "power pc no longer supported."  I did not read that anywhere when investigating.  What gives?

    I bought a mac companion for my desktop mac running os x but received the following error message when I tried to install the quikprotect software download:  "power pc no longer supported."  I did not read that anywhere when investigating.  What gives?

    PPC, also known as PowerPC has not existed on Macs since the beginning of 2006.  Apple made a bridge software and included it with Mac OSes until 10.6.8 known as Rosetta that would allow you to run software written for the PowerPC Macs.  10.7 and later can't run that bridge software.  You have one of several options:
    Install 10.6 retail on a USB Flash drive, and run that application while booted from there.
    Find an update designed for 10.7 or later of the software. 
    Find a combination of Virtualbox or Paralllels that can legally run a version of 10.6 side by side with your 10.7 software.
    Run Windows on your Mac with Virtualbox or use CrossOver that requires no Windows to run a Windows version of your application.
    Your Mac is an iMac Intel.   I will ask a moderator redirect your thread to the 10.7 forum, and no action is needed on your part.

  • I'm getting a error message when using Apple Configurator "unable to send ClearPasscode command to device"

    I'm getting a error message when using Apple Configurator "unable to send ClearPasscode command to device"

    Yes, that is correct.  My spreadsheet has the following information in those cells if you want to compare yours on Monday:
    Product Type
    Application
    |
    AdamId:
    <and a 9 digit number>
    I ended up bringing the Macbook Pro home with me after struggling with it for a half hour at the end of a long day. I called and within 5 minutes the problem was corrected.  The technician said they were getting calls all day. 

  • Error message when launching PowerPivot Window using Excel 2010

    I have installed the latest version of Powerpivot on several of our workstations.  Some of them are running the application just fine and some of them are getting an intermittent error message when trying to launch the PowerPivot Window.
    We are running Windows 7 ENT 32bit with Office 2010 32bit
    The error message given is : An operation that uses the database driver could not be completed.   If the driver is a Microsoft driver, make sure the drvier file isn't damaged, and if it is, reinstall the driver by re-installing Microsoft Query.  
    You can then try again and it will work.
    In fact the majority of the time this error message won't appear.
    The application has been removed and reinstalled.
    When I checked event viewer i'm finding this error which I think is related
    The description for Event ID 1 from source MSOLAP$LocalCube cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    MSOLAP$LocalCube cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted.
    Hello,
    It's just a guess: Power Pivot uses the MSOLAP = "Microsoft OleDB Provider for OLAP" and maybe that Provider is damaged on the machine. You may try to reinstall the Provider, you can get the installer named "SQL_AS_OLEDB.msi" from
    Microsoft® SQL Server® 2012 SP2 Feature Pack  =>
    ENU\x86\SQL_AS_OLEDB.msi (for 32 bit)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,-

    how can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,…"

    It sounds like if you open Preferences in Word there will be a place where you can specify where to store autorecover files. Right now it sounds like it's pointing to somewhere that doesn't exist.

Maybe you are looking for

  • Cannot automatically connect to wi-fi after restart

    Hi all, I just set up my E1200 router to my PC running Windows 7 and it works perfectly in my house, except that after I restart or power off my computer, I have to manually reconnect to my wi-fi network everytime and re-enter my password. The check

  • Iphone 3g stuck in recovery mode(error 14) after failed 3.2.1 update

    My Iphone is stuck in recovery mode after it failed to update to operating system 3.2.1 . When I press restore in itunes, the process stops at around the 20% mark and come up with error 14. I have already manually deleted and redownloaded the update

  • Roxio won't die

    My partner and I are running Windows XP on our respective machines. While we were using the previous version of the Blackberry Desktop software, every time we rebooted, Windows Installer popped up and tried (unsuccessfully) to install the Roxio Media

  • DB Update from BAPI

    Hi All, I am trying to create a RFC FM ( BAPI) which will be called from external system. The role of this FM is insert to 3 different  Z tables.  Table structure's  is like Header, Details & Sub details. Requirement is if the insert/update fails on

  • Certain songs inaccessible in shared library

    I'll try to keep this as concise as possible. I have all of my music in my iTunes library on my iMac. All of it is accessible and all the files play correctly. I have the library shared and access the library from my Macbook Pro. Everything works as