default value of the parameter date problematic SYSDATE

Hello

I finally discovered why a report of problems, but have no solution to the problem.

After the first run of the report and MORE (DESKTOP is no problem), I can open is no longer the LOV for any of the settings. The LOV icon is available, but nothing happens when you click it.

Now, I know the problem is a specific condition based on a date parameter.

The State is testing a date field against a setting that is based on NONE and has a default value of today. If I use effective dates in the setting I have no problem. If I use today or SYSDATE, then I can only run the report once. After that I can't choose any LOV in any of the settings. If I change the today or SYSDATE to a real, date is well again.

The State of origin that was used was based on a calculated field due2 defined as: DECODE (:due,'TODAY',SYSDATE,TO_DATE(:due,'DD/MM/YY'))

I tried to change the condition of:

date field < = TO_DATE(:due,'dd/mm/yyyy')

but also causing problems if I used SYSDATE or today in the parameter.

I then tried to change the calculated field to due2:
Decode (:due,'TODAY',to_date(sysdate,'dd/mm/yyyy'),to_date(:due,'DD/mm/YY'))
but it does not work.

Any suggestions?

Thank you.
Leah

Hi Lea,.
Try using 'CASES' instead of 'Decode' in your state:

-case when: due = trunc (sysdate) then 'Today'
of other end TO_DATE(:due,'DD/MM/YY')

Maybe it will solve your problem.

Note that this is problematic, because if the user enters an invalid date you will probably get an error.

I could do this a bit different...
1. create an optional parameter based on the date (so that I'll have the calendar)
2 create a condition where the parameter is empty, it will use SYSDATE.
for example:
=: due
OR (: due is null AND = trunc (sysdate))

Tamir

Tags: Business Intelligence

Similar Questions

  • problem with the default value of the parameter in function

    Hi all
    create or replace FUNCTION date_post_message (
    user_lock_in  IN  users.user_lock%TYPE,
    form_type_in  IN users.form_type%TYPE DEFAULT 0 ,
    date_in       IN                       DATE)
    RETURN BOOLEAN
    IS
    v_num number(1);
    BEGIN
    IF user_lock_in = 1 THEN
       RETURN FALSE;
    END IF;
    IF form_type_in NOT IN (1,2) THEN
       RETURN FALSE;
    END IF;
      SELECT 1
      INTO v_num
      FROM changes
      WHERE date_post_msg <= date_in ;
      RETURN TRUE;
    exception
    WHEN NO_DATA_FOUND THEN
    RETURN FALSE;
    END date_to_post_msg;
    problem: there is null, the function ignore the form_type_in default value 0.
    Why? the default value is valid only in the parameter of the procedure?
    Thanks to Advnaced
    Naama

    Naama wrote:
    If a value is null to convert it to 0? I mean in the part of the statement of the parameter

    No, can't do this in the signature. You will need to manage this by validating the parameters passed at the beginning of the function.

    It is quite simple. In your case, you might as well test for NULL and fail to function like this:

        FUNCTION date_post_message(
                user_lock_in IN NUMBER,
                form_type_in IN NUMBER DEFAULT 0 ,
                date_in      IN DATE)
            RETURN BOOLEAN
        IS
            v_num NUMBER(1);
        BEGIN
            dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
            IF user_lock_in = 1 THEN
                RETURN FALSE;
            END IF;
            IF form_type_in IS NULL THEN
                RETURN FALSE;
            ELSIF form_type_in NOT IN (1,2) THEN
                RETURN FALSE;
            END IF;
            RETURN TRUE;
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RETURN FALSE;
        END;
    

    In other cases of use I would issue a local variable and treat it like this:

            IF form_type_in IS NULL THEN
                l_form_type := 0;
            ELSE
                 l_form_type := form_type_in;
            END IF;
    

    Of course, the code should use the local variable rather than the parameter.

    It is a good practice to validate values passed in parameters at the beginning of a function. If you really want to go to the city, discover the Design By Contract.

    Cheers, APC

    Published by: APC on November 9, 2011 13:36

    Example added, as requested by OP

  • Default value for the field date

    Dear all
    I use form 10g.
    I have a field named date.
    Now I want that it should display the current date aoutmetically.
    How can I do this?

    Published by: Sandip Mohapatra, February 14, 2010 01:22

    Sandip,

    In the property Palette, set the initial value property as * $$DATE$ $*. So, it will return the current date.

    Kind regards

    Manu.

    If my response or response from another person was helpful, please mark accordingly

    Published by: Manu. February 14, 2010 12:23

  • If the default value of the field Date

    I have a DateFiled I need to initialize nuer a date I get a string

    String defaultResponse = "09092009";

    long date = Long.parseLong (defaultResponse);

    inputField = new DateField ("", date, new SimpleDateFormat ("DDMMYYYY"), DateField.DATE | ") DrawStyle.HCENTER);

    but I get '01011970', not the value, I'm putting in... can someone tell me what I'm doing wrong...?

    Kaddy

    You have found '09092009' convert to long, so it does not work as expected. The date is represented as a nuymber of milliseconds since 01/01/1970.

    First proposal, to set the date at this point, you should take System.currentTimeMills)

    To create a Date object, use Date dt = Date (System.currentTimeMills ()) new

    You can also create a calendar from the Date object object, and then manipulate the various components of the date (day, weel, year, etc.).

    Or, you can get a date in a format more known (as on 2009-09-09 12:00) and analyze it using HTTPDateParser.

    Please see the API documentation for details.

  • view the default values for the parameter.

    I've been messing around with my diagrams display today putting up my system bi-ecrans on my T61 running XP and I said accidentally spend only between the two regimes, and now I can't cancel it. Can someone help me?

    It is only switching when you press fn + f7? You should still be able to run deirector presentation of the start menu

  • How to change the default value of a parameter and LOV attached to a parameter

    Hi all

    I'm new to the discoverer reports and I need the following tasks:
    1. the need to change the SQL of a discoverer report
    2. need to change the default value of the parameter (from constant for the current month). In the discoverer more responsibility when I open the report and go to tools > > setting > > edit
    I can see the value of the default constant is given. On the right side there is a drop down that says "Value". I suppose that if I put a SQL as default, I need to change the drop-down list for sql or something and then put the code SQL. Problem is the menu drop-down is froezen and I can't change it.
    Even if I try to create a new report parameter.
    3 need to change the LOV associated with the element on which is based the setting.


    I have the discoverer more responsibility to myself and did not have the discoverer administrator (as forms 6i developer desktop tool) tool. My questions are:
    1. can I modify the SQL query using discoverer and responsibility or do I discoverer Administrator tool?
    2. any help on how to get the default value of an SQL query? Currently, it is a constant value.
    3. is there a way to understand is that the LOV is made of the constant values fixed (as a set of values independednt) or they are read in a SQL (value valid table sets)?

    Solutions pointers will be greatly appreciated!
    Thanks in advance.

    Thank you and best regards,
    Shashank

    It is not possible to use a default calculation for a paraeter

  • Set a default value in the target?

    Hi experts,

    How can I set a default value in the target data store that I'll use in the interface?

    Hello

    Open your store of target data column, click the Description tab and the default value is .

    Then in the interface, select this column and go to run on the TARGET.

    Implementing tab say, odiRef.getColDefaultValue)

    Thank you
    G

  • Block initialization parameter default value of the session variable used in default prompt as "(toutes les valeurs de colonne)" "

    Hello

    I have a business requirement for a dashboard that we built location to get the users that belong to a certain geographic location to the default view of the dashboard with guests together in their geographic area.  He is just giving them a default view to enhance their experience when they connect each day.   Because of the way that we put the default value for the period of time they watch, with the HELP of SAUVÉ the CUSTOMIZATIONS IS NOT AN OPTION.

    I created the default values for the prompt called "area" in a block of initialization. This variable is called V_USER.

    My problem is that only about 80% of users have a value of 'Area' in the hierarchy of our employees.   I would like to someone else by default "(toutes les valeurs de colonne)". "  I was unable to understand how and where do.

    Some of the things I've tried:

    (1)Setting the default value in the initialization of an empty space block ("in SQL)
    (2)Setting the default value in the initialization "(toutes les valeurs de colonne) block '"
    (3)Setting the default value in the initialization block 'null '.

    None of them have worked and the result is that the user who does not have an area ends with a load of zombie dashboard, and while the guest gave rise to fashion "- select value -", the user must press "Apply" again to get the dashboard to display the data.

    The text which lies behind the encircled area in green below correctly becomes the value of the variable to V_USER (it is empty as default and I don't have a box).

    For @{biServer.variables ['NQ_SESSION.]} {[USERS ']} the default zone must be @{biServer.variables ['NQ_SESSION.]} {[V_USER']} {}

    In the red circles below you can see that the guest actually becomes a value: *) nqgtu(* )


    The illustration below indicates the default value for a user without a box. the second quick block is not updated until you press on apply again...

    Thanks for your comments.  I was not able to make this work for my needs.  I have however to solve the problem by changing using a 'SQL result' for my default selection.  Then I created a query that returns rows NULL unless there is a correct answer:

    SELECT 'Service Delivery MOS '. "' Organizational hierarchy. "" Area ".

    "MOS DELIVERY."

    WHERE ("organisational hierarchy". ("" Area number "> 0) AND ("Service Delivery MOS". "Organizational hierarchy" "." " Zone' = ' @{biServer.variables ['NQ_SESSION.]} {[V_USER']} {} ")"

    The "returns no line' I mentioned above resulted in all values being selected.

  • Data mining - error on the insertion of the TREE_TERM_MINPCT_MODE value in the parameter array

    Hello

    In Data mining when I tried to insert some values into the parameter array. I get the error by trying to introduce TREE_TERM_MINPCT_MODE in the table.

    The model who was on trial for create was decision tree.

    BEGIN

    INSERT INTO DT_CA_SETTINGS_TEST (SETTING_NAME, SETTING_VALUE) VALUES

    (dbms_data_mining. TREE_TERM_MINPCT_MODE, to_char (1));

    END;

    Error report:

    ORA-06550: line 3, column 22:

    PLS-00302: component 'TREE_TERM_MINPCT_MODE' must be declared.

    ORA-06550: line 3, column 22:

    PL/SQL: ORA-00984: column not allowed here

    ORA-06550: line 2, column 4:

    PL/SQL: SQL statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    * Action:

    Thank you
    Srikanth.

    Hello

    BEGIN

    INSERT INTO DT_CA_SETTINGS_TEST (SETTING_NAME, SETTING_VALUE) VALUES

    (dbms_data_mining. TREE_TERM_MINPCT_NŒUD,to_char (1));

    END;

    This isn't 'Mode' his 'NŒUD '.

    Run now.

    See you soon...

  • Attempting to exceed some default values in the procedure

    HI gurus,

    I'm trying to set the default values, but the test in the test window, I get them as null.
    Can you please help?

    Procedure get_total_refunds (p_start_date IN default, trunc (sysdate) DATE - 1,)
    P_end_date IN trunc (sysdate)) default DATE is

    Published by: Tina on July 2, 2012 13:06

    Add DBMS_OUTPUT to your SP of debugging:

    create or replace
      procedure test_ref(
                         p_start IN date default trunc(sysdate)-1,
                         p_end   IN date default trunc(sysdate)
                        )
        is
        begin
            dbms_output.put_line('Start date is ' || to_char(p_start,'mm/dd/yyyy'));
            dbms_output.put_line('End date is ' || to_char(p_end,'mm/dd/yyyy'));
            for rec in (select * from table a where a.date_created >= p_start and a.date_created < p_end ) loop
              insert
                into table1
                values(
                       rec.column1,
                       rec.column2,
                       rec.column3
                      );
            end loop;
            -- commit; -- commit in procedure is bad design
    end test_ref;
    /
    

    Now in SQL * more the question:

    SET SERVEROUTPUT ON
    EXEC test_ref;
    

    Display the results.

    SY.

  • Best way to set the default values for the form elements

    Hello

    I have a form with a lot of defaults that is mentioned below...
      Field                      value  
      created by             :APPL_USER
      creation_date         SYSDATE
      last_updated_by     :APPL_USER
      last_update_date    SYSDATE
      item1                     value1
      item2                     value2
    I am currently using calculation-> after presents... then when we create/update a record... these computaion takes place and the default value for the inserted values get... THIS WORKS PERFECTLY WELL.

    I want to know... If this approach is fine OR we can have a better approach to achieve...?

    Thank you
    Deepak

    Hello

    I think it's good if it fits your need.

    But why you have these fields in the form?
    created by: APPL_USER
    CREATION_DATE SYSDATE
    last_updated_by: APPL_USER
    last_update_date SYSDATE

    The user can enter the ones?
    I thought that those who are to audit and I would fill those drop with trigger in the database.
    So that you get the same "correct" values if you need to manipulate the data with example of sql client

    BR, Jari

  • Definition of default values for the inputs of button and the cursor?

    Hello

    I use Labview 8.5.1 and have a few entries button and zipper-type on my front. How can I set some of them having specific (as opposed to zero) default values when the VI is executed?

    Thanks for the help

    The default value for the type of slide of entry (or button).

    Right-click on the control.

    Select "Operations on the data" > "default to the current value of doing."

  • default value in the row of the table

    a table whose lines can be added.

    My goal is that when you add lines some fields already filled will be, as in the screenshot.

    are configurable data thus cannot be fixed, however, by default is a value only.

    This value is a research will be comics.

    I tried, Vo, the attribute, add the default value to the SQL option, but is not allowed and in OT nothing happens.

    How to solve it?

    jdev version 11.1.2.4.0

    It is another way to get this working using the impl module and request entity. Need to add the java classes both of your elements (EntityImpl and ApplicationModuleImpl).

    Then, create a method in your Application module impl like this:

  • How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Mr President.

    How to set the default value of the attribute with a sequence number? Is it possible to add a string to seq.no. like abc0001?

    Concerning

    For the date, you can use groovy expression adf.currentDate to set the current date. reference http://adfgouravtkiet.blogspot.in/2012/11/how-to-set-default-values-for-entity.html

    You already have ways to use the sequence.

    How do you add a new value in the form. You're creating a new line of your page (user interface) and by engaging with validation operation? Unless you commit you will not be able to see anything in the table.

    Thank you

  • Can set the default value in the field with the rule

    I have a rule to set the xWebStartDate to dateCurrent(), but it does not work. I disabled all other rules, so there is no conflict. This rule is only to try to fix the date of xWebStart, nothing else.
    'Use the activation of rule condition' is checked. I selected 'Action of use' and 'check in Selected. I have added the xWebStartDate field and I have a default custom
    < $dprDefaultValue dateCurrent () = $ >
    Thus, it is for content that already exists and someone is to check in a new revision.
    I know that my rule works, because I added the dDocAuthor field and set it to "infOnly" and that works. This problem occurs if the action is updated also. But for check-ins again, I put the xWebStartDate to dateCurrent successfully.

    Update: it's existing content, which already has a xWebStartDate. The rule must replace the existing value.

    Edited by: ironarm February 1, 2013 17:58

    In your case, you cannot use default value for the new revisions, because your content is already a value for the metadata field.

    Alternative:
    (1) change your rule
    (2) on the general tab, check "Use activation Condition rule" and click Edit
    (3) in 'Edit Activation Condition' window, click on the tab "side effects".
    (4) add the following...

    <$if isCheckin $> [[%or you can also use (IdcService and IdcService like "CHECKIN_SEL_FORM")%]]
        <$xWebStartDate=dateCurrent()$>
    <$endif$>
    

Maybe you are looking for