Can't we use function to derive value for NEXT clause in MV ?

Hi Friends,
I have a requirement like below
I need to derive the schedule (Value for NEXT clause in the create MV command) for a MV to run it
e.g., Value from a date column : 03-JUL-2012 10:00 AM, VALUE for NEXT clause in CREATE MV statement should be 03-JUL-2012 04:45 AM (It is -5.45 hrs from the above date column value )
So I wrote a function (GET_DATE) to derive schedule for NEXT clause and tried to call it from NEXT caluse, but it is giving error message as mentioned below
ORA-04044: procedure, function, package, or type is not allowed here
CREATE MATERIALIZED VIEW child_mv
PARALLEL 16
INITRANS 16
STORAGE (
FREELISTS 16
FREELIST GROUPS 4
BUILD IMMEDIATE
REFRESH COMPLETE
NEXT GET_DATE('PARENT_MV')
AS
SELECT * from xxmdme_party_stage where rownum<101;
Could you please help to give some light on how this can be done ?

942661 wrote:
Hi Friends,
I have a requirement like below
I need to derive the schedule (Value for NEXT clause in the create MV command) for a MV to run it
e.g., Value from a date column : 03-JUL-2012 10:00 AM, VALUE for NEXT clause in CREATE MV statement should be 03-JUL-2012 04:45 AM (It is -5.45 hrs from the above date column value )
So I wrote a function (GET_DATE) to derive schedule for NEXT clause and tried to call it from NEXT caluse, but it is giving error message as mentioned below
ORA-04044: procedure, function, package, or type is not allowed here
CREATE MATERIALIZED VIEW child_mv
PARALLEL 16
INITRANS 16
STORAGE (
FREELISTS 16
FREELIST GROUPS 4
BUILD IMMEDIATE
REFRESH COMPLETE
NEXT GET_DATE('PARENT_MV')
AS
SELECT * from xxmdme_party_stage where rownum<101;
Could you please help to give some light on how this can be done ?you must (ab)use EXECUTE IMMEDIATE

Similar Messages

  • The range can't be used as a single value.

    Sorry all, a bit new to spreadsheets
    I am creating a budget spreadsheet in Numbers to learn how it all works
    I have a costing for Oil use; 12 monthly columns that are added together to produce a total for the year.
    However there is a standing charge to be added to this for the oil tank and that is £60 per year.
    So I started with a formula that states simply:
    SUM(B6:M6)
    This returns my yearly oil consumption cost but when I amend it to add the standing charge of £60p.a. like this
    SUM(B6:M6)+60
    I get the syntax error message "The range B6:M6 can't be used as a single value"
    I am sure there must be an easy work around for this but I haven't found it yet.
    Anyone got any thoughts ?

    Hmmm - this is quite a bit to take in !
    OK let me ask you about another instance.
    I have a column and at the top I have my Income for that month and below I have expenses incurred during that month.
    What I am aiming to do is out put the profit i.e. Income minys expenses.
    If I do this:
    I get an error
    But if I do this
    I get a result but obviously it shows my Profit as a negative number.
    That's why I find it strange.
    Simply reversing the order of the values stops the formula working.
    In one case the "range" (B3:B8) is producing a number value, and in the other it isn't.

  • Use commitKey to change value in next field

    if (event.commitKey == 3){myTrustedFunction(this);} So I want to run this function on a specific field after tab is used in this field. Instead of this I would like to use
    var school=doc.getField("SCHOOL NAME");How can I run this function on this specific field. The tab is going to this field also. So it goes like this enter value tab value for next field is automatically entered. Bam.Tab to next field.

    JavaScript™ for Acrobat® API Reference
    if ((event.value.length<5)&&(event.value.length>3)){
                    event.value=("0"+event.value.toString());
                if ((event.value.length<4)&&(event.value.length>2)){
                    var num=event.value=("00"+event.value.toString());
                if((event.value.length<3)&&(event.value.length>1)){
                    var num=event.value=("000"+event.value.toString());
                 if(event.value.length<2){
                    var num=event.value=("0000"+event.value.toString());
    if (event.commitKey == 3){myTrustedFunction(this);getField("SCHOOL NAME").value = event.value;app.alert(num);}
    else{app.alert("poop");}
    so this crazy thing is just like a puzzle you get one thing to work and you break another. So I now have the field that I want with the correct data in that field. But in doing so i have recked the first field. They both now share the same data. I would like to put it back and give it the data of var num. But I do not know how. Because. getField("SCHOOL NAME").value =num does not work.

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • Calling a user defined function as default value for a column

    Hi All
    Can we call a user defined function as default value for a column ??
    for example:
    create or replace  function test1  return number is
    begin
    return 10;
    end;
    create table testt
    (id  as test1,
      name varchar2(20));
    getting error:
    Error at line 1
    ORA-02000: missing ( keywordThanks
    Ashwani
    Edited by: Ashwani on Jan 16, 2012 1:19 AM

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
    Regard
    Helios

  • Can windows xp use a different sound card for itunes - I want to use a sound card for itunes and another for all other apps

    Can Windows XP use a different sound card for itunes - I want to use a sound card for itunes and another for all ther apps

    To the best of my knowledge, Windows is not capable of setting a specific sound card based on the app being used, it's all or nothing.
    Try a google search or search the Microsoft site.

  • HT204053 Can multiple people use the same Apple ID for their own devices?

    Can multiple people use the same Apple ID for their own devices? I just set up my IPhone 4S (first time user) using the same Apple ID as my daughters and now we receive each others texts, do I need to set up my own Apple ID account?

    Yes, you can.  In fact it's recommended that you use different IDs for iMessage, FaceTime and iCloud.  You can still share the same ID for iTunes without any issues.
    You are getting each other's text messages because you're using the same ID for iMessage.  To fix this, one of you should go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign in with a different ID.  To avoid getting each other's FaceTime calls, do the same thing in Settings>FaceTime.

  • Why can't I use my Apple gift card for app purchases?

    Why can't I use my Apple gift card for app purchases? The Apple store sells iTunes gift cards, but I can't buy one with the remaining balance on my gift card.... Why won't you let me buy what I want to buy?
    Terrible policy.....

    No idea.
    Have you tried?
    What happened?
    Have you called and asked?

  • How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) inpu

    HI Experts,
    Pls. clarify that, How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) as input?
    ThanQ.

    Check with USRM1 Table
    give user name (Uname ) and you get company code (BUKRS)
    also check with other tables : USRM* in SE11
    Thanks
    Seshu

  • If there is no error in procedure/function, what is  value for SQLCODE..?

    Hi all...
    If there is no error in procedure/function, what is value for SQLCODE..?
    I Think, 0 (zero) is the default value for SQLCODE
    and default value for all other varaibles in PL/SQL is NULL. I am right or wrong...?
    Thanks in advance,
    Pal
    Message was edited by:
    user546710

    why not test?
    DECLARE
    err_code NUMBER(9);
    BEGIN
        err_code := SQLCODE;
        DBMS_OUTPUT.PUT_LINE(err_code);
    END;                                                                                                                                                                                                                                                           

  • Workflows use function to update value.

    As part of a workflow I'm trying to update an object value using Function Evaluator.
    However when I set the Workflow parameter to "Target" and look through the list of attributes (Parameter attribute), I don't see the attribute I'm after. This attribute is created in the FIM portal and when I look at the extended properties of
    an object in the portal I can see this property.
    Thanks for ur help.

    Hi,
    This attribute is binded to a custom object? There is an old issue that attributes are not listed in Function evaluator if they are not binded to Person or group object..
    But you can simply write it in the field, like [//Target/MyAtt]
    Regards,
    Sylvain

  • Can not input data when removed the value for seleciton condition

    Dear Experts,
    We met a very strange issue for the IP.
    We create a aggregation level and relatd query for user to key in data.
    We have a filter in the aggregation level.
    It will set value for A,B,C,D
    When user opent he report, system will require user to key in the value for A,B,C,D.
    Now we found that if we key in value for B, cell is input ready.
    If we removed the value in for the B in the selection condition (I mean the value of B is empty, this means tha all the value of B will display in the report), we can not key in data.
    Could you kindly let me kow the reason?
    Thanks and best regards
    Alex yang

    Dear Experts,
    Many thanks for your information.
    I know the principle for the IP.
    But I think you may misunderstanding this issue due to my incorrect explaination.
    First, we think the aggreagtion level is ok. This is due to that for the B in my example, we set its as column value in the query.
    This is means for each record in the IP query, it has only one B value to reflect it.
    But strange things is that if we set fixed value for B, IP input is ok.
    If we removed fixed value for B, IP function is error.
    Now, we will test if we key in multi value for B whether IP input function is ok or not.
    Any update, I will inform you.
    Thanks and best regards
    Alex yang

  • How to use different default parameter value for different report subscriptions

    In ssrs is it possible to define different default parameter values for different subscriptions? In the following example I have a report which has two subscriptions with different start date and end date values:
    Report name – Testsubscription.rdl
    Subscription-1
    Input parameter (default values):
    start_date = first day of current Month
    end_date = till date
    Subscription-2
    Input parameter (default values):
    start_date = first day of current Quarter
    end_date = till date
    I know an alternative way of doing this would be to copy the rdl file with a different name but I am curious whether this can be done within a single report definition file. I am using SQL Server 2008 R2 Standard Edition.
    Thanks!
    spp

    Hi sppdba,
    As per my understanding, there is a report with two parameter: start_date and end_date, you want to configure subscription for the report, and set different default values for start date and end date. And you want to know if it is possible to achieve you
    goal by using a single report definition file.
    Since you are using SQL Server 2008 R2 Standard Edition, we need to achieve your goal by configuring two subscriptions for the report. For detail information, please refer to the following steps:
      1. In design surface, right click start_date and open Parameter Properties dialog box.
      2. In General pane, type Name and Prompt, set Data Type to Date/Time.
      3. Click Available Values in left pane, select Specify Values.
      4. Click Add button, in Label text box, type “First day of Current Month”, click (fx) button in Value section, then type the expression like below:
    =DateSerial(Year(Now()), Month(Now()), 1)
      5. Click Add button, in Label text box, type “First day of Current Quarter”, click (fx) button in Value section, then type the expression like below, then click OK.
    =DateSerial(Year(Now()), (3*DatePart("q",Now()))-2, 1)
      6. Right click end_date and open Parameter Properties dialog box.
      7. In Available Values pane, select Specify Values.
      8. Click Add button, in Label text box, type “Today”, click (fx) button in Value section, then type the expression =Today(), then click OK.
    Now that the parameters are created, we need to configure subscription for the report. For detail information, please follow these steps:
      1. Open Report Manager, and locate the report for which you want to create a new subscription.
      2. Hover over the report, and click the drop-down arrow.
      3. In the drop-down menu, click Manage. This opens the General properties page for the report.
      4. Select the Subscriptions tab, and then click New Subscription.
      5. Select the delivery extension and data source for the subscription.
      6. Select a method of delivery, then choose report delivery options.
      7. Specify conditions that cause the subscription to process and delivery to occur.
      8. Set start_date to First day of Current Month, end_date to Today, then click OK.
      9. Create a new subscription as step4 to 7, set start_date to First day of Current Quarter, end_date to Today, then click OK.
    The following screenshots are for your reference:
    For detail information about Creating Standard Subscriptions, please refer to the following document:
    http://msdn.microsoft.com/en-us/data/ms156307(v=sql.105)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Using HttpHeader to set value for session variables

    Hi,
    We want to set values for 2 session variables (USER and ROLEID) using HttpHeader in obiee 11g. Has anyone tried this? How can we achieve this?
    I found the below note on the forum for setting value for the USER session variable. how can we set the ROLEID session variable also? is it possible to set values for 2 variables?
    for setting the USER session variable,
    You should add this in $BI_HOME/bifoundation/web/display/authenticationschemas.xml:
    <SchemaKeyVariable source="httpHeader" nameInSource="Proxy-Remote-User" forceValue="SSO"/>
    <AuthenticationSchema name="SSO" displayName="Single Sign On" userID="IMPERSONATE" proxyUserID="NQ_SESSION.RUNAS" options="noLogoffUI noLogonUI">
    <RequestVariable source="httpHeader" type="auth" nameInSource="Proxy-Remote-User" biVariableName="IMPERSONATE" options="required"/>
    </AuthenticationSchema>
    Please suggest.
    Thanks.

    I think maybe your SnmpValue type or value is not corrent.
    1.3.6.1.4.1.7064.201.1.200.100.0 is Enum control type
    when I use
    SnmpValue val = new SnmpString("0");
    It doesn't work, but when I use
    SnmpValue val = new SnmpInt(0);
    It works. I think the JDMK should give some warning message when the type is not correct. :)
    The code is following:
    final SnmpVarBindList setList = new SnmpVarBindList(" set varbind list ");
    SnmpOid oid = new SnmpOid("1.3.6.1.4.1.7064.201.1.200.100.0");
    SnmpValue val = new SnmpInt(0);
    SnmpVarBind valueBind = new SnmpVarBind(oid, val);
    setList.addVarBind( valueBind );
    SnmpRequest setRequest = session.snmpSetRequest(null, setList);

  • Can 2 people use the same I pad for the same apps?

    Can 2 people sharing an I Pad 2 use the same apps like games for instance?  Can each person log in when using the I Pad? Can you register the I Pad in 2 names so you can each individually use if for your own apps?

    One user only on the iPad, no way to create multiple user accounts in iOS.

Maybe you are looking for

  • Disk could not be read from or written to

    I'm a new ipod user. I can get songs on my ipod. But when I go to get photos I get an error message saying, "ipod cannot be updated. The disk could not be read from or written to." In itunes I can see the ipod. When I go to look at My Computer, it do

  • HT5622 How can I Login to my iTunes stores

    How can I login to my iTunes stores

  • Share Excel File that is password protected

    Hello all I have published a workbook in our shared area at work. It's massive and also has another workbook linked to it. Both are password protected so are only available for viewing. But tons of people need to see them particularly the source file

  • Reg deleting entries from internal table

    Hi experts,    I have two internal tables , ITAB1 and ITAB2 (same structure), i like to delete the records from ITAB1 which are in ITAB2 without looping .How it can be done? regards, Kannan

  • Give me two switchs...

    I am gona install workgroup switchs in 3days..I am confusing to choose ones. The followings are required. <<1>> (packets switching over 38.7Mbps). 1.24ports. 2.FabricSwitch Bandwidth: 28Gbps 3.supporting 10/100/1000 Mbps Ethernet ports each(over 24 p