Create view with variables

Is there any way of create a view that asks for the value of some parameters?
something like...
CREATE VIEW "VIEW1" AS
SELECT NOMBRE
FROM EPTABLA_01
WHERE NOMBRE = ??? WITH READ ONLY

The method below won't "ask" for a value, but if you set the variable, this will work as a parametrized view.
SQL> create context my_ctx using my_proc
  2  /
Context is aangemaakt.
SQL> create procedure my_proc (p_nombre in number)
  2  is
  3  begin
  4    dbms_session.set_context('my_ctx','my_nombre',to_char(p_nombre));
  5  end;
  6  /
Procedure is aangemaakt.
SQL> create table eptabla_01 as select l nombre from (select level l from dual connect by level <= 10)
  2  /
Tabel is aangemaakt.
SQL> create view view1
  2  as
  3  select nombre
  4    from eptabla_01
  5   where nombre = sys_context('my_ctx','my_nombre')
  6    with read only
  7  /
View is aangemaakt.
SQL> exec my_proc(5)
PL/SQL-procedure is geslaagd.
SQL> select * from view1
  2  /
                                NOMBRE
                                     5
1 rij is geselecteerd.
SQL> exec my_proc(8)
PL/SQL-procedure is geslaagd.
SQL> select * from view1
  2  /
                                NOMBRE
                                     8
1 rij is geselecteerd.Regards,
Rob.

Similar Messages

  • Makes it possible to create view with parameters

    makes it possibel to create view with paramater, example
    create or replace view v_test(segment varchar2)
        select * from ref_user where segment = segmentThanks

    thanks..
    select count(distinct substr(a.svm_id,1,10)) jumlah " +
       " from daily_distribution_pop a, ref_toko b " +
       " where " +
       " substr(a.svm_id,1,10)=b.id and b.segment_type = 'A' and enable_flag='Y' " +
       " and a.tgl_visit between to_date('" + fromStartDate + "', 'dd/MM/yyyy') and to_date('" + fromEndDate + "', 'dd/MM/yyyy')
         and " + whereA + "= '" + whereB + "' " +
       " and substr(a.pom_id,1,2) = 'DP' and (a.qty_instore <> 0 or a.qty_delivered <> 0) ";
    {code}
    where fromStartDate,  fromEndDate, whereA, whereB  is variable parameter from asp.net.
    how to i can implement with view                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Create View  with Force and No Force

    Can Anyone Tell me how to create view with force and no force i have very little idea about this

    This is the syntax.
    CREATE [OR REPLACE] FORCE VIEW view
    [(alias[, alias]...)]
    AS subquery
    [WITH CHECK OPTION [CONSTRAINT constraint]]
    [WITH READ ONLY [CONSTRAINT constraint]];You can see interesting threads about this topic here.
    Re: Creating view forcibly
    Creating View forcefully
    Cheers
    Sarma.

  • Is it possible to create views with parameters ?

    Hi,
    As MS-Access, is it possible to create views with parameters ?
    Ms-Access syntax : parameters [a] text; select * from table where code = [a]
    If yes, can you give samples ?
    Regards
    Pascal

    I suggest you you write a stored procedure that returns a recordset in oracle. Then execute the stored procedure and loop through the record set.
    Look in in MS Knowledgebase searching on ADO Stored Proceedures for the VB/C++/VBS .. code.
    Look in in Oracle PL/SQL guide for the Stored Proceedure code.

  • How I can create view with parameters?

    I have very big query (2000 rows) and 2 parameters.
    How I can create view with parameters?

    If I use this small part of my query than I have error :
    java.lang.NullPointerException
         at oracle.javatools.db.ora.OracleSQLQueryBuilder.buildQuery(OracleSQLQueryBuilder.java:199)
         at oracle.javatools.db.ora.OracleSQLQueryBuilder.buildQuery(OracleSQLQueryBuilder.java:147)
    What does it means?
    select
    ' Payroll ' as Revenue
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and ( nvl(a.scode, 0) between 60000 and 6009000 )
    union all ---------------------------------------------------------------------------------------------------------------------------------
    select
    ' Payroll Taxes '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    (nvl(a.scode, 0) between 60100 and 60690 )
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Workers Comp/Disability '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 61200 and 61260)
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Pension and Hospitalization '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 61000 and 61550 )
    union all -------------------------------------------------------------------------------------------------------------------------------
    select
    ' Other Labor Costs '
    , t.umonth, nvl(p.hmy, 0), nvl(t.sMTD, 0), nvl(a.inormalbalance, 0), nvl(T.sbudget, 0), nvl(a.scode, 0)
    from
    acct a, total t, property p, param par
    where
    nvl(t.hacct, 0) = nvl(a.hmy, 0)
    and nvl(par.hretain, 0) <> nvl(a.hmy, 0)
    and nvl(t.iBook, 0) = 0
    and nvl(a.iacctType, 0) = 0 /*Regular accts*/
    and nvl(t.hppty, 0) = nvl(p.hmy, 0)
    and
    ( nvl(a.scode, 0) between 616000 and 616400 )

  • What is the use for CREATING VIEW WITH CHECK OPTION?

    Dear Legends,
    I have a doubt
    What is the use for creating view?
    A: First Data Integrity, Selecting Particular Columns..
    What is the use for creating a view with check option?
    A: As per oracle manual I read that its a referential integrity check through views.
    A: Enforcing constraints at DB level.
    A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??
    A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???
    Please clear my doubt's Legends
    Lots of Thanks....
    Regards,
    Karthik

    Hi, Karthick,
    karthiksingh_dba wrote:
    ... What is the use for creating view?
    A: First Data Integrity, Selecting Particular Columns..Most views are created and used for convenience. A view is a saved query. If the same operations are often done, then it can be very convenient to code those operations once, in a view, and refer to the view rather than explicitly doing those operations.
    Sometimes, views are created and used for security reasons. For example, you many want to allow some users to see only certain rows or certain columns of a table.
    Views are necessary for INSTEAD OF triggers.
    What is the use for creating a view with check option?
    A: As per oracle manual I read that its a referential integrity check through views.The reason is integrity, not necessarily referential integrity. The CHECK option applies only when DML is done through the view. It prohibits certain changes. For example, if a user can't see certain rows through a view, the CHECK option keeps the user from creating such rows.
    A: Enforcing constraints at DB level.I'm not sure what you mean. Please give an example.
    A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??No. Using CHECK OPTION, you can do some inserts and updates, but not others. The columns involved may or may not have constraints in either case.
    A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???If you try to violate a constraint, you'll get an error. That happens in views with or without the CHECK OPTION, and also in tables.

  • Error creating view with tables of other user

    I am creating of view containing two tables of another user. I
    am a dba-user.
    The statement looks like this:
    CREATE VIEW TEST
    (SELECT ...
    FROM DWH.TABLE_A A, DWH.TABLE_B B
    WHERE A.ID = B.ID)
    I get an error-message (ORA-00942: Table or view not found).
    When I create the view as user DWH, everything went OK. I don't
    think it has something to do with privileges since I am the dba-
    user.
    How can I create a view using other users tables?

    Hi
    To create view on table of another user you need to have select
    privilege grant directly to you - not to role granted to you. In
    your case you can select tables because you have granted dba
    role and it has select any table prvivilege, but you havent
    directly granted this rights without role.
    Regards

  • Create view with union

    Hi all,
    I have tried to create a view with next code:
    CREATE VIEW vista_urbanizacion AS SELECT
    RUPI_URBANIZACIONES.NOMBRE_URBANIZACION,
    RUPI_URBANIZACIONES.NRO_PREDIOS,
    RUPI_URBANIZACIONES.NRO_URBANIZACION,
    RUPI_URBANIZACIONES.ESTADO,
    RUPI_URBANIZACIONES.FECHA_INGRESO,
    RUPI_URBANIZACIONES.AREA_TERRENO,
    RUPI_URBANIZACIONES.TIPO,
    RUPI_URBANIZACIONES.UBICACION_ARCHIVO,
    RUPI_URBANIZACIONES.NRO_SUPERURBANIZACION,
    RUPI_URBANIZACIONES.ID_URBANIZADOR,
    RUPI_URBANIZACIONES.AREA_TOTAL_CESION,
    RUPI_ESCRITURAS.MATRICULA_INMOBILIARIA,
    RUPI_ESCRITURAS.NOTARIA,
    RUPI_ESCRITURAS.CIUDAD,
    RUPI_ESCRITURAS.ACTO_JURIDICO,
    RUPI_ESCRITURAS.FECHA_ESCRITURA,
    RUPI_ESCRITURAS.NRO_ESCRITURA,
    RUPI_ESCRITURAS.CONSECUTIVO,
    RUPI_ESCRITURAS.URBANIZACI_NRO_URBANIZACION,
    RUPI_ACTAS.TIPO_ACTA,
    RUPI_ACTAS.NRO_ACTA,
    RUPI_ACTAS.FECHA_ACTA
    FROM
    RUPI_URBANIZACIONES,
    RUPI_ESCRITURAS,
    RUPI_ACTAS
    WHERE
    RUPI_URBANIZACIONES.NRO_URBANIZACION =
    RUPI_ESCRITURAS.URBANIZACI_NRO_URBANIZACION
    AND
    FECHA_ESCRITURA IN (SELECT MIN(FECHA_ESCRITURA) FROM RUPI_ESCRITURAS
    WHERE
    RUPI_URBANIZACIONES.NRO_URBANIZACION = RUPI_ESCRITURAS.URBANIZACI_NRO_URBANIZACION)
    AND
    RUPI_URBANIZACIONES.NRO_URBANIZACION =
    RUPI_ACTAS.URBANIZACI_NRO_URBANIZACION
    AND
    FECHA_ACTA IN (SELECT MAX(FECHA_ACTA) FROM RUPI_ACTAS
    WHERE
    RUPI_URBANIZACIONES.NRO_URBANIZACION =
    RUPI_ACTAS.URBANIZACI_NRO_URBANIZACION)
    The problem is the condition "and" from the rupi_escrituras and rupi_actas tables that only will select elements of rupi_urbanizaciones included both in rupi_escrituras and rupi_actas.
    I need to use something like "union" in order to include all the distinct elements of both tables rupi_escrituras and rupi_actas.
    Could anyone help?
    Thanks in advance
    Romulo

    Yep,
    In this query you don't do any join between the tables. So let's get back to the basic.
    Take you first query
    SELECT CBR_ID,PLT_ID,SUM(COUNT_POL)
    FROM
    SELECT  pcd_irs_id CBR_ID, pcd_plt_id PLT_ID , sum(pcd_amount_lc) SUM_PREM,0 COUNT_POL
    FROM seema
    where trunc(pcd_registry_date)=TRUNC(pcd_registry_date)
    and pcd_plt_id in('U01','U02')
    and pcd_irs_id in (55,56)
    AND PCD_IRS_TYPE!=4
    GROUP BY PCD_irs_ID,PCD_PLT_ID
    UNION
    SELECT PLM_CBR_ID CBR_ID,PLM_PLT_ID PLT_ID,0 SUM_PREM, COUNT(PLM_POLICY_NO) COUNT_POL
    FROM sarah
    WHERE  trunc(PLM_registry_date)=TRUNC(PLM_registry_date)
    AND PLM_PLT_ID IN('U01','U02)
    GROUP BY PLM_CBR_ID,PLM_PLT_ID)
    GROUP BY CBR_ID,PLT_ID
    ORDER BY CBR_ID,PLT_IDThis query is quite near to the result that you need. You are very near to the result just add the filter that you need in the second query:
    SELECT CBR_ID,PLT_ID,SUM(COUNT_POL)
    FROM
    SELECT  pcd_irs_id CBR_ID, pcd_plt_id PLT_ID , sum(pcd_amount_lc) SUM_PREM,0 COUNT_POL
    FROM seema
    where trunc(pcd_registry_date)=TRUNC(pcd_registry_date)
    and pcd_plt_id in('U01','U02')
    and pcd_irs_id in (55,56)
    AND PCD_IRS_TYPE!=4
    GROUP BY PCD_irs_ID,PCD_PLT_ID
    UNION
    SELECT PLM_CBR_ID CBR_ID,PLM_PLT_ID PLT_ID,0 SUM_PREM, COUNT(PLM_POLICY_NO) COUNT_POL
    FROM sarah
    WHERE  trunc(PLM_registry_date)=TRUNC(PLM_registry_date)
    AND PLM_PLT_ID IN('U01','U02)
    and PLM_CBR_ID in (55,56)          --<<<<<<<<< ADDED FILTER
    GROUP BY PLM_CBR_ID,PLM_PLT_ID)
    GROUP BY CBR_ID,PLT_ID
    ORDER BY CBR_ID,PLT_IDand you are done.
    Bye
    Antonio

  • Create view with order by

    I am in a 8i SQL class where I "learned" that the order by clause can not be used when creating a view. This surprised me as I am sure I have done so in the past. After talking with the instructor we found that:
    create view viewname as
    select * from table order by column
    worked, while:
    create view viewname as
    (select * from table order by column)
    returns:
    ORA-00907: missing right parenthesis
    And
    create view viewname as
    (select * from table)
    works as well.
    Anyone understand why?
    Thanks
    null

    The queries are theoretically different.
    Example 1 is a view with an order by clause.
    Example 2 is a view of the result of an ordered query.
    Example 3 is a view of the result of an unordered query
    Just another example of how people are smarter than machines, I suppose.

  • How to create view with schemabinding on cross datbases(partitioned views)

    Hello Everyone,
    Please help me to sort this issue. I know it is not possible bind the scheman in below example. But is there any solution to solve this issue.
    I've tables like below
    create database D1--First database
    create table dbo.t1(
    id int
    create database D2--Second database
    create table dbo.t2(
    id int
    i want to create a view with the schema binding option on this
    create database D3
    use d3
    create view vw_v1
    with schemabinding
    as
    select id from d1.dbo.t1
    union all
    select id from d2.dbo.t2
    I'm getting this below error
    Msg 4512, Level 16, State 3, Procedure vw_v1, Line 7
    Cannot schema bind view 'vw_v1' because name 'd1.dbo.t12' is invalid for schema binding. Names must be in two-part format and an object cannot reference itself.
    Many thanks
    A-ZSQL

    CREATE VIEW
    SCHEMABINDING
    Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove
    dependencies on the table that is to be modified.
    > When you use SCHEMABINDING,
    the select_statement must include the two-part names (schema.object)
    of tables, views, or user-defined functions that are referenced.
    >
    All referenced objects must be in the same database.
    José Diz     Belo Horizonte, MG - Brasil

  • Cannot create view with parameter bindings

    Hi, I'm trying to create this view in SQLPlus:
    SELECT order_no, SUM(cut_qty),
    SUM(received_qty)
    FROM (
    SELECT order_no, cut.dated, DECODE(cut.bimetallic, 'F', cut.quantity, cut.quantity/2) cut_qty,0 AS received_qty
    FROM cut_shop_orders_dated cut
    WHERE cut.dated BETWEEN TO_DATE('&date1','DD/MM/YYYY') AND TO_DATE('&date2','DD/MM/YYYY')
    UNION
    (SELECT order_no, rec.dated, 0, rec.quantity
    FROM received_shop_orders_dated rec
    WHERE rec.dated BETWEEN TO_DATE('&date3','DD/MM/YYYY') AND TO_DATE('&date4','DD/MM/YYYY')))
    GROUP BY order_no
    The problem is that sqlplus asks me for the parameter values and then creates it with these values as literal dates in the to_date function, those not asking for parameter values in runtime.
    How can I create it using parameters with no values at design time?
    Thanks.
    Leandro.

    if you want something like :
    select * from emp $where_clause;
    you can write a procedure with parameter and run it as dynamic sql for example
    create or replace procedure pr1 ( p_where   varchar2) is
    begin
      execute immediate 'create or replace view view_name as select * from emp '|| p_where;
    end pr1;
    /then run it on sql*plus
    SQL> exec pr1('where deptno = 10');
    make sure you give yourself "create any view" rights explicitly.
    HTH
    Ghulam

  • Creating Views with DI APIs DoQuery-Method in SQL 2005

    Hi @All,
    I've had the following (solved) problem:
    The DB installer of one of our AddOns is also creating a bunsh of views for our UDTs. The installer always executes the following two statements for each view:
    IF OBJECT_ID ('[dbo].[@NSP_EXAMPLE_VIEW]', 'V' ) IS NOT NULL
        DROP VIEW  [dbo].[@NSP_EXAMPLE_VIEW];
    CREATE VIEW [dbo].[@NSP_EXAMPLE_VIEW] AS
    SELECT
         T0.U_Field3,
         T1.U_Field1,
    FROM
         [dbo].[@NSP_A] T0 INNER JOIN
         [dbo].[@NSP_B] T1 ON
         T0.U_Key=T1.U_Key  AND
         T0.U_CostNo=T1.U_CostNo;
    This has worked fine for the first 3 views we need. Then came the 4th view and we get an exception from the doQuery. I had to change the SQL-2005 compatibility level back to 80 to create the 4th view because of an incompatible "FOR BROWSE"-statement.
    When it was created under level 80 I saw the problem: ONLY the 4th view was extended with the "FOR BROWSE"-Statement by DI-API. I didn't see any difference in the 4th VIEW-statement which could be the reason that only this one gets the "FOR BROWSE"
    Anyway! Big thanks to  John Mackin and the users of this thread:
    [Formatted search;
    Adding an SQL-comment "--FOR BROWSE" at the end of the VIEW-creation statement has solved the problem.
    (I hope the DI-API query parser will not change this behaviour in the future :-o )
    Cheers,
    Roland

    Thanks for the replies, but casting gave me the original 'General Error' as well.
    I tried to make a stored procedure out of it. I used this page as a guide:
    http://www.davidhayden.com/blog/dave/archive/2005/12/30/2652.aspx
    The stored procedure looks like this:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    CREATE PROCEDURE [dbo].[TestItems]
        @PageIndex INT,
        @PageSize INT
    AS
    BEGIN
    WITH tmpItems AS (
    SELECT ROW_NUMBER() OVER (ORDER BY ItemCode DESC)AS Row, ItemCode, ItemName
    FROM OITM)
    SELECT ItemCode, ItemName
    FROM tmpItems
    WHERE Row between (@PageIndex - 1) * @PageSize + 1 and @PageIndex*@PageSize
    END
    I am able to call this stored procedure like this:
    exec TestItems 10, 10  -- (returns item 91 to 100).
    This solution meets my immediate requirements, but I don't like the fact that I added the stored procedure to the administration itself. Is it possible to add the stored procedure to a different database and still use the DI server?
    Thanks for your time!
    Vincent

  • Create view With Ref cursor data

    Hi friends,
    I want to create view as follows.
    Example:
    Create or replace v_name
    select job,sal, <funcation>
    from emp;
    Note:- Function not having out parameter.
    Function returning ref cursor values datatype.
    Requirement:-
    I want to create view even function returing ref cursor datatype.
    Please advise how to create view.
    Regards,
    Kishore

    user7284612 wrote:
    Hi friends,
    I want to create view as follows.
    Example:
    Create or replace v_name
    select job,sal, <funcation>
    from emp;
    Note:- Function not having out parameter.
    Function returning ref cursor values datatype.
    Requirement:-
    I want to create view even function returing ref cursor datatype.
    Please advise how to create view.You perhaps are misunderstanding what a ref cursor is. It does not contain data like a table, so cannot be treated as one.
    Take a read of this:
    PL/SQL 101 : Understanding Ref Cursors

  • CREATE VIEW with PreparedStatement

    Hi guys,
    I'm trying to run a CREATE VIEW statement, which I have been doing up till now just using a regular Statement, and using the executeUpdate() method. It's been working fine for a while, and now i've hit a bit of a problem.
    I can't include a WHERE clause in a Statement, as it doesn't like the single quotations (') and wildcards. After searching this forum, I saw that I should be using a PreparedStatement, and using the setString() method to put in the ' and %'s.
    Now when I try to run the PreparedStatement using the executeUpdate() method, I get the "Incorrect syntax near the keyword 'VIEW'" error. Can anyone tell me if i'm using the right method for executing the PreparedStatement, or what i'm doing wrong?
    Regards,
    Jack Smith

    SQL statements are often broken up into two classes, DML (data manipulation language) and DDL (data definition language). DML contains the normal CRUD statements, INSERT, SELECT, UPDATE, DELETE and anything else that modifes the data but not the data structure. DDL is the set of statements that manipulates the data structure, things like CREATE, ALTER, DROP.
    As a general rule of thumb, you shouldn't do DDL in a PreparedStatement.
    PreparedStatements exist primarily to allow late-binding of data-value objects into the internal datastructure within the database that represents a parsed SQL statement's execution plan. It is NOT a mechanism for doing string substitution (though I understand who it can look that way to beginners).
    Another way of saying this is that PreparedStatement is based on the distinction between data and code; in a DDL statement, the entire statement is code.
    There are a few drivers/databases where this might happen to work, because they aren't really seriously implementing PreparedStatement but merely doing string replacement to fake it. I very much doubt SQL server is going to be one of these.

  • Creating materialized view with variables - help

    Greetings,
    I want to create an materialized view (MV) from the external public db link. Below is my full query:
    CREATE MATERIALIZED VIEW PROJECTS_MV
    REFRESH WITH ROWID
    AS
    SELECT prj.Project_id, prj.desc,
    prj.parent_project_id, f_year, f_month
    FROM sysadm.prj@EFUYEEDW_DB_LINK.MSDB prj
    WHERE prj.pf_scenario_id = '708KDD'
    AND prj.ph_id = 'SHAREDP'
    AND f_year = (SELECT EXTRACT(year FROM current_DATE) FROM dual)
    AND f_month = (SELECT EXTRACT(month FROM current_DATE) FROM dual)
    Question: In the query there are two variables that capture the month and year and requery it. Does the data get updated automatically when a new month or new year changes?
    If there is a change, how would I change so it would update the data accordingly?
    Thanks for your help
    john9569

    Hi Christian,
    Thanks for your response. Your codes return the date as 01-JAN-09 which is not what I'm looking for. Maybe my question is not clear.
    So far, the MV is executed correctly what I want. My concern is when it updates the MV, does it get the new data (f_month & f_year) when the MV is updated automatically?
    Other words, the MV is updated nightly to get the incremental data from the db link. Once it passes to the new month, I am not sure how this MV handles since the f_month is now changed to differrent number.
    Thanks for your help.
    Bests,
    John9569

Maybe you are looking for

  • How to create a table with a dynamic amount of columns

    Hi, all! Thare is a tutorial at javaFX documentation page. This example describes how to make tableView, if you have some certain java class, which can tell you which columns you are going to have. (That is a Person class in this example). But what i

  • Installed Lightroom 4.4. Crashes every time I try to upgrade my PE11 catalog.

    Installed lightroom 4.4. Crashes every time I try to upgrade my PE11 catalog.

  • Cannot open Canon Rebel XT raw files in Photoshop CS

    Get the following error message: "Could not complete your request because this version of Photoshop does not supply the services required by this plug-in module." I have updated to the 2.4 camera raw plugin and placed it in C:\Program Files\Adobe\Pho

  • Can't re-shuffle songs

    Lately, I can't get my songs to re-shuffle. According to the card that ships with the Shuffle, all I have to do is "switch off, wait 5 seconds, then switch to shuffle or play". This has no effect whatsoever. The memory of where it left off also no lo

  • URL not found error

    Hi All, I am working on hrrcf_profile BSP, I have created new page in hrrcf_profile. This page is working for new profile or new user and this is not working for old profile or user. Can you please suggest me.