Create Materialized View ORA-01723: columns of length zero are not allowed

I am trying to create a materialized view that derives from a column of a function and I get: ORA-01723: columns null are not allowed.

I use 10 gr 2 with the following definition (simple version):

CREATE MATERIALIZED VIEW ACES
SELECT
function_name (column_name) alias_de_colonne
FROM table_name;

I even tried to cast it as below:

CREATE MATERIALIZED VIEW ACES
SELECT
Cast (function_name (column_name) AS VARCHAR2 (200)) alias_de_colonne
FROM table_name;

My function has an exception to return a value, even if no value are.

I looked everywhere for the solution. Someone at - there a way around this problem? I really need my function to calculate the column because it has business rules that I can't join in my definition of the materialized view. My only hope around this is to insert values into a table and then create a materialized table view, I don't want to do that if someone has a solution around this.

Any help would be greatly appreciated.

Thank you

Kyle

Published by: Kyle Miller on April 19, 2011 08:28

Have you tried to create a table with the correct structure and then by creating the view materialized, based on the predefined table as described here...

http://www.oaktable.NET/content/ultra-fast-MV-alteration-using-prebuilt-table-option

?

See you soon

Ben

Tags: Database

Similar Questions

  • ORA-01723: columns of length zero are not allowed

    Hello

    I try to combine the 2 tables (one of the tables as a single column and the other has 2 columns)... Here's the query that I'm running

    create the table temp_combine
    as
    SELECT the CITY, NULL AS TABLE_A Prov.
    Union of all the
    SELECT CITY, Prov. OF TABLE_B

    Here is the error message I got:

    ORA-01723: columns of length zero are not allowed

    Please advice, how to solve this problem

    How do I solve this problem

    Or reverse the order of the union of all the

    SELECT CITY, Prov FROM TABLE_B
    union all
    SELECT CITY, NULL AS Prov FROM TABLE_A
    

    or a cast of NULL for the Prov. data type (for example assuming that it is varchar2 (10)):

    SELECT CITY, CAST(NULL AS VARCHAR2(10)) AS Prov FROM TABLE_A
    union all
    SELECT CITY, Prov FROM TABLE_B
    
  • Create table works, create materialized view only - long column names?

    Hello.

    I have no probs creating a table as well: -.
    CREATE TABLE blah
    (
    DEVICE_ID
    )
    in select
    "Device_ID" AS DEVICE_ID
    "of"sum" Device"@ed_link_3
    where "Device_ID" < 5;


    But when I try to create a materialized view:
    Blah1 CREATE MATERIALIZED VIEW
    (
    DEVICE_ID
    )
    < various materialized view parms >
    in select
    "Device_ID" AS DEVICE_ID
    "of"sum" Device"@ed_link_3
    where "Device_ID" < 5;

    It fails with errors: -.
    ORA-04052: error occurred when searching to the top of the remote object Aggregate.Device@ED_LINK_3
    ORA-01948: length of the name of the identifier (31) exceeds maximum (30)

    Is there a way to get around this?
    Is the problem with the columns of the remote table of device, which I do NOT need to import to have column names that are longer than 30 characters?

    For now, I want only the Device_ID column which is a simple 9 characters long.

    Oh, and the remote database is MySQL.
    I'm uncomfortable with the < parms of materialized view > as they work fine when I choose a different remote table with only short column names.

    Thank you.

    To my knowledge, you have the option
    (a) create view (with shortened column names or only with desired columns if they are already less than 30 char limit) side of mysql
    (b) use dbms_passthrough to force the analysis to be done on mysql (as in the example provided by SY here use dbms_passthrough to create a view )
    However, I prefer to stick to one), because with dbms_passtrhough, you retrieve row by row.

    Best regards

    Maxim

  • need help on the name of the column in double materialized view ORA-00957

    I have a query, long enough and several (8ways) joins.

    When I run it as a SQL query, it is fine.

    When I add create materialized, view myViewName it errors with
    ORA-00957: duplicate column name.

    How is there is no problem when executing the SQL statement, and how to fix this?

    Thank you.

    Hello

    Columns in a query do not need a unique name:

    SELECT     dummy
    ,     dummy
    FROM     dual;
    
    D D
    - -
    X X
    

    At least not in SQL * Plus; other front ends might oppose it.
    In previous versions of Oracle, subqueries (such as online views) does not need to have unique names, but you've got an error if you tried to reference a non-unique column (and it is unnecessary to have the column if never reference you).

    Columns in a table or a view need unique names:

    CREATE OR REPLACE VIEW view_x
    AS
    SELECT     dummy
    ,     dummy
    FROM     dual;
    
    ,     dummy
          *
    ERROR at line 4:
    ORA-00957: duplicate column name
    
  • Bug: Cannot create materialized view log on XE 11 G

    Hello

    I connect as try and HR user create materialized view log
    CREATE MATERIALIZED VIEW LOG ON HR.EMPLOYEES;
    I get the error
    >
    Error from the 1 in the command line:
    CREATE LOG VIEW MATERIALIZED ON HUMAN RESOURCES. EMPLOYEES
    Error in the command line: 1 column: 0
    Error report:
    SQL error: ORA-00439: feature not enabled not: Advanced replication
    00439 00000 - "function not enabled: %s."
    * Cause: The specified feature is not enabled.
    * Action: Try not to use this feature.
    >

    You can create a materialized view log on 10G XE with no problems.

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

    Is this a bug in 11g or 10g?

    It was reported earlier in the beta forum now archived. {: identifier of the thread = 2214092}

    The current doc lists the MV sites only (and 'No' to the function of replication advanced):
    http://download.Oracle.com/docs/CD/E17781_01/license.112/e18068/TOC.htm#BABDFDAI

  • The Materialized View - ORA-12052: is unable to fast refresh materialized view

    Hello

    I was hitting my head all day trying to create materialized views. I have made some progress, but have hit a brick wall, unfortunately!

    Basically, I have been invited to take a view and see if I can get the benefits of performance by transforming all or part of it in materialized views. Because the underlying tables of the config is updated quite frequently, I want to fast refresh materialized views on commit. However, when I try to create a materialized view containing an outer join in an aggregated materialized view table, I get ORA-12052: is unable to fast refresh materialized view.

    I went through the documentation and also Rob van Wijkvery useful series of blogs on the topic (especially http://rwijk.blogspot.co.uk/2009/09/fast-refreshable-materialized-view.html) but have not found anything that matches. Maybe I missed something somewhere along the line, or maybe I'm asking just something completely impossible?

    My db is 11.2.0.2.

    Here's the test scripts, I've worked with that:

    drop materialized view test1_test2_mv;
    Drop materialized view test2 journal;
    drop table test2;
    Drop materialized view test1_mv newspaper;
    drop materialized view test1_mv;
    Drop materialized view test1 journal;
    drop table test1;

    create table test1 (identification number,
    type varchar2 (10),
    number of Val,
    update_time date,
    constraint t1_pk primary key (id, type, val));

    Insert into test1
    Select 1, 'a', 1001, sysdate - 10/24 Union double all the
    Select 1, 'b', 1003, sysdate - 9/24 Union double all the
    Select 1, 'c', 1002, sysdate - 8/24 Union double all the
    Select 1, had ', 1004, sysdate - 7/24 Union double all the
    Select 1, 'e', 1005, sysdate - 6/24 Union double all the
    Select 1, 'c', 1006, sysdate - 5/24 Union double all the
    Select 2, 'a', 1002, sysdate - 4/24 Union double all the
    Select 2, 'b', 1005, sysdate - 3/24 Union double all the
    Select 3, 'a', 1001, sysdate - 2/24 Union double all the
    Select 3, 'c', 1006, sysdate - 1/24 Union double all the
    Select 3, 'e', 1008, sysdate - 2/24 Union double all the
    Select option 4, has ', 1004, sysdate - 3/24 Union double all the
    Select 5, 'b', 1002, sysdate - 4/24 Union double all the
    Select 5, 'g', 1001, sysdate - 5/24 Union double all the
    Select 6, 'h', 1004, sysdate - 6/24 Union double all the
    Select 7, 'b', 1007, sysdate - 7/24 Union double all the
    Select 7, had ', 1001, sysdate - 8/24 double;

    commit;

    Select * from test1;


    CREATE MATERIALIZED VIEW LOG ON test1
    WITH rowid, primary key (update_time)
    including the new values;


    Test1_mv CREATE MATERIALIZED VIEW
    IMMEDIATE CONSTRUCTION
    COOL OFF QUICKLY ON COMMIT
    Did YOU SELECT id,
    MAX (case when type = "there" end of val) THAT col_a,.
    MAX (case when type = 'b', then val end) AS col_b,.
    MAX (case when type = 'c' then end val) AS col_c,.
    MAX (case when type = ' then end of val) AS col_d,
    MAX (update_time) AS update_time
    OF test1
    WHERE TYPE in ('a',
    « b »,
    « c »,
    a ')
    GROUP BY id;

    CREATE MATERIALIZED VIEW LOG ON test1_mv
    WITH rowid
    including the new values;


    create table test2 (identification number,
    col2 number,
    COL3 varchar2 (10),
    number of COL4,
    constraint t2_pk primary key (id));

    Insert into test2
    Select 1, 1, 'bob', 1 double Union all
    Select 2, 1, "sue", 1 double Union all
    Select 3, 1, 'tom', 1 double Union all
    Select 4, 1, 'jay', 1 double Union all
    Select 5, 1, 'art', 1 double Union all
    Select 6, 1, 'kay', 1 double Union all
    Select 7, 1, 'max', 1 double Union all
    Select 8, 1, 'tim', 1 double Union all
    Select 9, 1, "liz", 1 from dual;

    commit;


    CREATE MATERIALIZED VIEW LOG ON test2
    WITH rowid, primary key
    including the new values;


    Test1_test2_mv CREATE MATERIALIZED VIEW
    IMMEDIATE CONSTRUCTION
    COOL OFF QUICKLY ON COMMIT
    LIKE SOME t2.rowid,.
    T1.ID,
    T1.col_a,
    T1.col_b,
    T1.col_c,
    T1.col_d,
    T1.update_time,
    T2.col2,
    T2. COL3
    OF test1_mv t1,.
    Test2 t2
    WHERE (+) t1.id = t2.id; -symbol of outer join is not correctly displayed on the forums without space, grr!

    ORA-12052: is unable to fast refresh materialized view TEST1_TEST2_MV

    Y at - it any way I can get the materialized view fast refresh on commit or I asking the impossible?

    Add t1.rowid:

    SQL > CREATE MATERIALIZED VIEW test1_test2_mv

    2 BUILD IMMEDIATE

    3 QUICK REFRESH YOU COMMIT

    4 AS t2.rowid SELECT rid2,

    5 t1.rowid rid1,

    6 t1.id

    T1.col_a 7,.

    T1.col_b 8,.

    T1.col_c 9,.

    T1.col_d 10,

    T1.update_time 11,

    T2.col2 12,

    13 t2.col3

    14 OF test1_mv t1,

    15 test2 T2

    16 WHERE t1.id = t2.id

    17.

    Materialized view created.

    SQL > select * from test1_test2_mv

    2.

    RID2 RID1 ID COL_A, COL_B, COL_C COL_D UPDATE_TIME COL2 COL3

    ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ------------------- ---------- ----------

    AAAYB6AANAAAANDAAA AAAYB/AANAAAAN/AAA 1 1001 1003 1006 1004 25 / 06 / 2014 12:54:16 1 bob

    AAAYB6AANAAAANDAAB AAAYB/AANAAAAN/AAB 2 1002 1005 25 / 06 / 2014 1 sue 14:54:16

    AAAYB6AANAAAANDAAC AAAYB/AANAAAAN/AAC 3 1001 1006 25 / 06 / 2014 16:54:16 1 tom

    AAAYB/AANAAAAN/AAD AAAYB6AANAAAANDAAD 4 1004 25/06/2014 14:54:16 1 jay

    AAAYB6AANAAAANDAAE AAAYB / AANAAAAN / AAE 5 1002 2014/06/25 13:54:16 1 art

    AAAYB6AANAAAANDAAF AAAYB/AANAAAAN/AAG 7 1007 1009 25 / 06 / 2014 10:54:16 max 1

    AAAYB/AANAAAAN/AAH                                                                                                        1 tim

    AAAYB/AANAAAAN/AAF                                                                                                        1 kay

    AAAYB/AANAAAAN/AAI                                                                                                        1 liz

    9 selected lines.

    SQL > update of test2

    2 set col3 = "fly."

    3 where id = 7

    6 m

    1 line update.

    SQL > validation

    2.

    Validation complete.

    SQL > select * from test1_test2_mv

    2.

    RID2 RID1 ID COL_A, COL_B, COL_C COL_D UPDATE_TIME COL2 COL3

    ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ------------------- ---------- ----------

    AAAYB6AANAAAANDAAA AAAYB/AANAAAAN/AAA 1 1001 1003 1006 1004 25 / 06 / 2014 12:54:16 1 bob

    AAAYB6AANAAAANDAAB AAAYB/AANAAAAN/AAB 2 1002 1005 25 / 06 / 2014 1 sue 14:54:16

    AAAYB6AANAAAANDAAC AAAYB/AANAAAAN/AAC 3 1001 1006 25 / 06 / 2014 16:54:16 1 tom

    AAAYB/AANAAAAN/AAD AAAYB6AANAAAANDAAD 4 1004 25/06/2014 14:54:16 1 jay

    AAAYB6AANAAAANDAAE AAAYB / AANAAAAN / AAE 5 1002 2014/06/25 13:54:16 1 art

    AAAYB/AANAAAAN/AAH                                                                                                        1 tim

    AAAYB/AANAAAAN/AAF                                                                                                        1 kay

    AAAYB/AANAAAAN/AAI                                                                                                        1 liz

    AAAYB6AANAAAANDAAF AAAYB/AANAAAAN/AAG 7 1007 1009 25 / 06 / 2014 10:54:16 1 rob

    9 selected lines.

  • Create Materialized view and Materialized view log.

    I wanted to create a materialized view with option "REFRESH QUICKLY YOU COMMIT".

    (1) table 1 - it is partitioned range + list - added primary key

    (2) View1 - having primary keys on the base table of view

    Steps to follow:

    (1) create the materialized on Table1; view journal -primary key by default

    (2) create the materialized on view1 view log.  -It gives below error.

    ORA-00942: table or view does not exist

    I wanted to create Materialized view as below

    create a materialized view

    Quickly REFRESH ON validation

    as

    Select...

    ........

    ... from table1

    where c1 (select c1 from View1 which...);


    Question:

    (1) because I am getting above error when creating journal of MV on the view. Can one create log view MV or we create a MV newspaper on the base table of view?

    (2) to create the MV with "REFRESH QUICKLY YOU COMMIT' option, we need to have the primary key on the main tables?


    Pointers on this will be really useful.


    Thank you

    Prasad

    "When a materialized view is maintained by the ON COMMIT method, the time required to perform the validation can be slightly longer than usual." This is because the refresh operation is performed as part of the validation process. This is why this method may not be suitable if many users at the same time change the tables on which is based the materialized view. »

    See: basis of materialized views (refreshment options) for all the other options and how they work.

  • create materialized view log on the table without a primary key

    Hi all
    CREATE TABLE client_months 
    (
      SUBJ_CODE         NUMBER(4),
      SERV_CODE         NUMBER(4),
      DEBIT_CODE        NUMBER(4),
      PERIOD_NUM        NUMBER(2),
      PERIOD_NAME       VARCHAR2(40 CHAR),
      FIRST_MON_DAY     DATE,
      LAST_MON_DAY      DATE,
      VALUE_MON_DAY     DATE,
      MONTHES           NUMBER(4,2),
      GARDENING_WEIGHT  NUMBER(5,4),
      REASON_CODE       NUMBER(5),
      STAMP_ACTION      VARCHAR2(1 CHAR),
      STAMP_CDATE       DATE                        DEFAULT SYSDATE,
      STAMP_DATE        DATE,
      STAMP_USER        VARCHAR2(15 CHAR),
      REGION_CODE       NUMBER(9)
    )
    table created.
    
    CREATE UNIQUE INDEX client_months_UK  ON client_months 
    (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
    index created.
    
    CREATE MATERIALIZED VIEW LOG ON client_months with rowid;
    
    CREATE MATERIALIZED VIEW client_months_mv 
    BUILD immediate 
    REFRESH FAST ON COMMIT 
    AS 
    SELECT * FROM client_months;
    
    ORA-12014: table 'CLIENT_MONTHS' does not contain a primary key constraint
    I don't want to refresh the mview when validation is performed on the base table.
    And I don't want to change the base table by adding a primary key.

    is it possible to create the mview journal using the unique index? or another solution?
    Please help
    Thanks in advance
    Naama

    Naamas wrote:
    No,
    I already read this post!

    Then you read wrong:

    SQL> CREATE TABLE client_months
      2  (
      3    SUBJ_CODE         NUMBER(4),
      4    SERV_CODE         NUMBER(4),
      5    DEBIT_CODE        NUMBER(4),
      6    PERIOD_NUM        NUMBER(2),
      7    PERIOD_NAME       VARCHAR2(40 CHAR),
      8    FIRST_MON_DAY     DATE,
      9    LAST_MON_DAY      DATE,
     10    VALUE_MON_DAY     DATE,
     11    MONTHES           NUMBER(4,2),
     12    GARDENING_WEIGHT  NUMBER(5,4),
     13    REASON_CODE       NUMBER(5),
     14    STAMP_ACTION      VARCHAR2(1 CHAR),
     15    STAMP_CDATE       DATE                        DEFAULT SYSDATE,
     16    STAMP_DATE        DATE,
     17    STAMP_USER        VARCHAR2(15 CHAR),
     18    REGION_CODE       NUMBER(9)
     19  )
     20  /
    
    Table created.
    
    SQL> CREATE UNIQUE INDEX client_months_UK  ON client_months
      2  (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
      3  /
    
    Index created.
    
    SQL> CREATE MATERIALIZED VIEW LOG ON client_months with rowid
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW client_months_mv
      2  BUILD immediate
      3  REFRESH FAST WITH ROWID ON COMMIT -- pay attention to WITH ROWID
      4  AS
      5  SELECT * FROM client_months
      6  /
    
    Materialized view created.
    
    SQL>
    

    SY.

  • 'Invalid metadata objects' when creating materialized views

    Hi experts,

    I ran into some trouble. I had an analytic workspace that has grown too quickly (see 11.2.0.2 size AW grows regularly with each generation of cube so I deleted and created a new.)

    He seemed to do very well with the tip David Greenfield, gave us in the mentioned forum post, but when I try to activate materialized views (that I had activated in the previous workspace) I am gettig the following error:

    -----
    Your metadata changes have been saved, with the following errors
    Invalid metadata objects:
    Invalid object "TABLESPACE. LECTURAS': 'CREATE A MATERIALIZED VIEW 'TABLESPACE' '. "CB$ LECTURAS.
    ORGANIZATION OF CUBE ON THE TABLESPACE. () TABLESPACE_AW
    MADE "LECTURAS_STORED"("LECTURAS_MEASURE_DIM" "LECTURA") IS "LECTURA"
    DIMENSION "TIEMPO" IS "TIEMPO", WITH THE HELP OF "TIEMPO_TIEMPO_HOUR_ID_UNIQUE_KEY."
    DIMENSION 'GEOGRAPHY' IS 'GEOGRAPHY' WITH THE HELP OF 'GEOGRAFIA_GEOGRAFIA_CONTADOR_ID_UNIQUE_KEY')
    POSTPONED BUILD
    UPDATE ON REQUEST
    FORCE
    WITH THE HELP OF CONSTRAINTS OF TRUST
    AS
    (
    SELECT
    TO_CHAR (T1." FEC_LECTURA', "dd/mm/yyyy hh24:mi:ss") "TIEMPO"
    T1. "" COD_METERID ""GEOGRAPHY. "
    SUM (T1." VAL_AI_HOR') "LECTURA".
    Of
    TABLESPACE. "' LECTURA_HORARIA_FINAL ' T1
    GROUP BY
    (TO_CHAR (T1." (FEC_LECTURA"," hh24:mi:ss dd/mm/yyyy '), T1. ("' COD_METERID")
    )
    ORA-00942: table or view does not exist
    "
    -----

    This same script running in SQLDeveloper gives the same error in line 17, which is the FROM clause. BUT I can run the select by itself and returns the expected result. If the table exists in the correct storage space.

    I must be missing something big...

    Thanks in advance.

    Joan

    P.S.: In the above code I use 'SPACE' to replace the real name from username and a tablespace (which is the same) for reasons of confidentiality.

    When you run the select statement, you connect to the same user you are trying to activate the VM?

    You can create a standard (No cube) MV with the same select statement? (Connected to the same user that you used in AWM).

    "CREATE MATERIALIZED VIEW "TABLESPACE"."MV_TEST"
      BUILD DEFERRED
      REFRESH ON DEMAND
      FORCE
      USING TRUSTED CONSTRAINTS
    AS
    (
      SELECT
       TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
       T1."COD_METERID" "GEOGRAFIA",
       SUM(T1."VAL_AI_HOR") "LECTURA"
      FROM
       TABLESPACE."LECTURA_HORARIA_FINAL" T1
      GROUP BY
       (TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
    )
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    
  • Cannot create Materialized View using the PL/SQL procedure

    Hello

    I have a question related to the creation of materialized view.
    I have a stored procedure that creates the materialized view. When you try to perform this procedure, I get not enough privileges error: ORA-01031.

    When I run the content of this procedure as a PL/SQL block anonymous their materialized view is created without any complications.
    Can you please advice me on this subject?
    It is even possible to create a materialized view in the stored procedure as I found no info on this subject.

    Thank you
    Petr

    Hi chudapet,

    Whenever you make in procedure, you must have direct subsidies and not through a role.

    Most likely the grant to create a materialized view is available via a role to your username.
    Assign a direct grant to the user:

    grant create materialized view to scott;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    
  • ORA-01723 null columns are not allowed

    We create a table using DEC from a remote database. We use the DEC due to performance issues with INSERT-SELECT.
    EXECUTE IMMEDIATE 'CREATE TABLE ods_idl_vst NOLOGGING AS SELECT * FROM remote_tab@remote_db vst';
    "How can I ' ora-01723 null columns are not allowed" error? Our data base is 11g.

    Hello

    Yes it is possible, then you will need to use the trick of cast, or remove the columns in your selection.

    Herald tiomela
    http://htendam.WordPress.com

  • Create materialized view

    Hello
    I found that when oracle executes the create materialized view statement it must be longer than the duration of execution of the actual query.
    I do an IMMEDIATE CONSTRUCTION.
    Is there a reason for this?

    For example. the query in the create statement took 25 minutes and did not create the MV for 2 hours.
    The following query, which took 10 seconds was not created during more than 11 minutes and is still ongoing.
    So I want to know what the reason is behind this? pls share if you know... Thank you.

    PS:
    I have advice in the select query. Oracle uses it advice during the creation of MV too or is this the reason why it's taking the time to build the MV?

    any suggestion is appreciated. thnks!

    Published by: user254668 on January 11, 2011 08:08

    How do measure you queries?

    http://jonathanlewis.WordPress.com/2010/08/29/fair-comparison/

    Re: Question Performace and Order by
    Re: receiving ORA-01722 invalid number mistake while creating a materialized view
    Re: long term with ORDER by clause
    Re: Improve the performance of the query with the order of

  • is missing a closing parenthesis in create materialized view statement

    Hi, I am using oracle 10g R2 and try to create a view of materalized with the following statement:
    CREATE MATERIALIZED VIEW MVT_DEC_TAB USING INDEX REFRESH FAST ON COMMIT AS 
    select i.rowid as ind_rowid,c.rowid as indc_rowid,r.rowid as r_rowid,b.rowid as b_rowid,brk.rowid as brk_rowid,
    i.name,i.sname,i.address,i.tel,i.fax,i.email,
    DECODE(c.BRKNO,null,0,1) AS DEC_BRK,
    TO_TIMESTAMP(NVL(VEKDOV,'2001/01/01')||' 12:00:00','YYYY/MM/DD HH:MI:SS'),
    DECODE(c.brkno,null,DECODE(c.ncmpcode,null,c.vekdov,b.bcarddov),brk.validitydov)
    from indiv i,indivcoding c
    LEFT OUTER JOIN BROKER brk ON brk.brkno = c.brkno
    LEFT OUTER JOIN CORPORAT r
    ON c.ncmpcode=r.cmpcode INNER JOIN BCARD b ON b.bcardno=r.bcardno
    where c.typeact=2  
    and c.natcode=i.natcode
    and c.brkno is not null or c.ncmpcode is not null or c.nnatcode is not null
    but I get an error message:
    where c.typeact = 2
    ERROR on line 11:
    ORA-00907: lack of right parenthesis

    which makes no sense because if I run the sql code of the materialized view, it runs normally.
    I need to know what the causing this can someone help?

    Do not use the "LEFT OUTER JOIN" ANSI syntax in your CREATE MATERIALIZED VIEW definition.
    Specify

    FROM indiv i,indivcoding c, broker brk, corporat r
    WHERE brk.brkno(+) = c.brkno
    AND c.ncmpcode(+) = r.cmpcode
    

    OR

    FROM indiv i,indivcoding c, broker brk, corporat r
    WHERE c.brkno = brk.brkno(+)
    AND r.ncmpcode = c.cmpcode(+)
    

    (I find it more readable).

    Hemant K Collette

  • With as subquery block in create MATERIALIZED view or bulk pl/sql

    Hi all

    Can I use the with as subquery block in create MATERIALIZED view?

    or in pl/sql



    -Thank you

    Published by: xwo0owx on March 31, 2011 11:23

    Published by: xwo0owx on March 31, 2011 11:23

    Have you tried to test it? :)

    SQL > SELECT * FROM V$VERSION;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL > CREATE VIEW TEST_VIEW
      2  AS
      3  WITH d AS
      4  (
      5          SELECT * FROM DUAL
      6  )
      7  SELECT *
      8  FROM   d
      9  ;
    
    View created.
    
    SQL > SELECT * FROM test_view;
    
    D
    -
    X
    
    SQL > DECLARE
      2          x DUAL.DUMMY%TYPE;
      3  BEGIN
      4          WITH d AS
      5          (
      6                  SELECT * FROM DUAL
      7          )
      8          SELECT dummy
      9          INTO   x
     10          FROM   d
     11          ;
     12
     13          DBMS_OUTPUT.PUT_LINE(x);
     14  END;
     15  /
    X
    
    PL/SQL procedure successfully completed.
    
  • You are not allowed to open the form ORA-01403: no data found

    Hello

    I created a new forms of Oracle 10 g. It compiles successfully, but when it is open, it gives an error message: you are not allowed to open the form ORA-01403: no data found.

    I am already connected to the database. Please can someone help what is the reason of this problem, and no matter what possible resolution?

    Looks like you have some kind of security is enabled.  However, because you do not share details about your environment or what you're doing here is not that we can do is guess.

    • Exactly what version of forms do you use?
    • Exactly which version of the database that you are using?
    • You use something like Oracle E-Business (e.g. template.fmb)?
    • You created the form with Oracle Designer?
    • If you create a simple form using only the layout assistants and the DataBlock compared to schema Oracle demo (SCOTT), this form run?

    No additional details describing what you do or have done could be useful.

Maybe you are looking for

  • Another pilot imageclass d420

    Hello! You ask if there is another driver for basic printing ImageClass D420 to Win 8.1 (32 or 64 bit)? Worked very well throughout the beta 8.1 Win (Win Blue) and on the release, the pouf. Scanner works fine with the native drivers in Win. I don't h

  • Adding memory 8311-62U office

    I have trouble finding the memory to add to my desktop (computer NetVista 8311-62U). Currently I have 384M and am running XP. SO, I want to add to the system board. Anyone know what kind of memory and where I can buy? Thank you

  • Unable to connect to the Internet wireless

    I can't access the internet wireless.   There is a light on the wireless button.   the manual States it should be blue.   do I need to buy a part or is there something I can do to fix this problem manually.  for now, I connect to the internet using a

  • OE will not appear in my contact list

    I can't see any contacts or email addresses on my O.E. main window. In DISPLAY/layout, I have the Contacts check box. The address book updates correctly when I add a new contact. When I compose a new email and start typing in the recipient of the e-m

  • Turns off external hard drive... Do not see it displayed in my computer

    I've just set up a new computer and I copied filed from my old computer to an external hard drive.  When I plug my external hard drive to the new computer USB port... it turns on but only run for a VERY short time, and then turns off.  I tried to see