PeopleCode Evaluate Statement

I want to write people code, kind of like the following, so I can validate the data entry for a specific edit field. The validation must go against a view.
This obviously errors or, does anyone know of an alternative where something like the following can be created?
Evaluate DEPT_NBR
When DEPT_NBR not in (Select DEPTNBR from VL__VW)
MessageBox(16, "Data Input Error", 24000, 17, "That is not a valid nbr.");
End-Evaluate;
Regards.

SQLExec will not work in this case. The function only returns one row and it sounds like this is not what you want.
The prompt table edit is your best option, but this is not possible if the edit is not being done through a page.
Now, if you need to use PeopleCode to accomplish what you want. The here is what you need to do.
Use CreateSQL or GetSQL functions to get all valid values from you view and then Fetch SQL class method to loop through the results against your Evaluate.
My Blog: http://www.CompShack.com

Similar Messages

  • How to write a nested if, or evaluate statement

    Cobol has the "evaluate" statement, which replaces nested if.
    It goes like this:
    Evaluate X
    When < 0, do this
    When >=0 and <5, do this
    When >=5 and <10, do this
    Is there any way to write something like this for a cell in Numbers?  How can I write a nested if to accomplish something like this?
    Tim Kelly

    Jerrold Green1 wrote:
    Action4 would cover cases of X>=10. It is optional.
    Well...kind of optional.  If X>=10 but there is no "Action4", the formula result will be a boolean FALSE. So it is optional only if X is never going to be >=10. But if that is the case, you don't need the last IF statement at all, you would put "Action3" as the "if false" parameter of the second IF statement.
    =IF(x<0, action1, if(x<5, action2, action3))
    if X<0 then action 1
    else if X>=0 and X<5 then action 2
    else action 3

  • SQL Tuning Advisor evaluates statement using wrong plan_hash_value

    The execution plan for one of my SQL statements changed this morning. The statement is in a third-party package. The new plan runs worse than the old plan. I had the SQL tuning advisor evaluate the statement. I ran it three times. Each time it evaluated the original plan, not the new one. I can tell that because the plan_hash_value shown in the advisor's recommendations is the old plan's plan_hash_value. The old plan no longer appears in DBA_HIST_SQL_PLAN. I do not understand why the advisor is using the original plan, nor where it is getting it. It does not show up in Oracle Enterprise Manager either.
    Has anyone see this before?
    Do you have any suggestions how I can force the advisor to evaluate the new execution plan?
    I am running Oracle Database Server 10gR2 Enterprise Edition.
    Thanks,
    Bill

    Following advice given earlier, I ran the SQL Tuning Advisor by executing DBMS_SQLTUNE from within a SQL*Plus session instead of via Oracle Enterprise Manager. The problem I originally encountered in OEM also happened using DBMS_SQLTUNE. Using DBMS_SQLTUNE I specified plan_hash_value => '3657286666' but the results of running create_tuning_task shows that the utility used a different plan_hash_value. See below:
    Based on this, I think the problem I originally blamed on OEM's creation of a SQL Tuning Advisor job was misdirected. I now believe that OEM supplied the proper information to the advisor, but the advisor did not correctly use what is was given.
    Below is what I submitted when I ran create_tuning_task and execute_tuning_task. Note that the value assigned to plan_hash_value is 3657286666. Following the messages from execute_tuning_task, see the output produced by the execution of report_tuning_task. In EXPLAIN PLANS SECTION heading 1 - ORIGINAL, note that Plan Hash Value = 3541843898.
    I submitted instructions to use plan_hash_value 3657286666 but instead it used 3541843898. Why did it do this??????
    I have not found a published bug that describes this condition.
    Thanks,
    Bill
    SQL> DECLARE
    2 stmt_task VARCHAR2(64);
    3 BEGIN
    4 stmt_task:=dbms_sqltune.create_tuning_task(sql_id => 'ab30ujpshkur3', plan_hash_
    value => '3657286666', time_limit => 3600, task_name => 'Tune_ab30ujpshkur3_3657286666'
    , description => 'Task to tune sql_id ab30ujpshkur3 plan_hash_value 3657286666');
    5 END;
    6 /
    PL/SQL procedure successfully completed.
    SQL> EXECUTE dbms_sqltune.execute_tuning_task('Tune_ab30ujpshkur3_3657286666');
    PL/SQL procedure successfully completed.
    Here is the output produced by report_tuning_task:
    SQL> SET linesize 200
    SQL> SET LONG 999999999
    SQL> SET pages 1000
    SQL> SET longchunksize 20000
    SQL> SELECT dbms_sqltune.report_tuning_task('Tune_ab30ujpshkur3_3657286666', 'TEXT', 'ALL') FROM dual;
    SELECT dbms_sqltune.script_tuning_task('Tune_ab30ujpshkur3_3657286666', 'ALL')
    FROM dual;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','TEXT','ALL')
    GENERAL INFORMATION SECTION
    Tuning Task Name : Tune_ab30ujpshkur3_3657286666
    Tuning Task Owner : EXPTEST
    Tuning Task ID : 110190
    Scope : COMPREHENSIVE
    Time Limit(seconds) : 3600
    Completion Status : COMPLETED
    Started at : 08/03/2012 14:47:45
    Completed at : 08/03/2012 14:48:54
    Number of Index Findings : 1
    Schema Name: EXPTEST
    SQL ID : ab30ujpshkur3
    SQL Text : SELECT ATTACHED_ACC_ID FROM SERVICE_EVENTS WHERE TSERV_ID = :B4
    AND EQ_NBR = :B3 AND ASSOC_EQ_NBR = :B2 AND (PERFORMED <= :B1 +
    1/1440 AND PERFORMED >= :B1 - 1/1440)
    FINDINGS SECTION (1 finding)
    1- Index Finding (see explain plans section below)
    The execution plan of this statement can be improved by creating one or more
    indices.
    Recommendation (estimated benefit: 100%)
    - Consider running the Access Advisor to improve the physical schema design
    or creating the recommended index.
    create index EXPTEST.IDX$$_1AE6E0001 on
    EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR');
    Rationale
    Creating the recommended indices significantly improves the execution plan
    of this statement. However, it might be preferable to run "Access Advisor"
    using a representative SQL workload as opposed to a single statement. This
    will allow to get comprehensive index recommendations which takes into
    account index maintenance overhead and additional space consumption.
    EXPLAIN PLANS SECTION
    1- Original
    Plan hash value: 3541843898
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    Time |
    | 0 | SELECT STATEMENT | | 1 | 32 | 4 (0)|
    00:00:01 |
    |* 1 | FILTER | | | | |
    |
    |* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 4 (0)|
    00:00:01 |
    |* 3 | INDEX RANGE SCAN | SEVENTS_PERFORMED | 18 | | 2 (0)|
    00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
    1 - SEL$1
    2 - SEL$1 / SERVICE_EVENTS@SEL$1
    3 - SEL$1 / SERVICE_EVENTS@SEL$1
    Predicate Information (identified by operation id):
    1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
    444
    44444444444444444444)
    2 - filter("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2 AND "TSERV_ID"=:B4)
    3 - access("PERFORMED">=:B1-.000694444444444444444444444444444444444444 AND
    "PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
    Column Projection Information (identified by operation id):
    1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    3 - "SERVICE_EVENTS".ROWID[ROWID,10]
    2- Using New Indices
    Plan hash value: 2568062050
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| T
    ime |
    | 0 | SELECT STATEMENT | | 1 | 32 | 2 (0)| 0
    0:00:01 |
    |* 1 | FILTER | | | | |
    |
    |* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 2 (0)| 0
    0:00:01 |
    |* 3 | INDEX RANGE SCAN | IDX$$_1AE6E0001 | 1 | | 2 (0)| 0
    0:00:01 |
    Query Block Name / Object Alias (identified by operation id):
    1 - SEL$1
    2 - SEL$1 / SERVICE_EVENTS@SEL$1
    3 - SEL$1 / SERVICE_EVENTS@SEL$1
    Predicate Information (identified by operation id):
    1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
    4
    4444444444444444444444)
    2 - filter("TSERV_ID"=:B4 AND "PERFORMED">=:B1-.000694444444444444444444444444444444
    4
    44444 AND "PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
    3 - access("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2)
    Column Projection Information (identified by operation id):
    1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    3 - "SERVICE_EVENTS".ROWID[ROWID,10]
    SQL> 2
    DBMS_SQLTUNE.SCRIPT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','ALL')
    -- Script generated by DBMS_SQLTUNE package, advisor framework --
    -- Use this script to implement some of the recommendations --
    -- made by the SQL tuning advisor. --
    -- NOTE: this script may need to be edited for your system --
    -- (index names, privileges, etc) before it is executed. --
    create index EXPTEST.IDX$$_1AE6E0001 on EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR')
    ;

  • OBIEE 11g, Essbase 11.1.2 || Using UDA in OBIEE

    Hi,
    I am trying to create a report with some UDA which have been imported in OBIEE.
    The way that I do the report is an easy report to test the UDA.
    Drag the generation of my dimension where I have UDAs, in filter I drag one of the 2 UDA that I have and I set the value as 1
    The result is giving me an error as in the mdx query is not filtering by UDA, it is asking for a member which for sure doesn't exist in the metadata as it is a UDA.
    This is the MDX
    With
    set [_LTC4] as 'Filter([LTC].Generations(4).members, ([LTC].CurrentMember.[CAUGHT]))'
    select
    { [Account].[Expenses]
    } on columns,
    NON EMPTY {{[_LTC4]}} properties GEN_NUMBER, [LTC].[MEMBER_UNIQUE_NAME], [LTC].[Memnor] on rows
    from [DICISGR1.ICISASOD]
    where [LTC].[CAUGHT] is the UDA imported in the physical layer in OBIEE, in the physical layer this object has as column type UDA and as type INT
    Has someone had the same problem trying to create a report using UDA?

    I have tried countless things. After putting in the EVALUATE statement in the Account dimension, I have tried dragging it in the prompts box, not dragging it in the prompts box, re-writing the EVALUATE statement several different ways and I still can't get this multi level filtering to work. Have you been successful with it ? If so, please post a picture of a report that has a drop down list of accounts that belong to different generations. At least I will know that it is possible to do it.
    I have read elsewhere to look at the log called 'NQQery.log'. Have you ever used that log as a trouble shooting tool ?
    Thanks.

  • Combine Accounts from different Generations into a single Table Prompt

    We are on OBIEE 11.1.1.6.2 and using an ASO (11.1.2.1) cube as a datasource.
    I wish to make a drop down menu of only ten accounts in OBIEE. These ten accounts do not all belong in the same generation. The desired Accounts are from Gen6, Gen5 and Gen4. How do I make a single drop down list with these ten accounts when the members belong to different generations ? I have tried building this custom list of ten accounts via Selection Steps but it seems that I cannot cross different generations of the Account dimension.
    Any help would be appreciated.

    Thanks for the reply Christian. I literally tried at least 100 possible iterations of the Evaluate statement and none of them will compile in OBIEE. Before posting, I scoured the Internet for days hoping someone else has had this issue resolved. I had no luck. If you know of anyone that has actually been successful with the EVALUATE statement to make a list of dimension members from different generations, please post the exact code snippet so that I can leverage off of somone else's knowledge.
    I have tried dozens of possible iterations of: with no luck at all.
    EVALUATE('Intersect(%1.dimension.members,{[Account1], [Account2]})',"Account"."Gen1,Account")

  • SOAP and Java within an Application Package

    We are doing an integration with Oracle Content Server. We have successfully checked in reports by sending a SOAP with attachments message in the application package PSRF_REPORT_CREATE calling custom Java methods.
    All is well, until we try and receive the SOAP response, in which nothing happens. After we call the checkin.SendMessage (our java method to checkin a report), we use the following generic PeopleCode insert statement just to test if the next line of the code is executing...
    SQLExec("INSERT INTO UCM_CHECKINLOG VALUES (1234, 'test')");
    This does not update our database, and it looks as if it is not even executing. We have also tried logging to a test file, but this fails to run as well. If it is directly after our soap request, why would it not run? Is there something we need to do to tell the system to wait for the response before commencing?
    Any help would be much appreciated.

    Just to make sure I understand the question... You customized the PSRF_REPORT_CREATE.CreateReport PeopleCode by adding some Java (JavaObject, etc). Is checkin your custom Java object with SendMessage being a method of that object? Are you using a Java SOAP client, like Axis2, to communicate with the Oracle Content Server or are you using Integration Broker? Again, just to verify, you are calling a Java method called "SendMessage." You can tell this is executing because you can see changes in your Oracle Content Server. However, as far as you can tell, no statements after that statement are executing. Is this correct?

  • Questions on Reflexive Access Lists

    Hi Sir,
    I'm trying to protect a server farm using reflexive access lists. I also would like any hosts to originate connections to the servers on TCP ports 23 (telnet) and 25 (smtp).
    The config on the core router is as follows:
    int Vlan10
    description *** Server Farm ***
    ip address 172.16.10.1 255.255.255.0
    ip access-group inboundfilters in
    ip access-group outboundfilters out
    int Vlan20
    description *** Marketing Department ***
    ip address 172.16.20.1 255.255.255.0
    int Vlan30
    description *** Engineering Department ***
    ip address 172.16.30.1 255.255.255.0
    ip access-list extended outboundfilters
    permit tcp any any eq telnet
    permit tcp any any eq smtp
    evaluate iptraffic
    ip access-list extended inboundfilters
    permit ip any any reflect iptraffic
    My questions:
    (1) I yet to test the above config on an actual router. However, is it correct theoretically?
    (2) If I were to allow outside hosts to initiate connections to the servers on more protocols/ports, I would be adding more normal "permit" statements in the outboundfilters ACL before the "evaluate" statement. Wouldn't this become very static-based, as far as security is concerned?
    (3) If you have other better feature options that meet my requirements, please do recommend.
    Please advise.
    Thank you.
    B.Rgds,
    Lim TS

    Hi Lim,
    CBAC is good as well, considering the following features:
    1. Traffic Filtering:
    - filters TCP and UDP packets based on application-layer protocol session information.
    - permit specified TCP and UDP traffic through a firewall when the connection is initiated from inside protected network, or outside network.
    2. Traffic Inspection
    - discover and manage state information for TCP and UDP sessions which is used to create temporary openings in the firewall's access lists to allow return traffic and additional data connections for permissible sessions.
    - Protect against DoS attack by checking/verifying sequence no (must be within the expected range) and discard unknown packets. Same goes to attack via fragmented IP.
    3. Alerts and Audit Trails
    - can send real-time alerts and audit trails to syslog server (or buffer log)
    4. Intrusion Detection
    - Embedded with 59 well-known IDS signatures. Similar to IDS features in PIX.
    Limitations:
    1. Only protect protocol you specify. The rest will depend on ACL you have in the router but not up to session layer.
    2. No protection for attacks originating from internal network, unless if you have firewall (pix/asa/ios-firewall) protection.
    3. Only protect certain type of well-known attacks only - based on 59 embedded IDS signatures
    For spoofing protection, i.e spoof attack from outside/common user segment, maybe you should apply RFC2827 (prevent IP on protected segment from coming back into that segment from outside). Make sure your ACL has the 'establish' keyword as well. As recommended by Cisco, you should apply multiple layer of security protection both on your router and other devices connected to it.
    Cheers!

  • Ichat.. not working at school?

    hi everyone
    I have a macbook and ive had it since july and ichat has been working fine since then and then just recently today i cant sign on. whenever i try it says: The connection to the host was unexpectedly lost.
    I've been at school for a month now and ichat had been working since except just today. ive tried changing my server to 443, using ethernet instead of airport, installed all software updates, and restarted like a million times. i dont know what to do and i'd really like to talk to my friends back home
    pleaseee help

    We just discovered the problem here at the University I work for. It appears that IChat utilizes random UDP ports after the invitation is sent. Instead of using UDP 5190 and 54500 (example) for each, it keeps randomizing the recipient port. So you could have several connections coming back to ports 54500, 54501, 54502 etc.
    Cisco, in their latest revision of IOS for the firewall and router, has issues with this. The old "fixup" protocol on the firewall worked flawlessly, however that is gone now (with 7.2.1) and has been replaced with the Inspect command. This doesn't work. On the firewall...if you are Inspecting RTSP and SIP, these need to be removed.
    Also, on our border routers we are using dynamic acl's with the evaluate option on UDP. This doesn't work either. We had to create an entry before the evaluate statement:
    permit udp any any eq 5060
    permit udp any any eq 5190
    permit udp any any range 16384 16403
    This fixed it....talk about a pain! All the other IM packages worked fine...MSN, Yahoo and AOL...but IChat was the difficult one.
    Hope this helps.
    S
      Mac OS X (10.4.7)  

  • Continue.

    Hi,
    I didn't see the advantage of "continue" statement. Normally with runtime system process, if the condition in the "if/else" statement is false, the control flow also terminated without evaluate statements inside. Can anybody show me the advantage? thank you
    Supposed we have such snippet code:
    for .... {
    var....
    statements...
    if ( )
    dosomething;
    VS
    for.... {
    var....
    statements...;
    if ( )
    continue;
    dosomething;
    Best regards

    I looove the availability of continue ;-)
    makes it a lot easier to code loops with heh.
    Just wait till you need to program something that requires a break from the current position in the loop, and move to the next round of the loop.
    Of course you could use if and elses, but I find continue handy ;-) saves some identations and stuff ;-)
    I wouldn't wish to do without the continue option... would be teh same like break, I couldn't live without the break option either ;-)
    anyways, my 2 cents.

  • Giving OR Statement in formula evaluates only one condition

    This is the formula I used in the reports record selection. I need to display the records in division number = 9 and division number = 20 and need records where other field top account = true as well in the reports. But it displays only first condition and not the second condition. The reason might be it checks for true for the first field and it ignores the second condition.
    ({Opportunity.Division Number} in ["09", "20"]) or {Opportunity.Top Account} = true
    I can't use and statement here, because I need records for all the conditions.  However it works in select query in oracle but not in crystal report.
    Let me know if there is any alternative.

    As Raghavendra.G suggests, if {Opportunity.Division Number} is null, the formula will not work as expected.  Crystal halts execution of any formula whenever it encounters a null value - unless it is enclosed in the IsNull() function.  It does sound like that is what your problem is, as the condition is correct for what you are trying to do.
    Perhaps you need to change the condition to:
    ({Opportunity.Top Account} = true) or {Opportunity.Division Number} in [09,20])
    (assuming the issue is a null Division Number...)
    HTH,
    Carl

  • Determine when a signal changes state and then evaluate second channel

    Ok, I need some help from you math geniuses (or those that remember calculus).
    I am recording two signals to a TDMS file, one is a pressure measurement and the other is a trigger monitor channel (basically it records a voltage change when the device is triggered).
    So what I want to do is when the device has been triggered (voltage changes from around 1 V to around 0 volts), I want to evaluate my pressure channel to see how quickly it gets above a certain threshold.
    I am thinking I need to integrate the trigger channel and somehow correlate that to the pressure channel, but I could be wrong.
    I attached a sample dataset.
    Thanks for the help.
    Kenny
    Attachments:
    sample data.txt ‏64 KB

    Could you not find PSI when on/off first reaches about 0 in your table, then grab the corresponding time, then find your PSI threshold, grab the time and subtract the two to get the elapsed time?  Or maybe I am missing something - I'm no math genius. 
    Edit:
    Oh, maybe you are evaluating them in real time and not from the table?
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Won't evaluate my if statement as true even though it is?

    import java.io.*;
    import java.util.Scanner;
    public class Main {
        private static final String DATAFILE = "Ass3.dat";
        private static final String INDEXFILE = "Ass3.idx";
        private static final int NAMELENGTH = 20;
        private static final int ADDRESSLENGTH = 100;
        private static final int PHONELENGTH = 15;
        private static final int RECORDLENGTH = NAMELENGTH + ADDRESSLENGTH + PHONELENGTH;
        public static void main (String[] args) {
            Table table = new HashTable();
            Scanner scan = new Scanner(System.in);
            byte buffer[] = new byte[RECORDLENGTH];
            String selection = "-1";
            String name = null;
            String address = null;
            String phNumber = null;
            try {
                RandomAccessFile dataFile = new RandomAccessFile(DATAFILE, "rw");
                File indexFile = new File(INDEXFILE);
                long nextRecord = dataFile.length();
                long recordNumber = nextRecord/RECORDLENGTH;
                if (indexFile.createNewFile()) {
                    //if no index file exists
                    System.out.println("There is no existing file. A file has been created.");
                    do {
                        System.out.println("");
                        System.out.println("Please select from the following options and input a number for your selection:");
                        System.out.println("[1] Create a new address book by loading a text file");
                        System.out.println("[2] Create a new address book by inputing records manually");
                        System.out.println("");
                        System.out.print("What is your selection? ");
                        selection = scan.next();
                        if ((!selection.equals("1")) && (!selection.equals("2"))) {
                            System.out.println("This is not a valid selection. Please try again.");
                    } while ((!selection.equals("1")) && (!selection.equals("2")));
                else { //the index file was found
                    ObjectInputStream is = new ObjectInputStream(new FileInputStream(indexFile));
                    table = (Table) is.readObject();
                    is.close();
                    System.out.println("An existing file has been found and loaded.");
                do {
                    if (selection == "1") {
                        System.out.println("This option is not yet available.");
                        selection = "$";
                    else if (selection == "2") {
                        while (selection != "$") {
                    ..etc I didn't post the whole thing because it's huge. I'm using bluej and i put a breakpoint in, when it gets to the if (selection == "1") satement, the debugger tells me it's got the value "1" but it skipps over the if statement that should be true :S
    Any suggestions?

    G.W. wrote:
    Just a small tip:
    it's always safe to do this:
    "1".equals(variable);and it's not always safe to do this:
    variable.equals("1");where of course variable was previously declared as String. First comparison will never throw an exception second one may cause NullPointerException when variable == null. So in order to avoid checking wheather or not you can actually invoke equals() on a variable it's beter to invoke equals on literal.
    Regards,Although having said that, it's not automatically a good idea to avoid NPEs. If the value should never be null, you have a bug, and you're as well to find it there, rather than somewhere further down the line

  • If statement in Custom Calculation Script

    I have 16 fields and if even one of them ="1" I have to list it in another field.  I do not want to count or sum.  If one of those fields has a 1 in it I just want the other field to display Y and if none have a 1 I want that field to display N.
    Please help.
    Thank you in advance~mjc

    You need to write a compound logical statement to evaluate all of the values and that statement needs to evaluate to true or false.
    Do you know how to write JavaScript?
    Do you know how to enter JavaScript calculations into a form field?
    For custom calculation of the text field I could write something like:
    // define an array of the field names to check
    var aNames = new Array("Text1", "Text2", "Text3", "Text4",
    "Text5", "Text6", "Text7", "Text8",
    "Text9", "Text10", "Text11", "Text12",
    "Text13", "Text14", "Text15", "Text16");
    // define a logical variable that is true if any field has a value of 1 - default is false or no field has a value of 1
    var bMatch = false;
    // value for text field
    var TextValue = 0;
    // logical value of field being equal to 1 test
    var FieldIs1 = false;
    // loop through all the fields and test the fields value
    for(i = 0; i < aNames.length; i++) {
    // logically OR the result of field i value equal to true with bMatch
    // get the value of field
    TextValue = this.getField( aNames[i] ).value;
    // test the value of the field
    FieldIs1 = Number(TextValue) == 1
    // logically OR the 2 values
    bMatch = FieldIs1 | bMatch;
    } // end field processing
    // set the field value
    if(bMatch == true) {
    event.value = "Y";
    } else {
    event.value = "N";
    You will need to change the field names to match your fields. You can add more field name or remove field names as needed and the script will adjust for the number of field names.

  • If statement in DI

    Hi all
    I'm wondering what the format of IF-ELSE block is in DI. I wan to check validation rules in my query in DI but my IF statement comes with an error. I searched a lot on the Internet but couldn't find the correct syntax. What I wrote is :
    If dateOfBirth < sysdate()
    datafobirth
    end
    Unfortunately there is no help for using functions in DI     It takes me a lot to figure out the correct syntax!!
    Any help is greatly appreciated.

    you can't put a block of logic in Query mapping, you mapping expression should evaluate to a value that will be assgined to the output column
    for Query mapping you will either use constants or expressions along with input columns, or use functions, you either put the logic in a custom function or use thefunctions provided by DI . the DI functions are documented with examples in the technical manual
    for you case you can use ifthenelse() function, or put the same logic in a custom function and call that here
    for example:- in a Query your mapping can be, if your source is a EMP table with DOJ as date column
    ifthenelse(EMP.DOJ < sysdate(), DOJ, NULL)
    or you can take DOJ as input to custom function and return the output based on your requirement

  • Can we use Evaluate Function in Dashboard Prompt

    Hi
    Can anybody tell me
    Can we use Evaluate Function in Dashboard Prompt.
    If yes...How
    Thanks in Adv

    Yes ! You Can!
    while creating the dashboard prompt, under "Show" pick SQL results and you write the SQL statement and include the EVALUATE function.
    I have several such examples. Most of of dashboard pages are parameter driven.
    1. 1st paratmeter - users specify the dates
    2. 2nd parameter - constrains the results for the period specified in 1st paramter and my SQL for 2nd paramter looks like this -
    SELECT table1.column1
    FROM table, datedim1, table1,table2
    WHERE datedim1.date BETWEEN EVALUATE( 'TO_DATE(%1,%2)','@{presentation variable1}','dd/mm/yyyy') AND EVALUATE('TO_DATE(%1,%2)', '@{presentation variable 2}','dd/mm/yyyy')
    HTH
    Mahesh

Maybe you are looking for

  • How to send e-mail with an attachment from remote database server.???

    Hi All, I have tried the simple mail sending and with the attachment using UTL_SMTP. But the problem is , it is sending the mail with attachment of the file name i give, it takes and creates that file and sends as attachment not from the actual file

  • Apex new installation - HTP package body has errors

    I installed apex on 10G. When i try to access the apex page, i get the following errors in log: [Sat Oct 28 08:39:25 2006] [error] [client 192.168.1.90] [ecid: 1162049964:156.153.112.151:9580:0:9,0] mod_plsql: /pls/apex/apex HTTP-404 ORA-04063: packa

  • Unlocked nokia 3230 memory card

    Pls i need ur help now

  • Adobe reader not operating correctly

    Since adobe reader updated to X, it has not worked correctly. It will run for about 10secs then will give "Not Responding" message and screen will turn translucent white (or gray). My operating system is vista, the reader version is 10.1.4. I've turn

  • Is it possible to change/mod email?

    I have changed companies, and wish to keep the same account with OTN but just change/mod my email. Is it possible to edit my current email?