Functions returning TRUE or FALSE

Morning chaps,
Wrote a function that converts a date in the format "01 Jan 2010" to a Unix timestamp. It also returns FALSE if it cannot convert the date it is being passed, which is great because I can use:
<cfif convertDateToUTS(FORM.date)>
     <cfset #date# = #convertDateToUTS(FORM.date)# />
     <p>Your date: <cfoutput>#date#</cfoutput></p>
<cfelse>
     <p>Could not convert date.</p>
</cfif>
Here is the function:
<cffunction name="convertDateToUTS" output="no">
    <cfargument name="date" required="Yes" />
    <cfargument name="time" default="00:00"/>
<cftry>
    <cfset #date# = trim(left(trim(date), 11)) />
    <cfset #time# = trim(left(trim(time), 5)) />
    <cfset #dateArr# = #listToArray(date, " ")# />
    <cfset #dateArr[2]# = #replace(dateArr[2], "Jan", 1)# />
    <cfset #dateArr[2]# = #replace(dateArr[2], "Feb", 2)# />
    ...etc...
    <cfset #dateArr[2]# = #replace(dateArr[2], "Dec", 12)# />
    <cfset #dateTime# = ArrayToList(dateArr, " ")&" "&time />
    <cfset #dateTimeBits# = listToArray(dateTime, " :") />
    <cfset #ODBCdateTime# = CreateODBCDateTime(CreateDateTime(dateTimeBits[3], dateTimeBits[2], dateTimeBits[1], dateTimeBits[4], dateTimeBits[5], 0)) />
    <cfset #unixDateTime# = #DateDiff("s", CreateDate(1970,1,1), ODBCdateTime)# />
    <cfreturn #unixDateTime# />
<cfcatch>
    <cfreturn FALSE />
</cfcatch>
</cftry>
</cffunction>
However, now I want to write a similar one which converts a timestamp to a date in that format:
<cffunction name="convertUTStoDate" output="no">
     <cfargument name="uts" required="Yes" />
<cftry>
     <cfset #date# = #DateFormat(DateAdd("s",uts,"1970/01/01 00:00:00"),"DD MMM YYYY")# />
     <cfset #time# = #TimeFormat(DateAdd("s",uts,"1970/01/01 00:00:00"), "HH:mm")# />
     <cfreturn #date#&" "&#time# />
<cfcatch>
     <cfreturn FALSE />
</cfcatch>
</cftry>
</cffunction>
This does the conversion correctly but it it won't let me use it as the condition in a CFIF like the first function does eg <cfif convertUTStoDate(uts)> but, it does work exactly as I want if I do this: <cfif convertUTStoDate(uts) NEQ FALSE>
What am I doing wrong? I really want it to behave like the first function when used in a condition. Massive thanks to anyone who can help!
T

What dou you think of the following version of your code? It is the same as your original code but, in my opinion, a bit simpler.  For example, your test now becomes something like
<!--- remember returntype is now a struct --->
<cfif convertDateToUTS(FORM.date).isConverted>
     <cfset date = convertDateToUTS(FORM.date).unixDateTime/>
     <p>Your date: <cfoutput>#date#</cfoutput></p>
<cfelse>
     <p>Could not convert date.</p>
      Reason: <cfoutput>#convertDateToUTS(FORM.date).message#</cfoutput>
</cfif>
<cffunction name="convertDateToUTS" output="no" returntype="struct">
    <cfargument name="date" required="Yes" />
    <cfargument name="time" default="00:00"/>
    <cfset var returnStruct = structNew()>
    <cfset returnStruct.datetime = "">
    <cfset returnStruct.isConverted= false>
<cftry>
    <cfset date = trim(left(trim(date), 11)) />
    <cfset time = trim(left(trim(time), 5)) />
    <cfset dateArr = listToArray(date, " ") />
    <cfset dateArr[2] = replace(dateArr[2], "Jan", 1) />
    <cfset dateArr[2] = replace(dateArr[2], "Feb", 2) />
    ...etc...
    <cfset dateArr[2] = replace(dateArr[2], "Dec", 12) />
    <cfset dateTime = ArrayToList(dateArr, " ")&" "&time />
    <cfset dateTimeBits = listToArray(dateTime, " :") />
    <cfset ODBCdateTime = CreateODBCDateTime(CreateDateTime(dateTimeBits[3], dateTimeBits[2], dateTimeBits[1], dateTimeBits[4], dateTimeBits[5], 0)) />
    <cfset returnStruct.unixDateTime = DateDiff("s", CreateDate(1970,1,1), ODBCdateTime) />
    <cfset returnStruct.message = "Conversion succeeded.">
    <cfset returnStruct.isConverted= true>
    <cfreturn  returnStruct>
<cfcatch>
    <cfset returnStruct.message = cfcatch.message>
    <cfreturn  returnStruct>
</cfcatch>
</cftry>
</cffunction>
<cffunction name="convertUTStoDate" output="no" returntype="struct">
     <cfargument name="uts" required="Yes" />
     <cfset var returnStruct = structNew()>
     <cfset returnStruct.datetime = "">
     <cfset returnStruct.isConverted= false>
<cftry>
     <cfset date = DateFormat(DateAdd("s",uts,"1970/01/01 00:00:00"),"DD MMM YYYY") />
     <cfset time = TimeFormat(DateAdd("s",uts,"1970/01/01 00:00:00"), "HH:mm") />
     <cfset returnStruct.datetime = date&" "&time />
     <cfset returnStruct.message = "Conversion succeeded.">
     <cfset returnStruct.isConverted= true>
     <cfreturn  returnStruct>
<cfcatch>
      <cfset returnStruct.message = cfcatch.message>
      <cfreturn  returnStruct>
</cfcatch>
</cftry>
</cffunction>

Similar Messages

  • Problems w javascript function return true/false

    Hi all,
    I have a javascript function that return true or false.
    It's called by a link in a report (URL-target):
    javascript:return showForr(&APP_ID.,&SESSION.,#PERSON_ID#,'#STARTDATUM#','#SLUTDATUM#');
    With the return it does NOT work. If I remove return it works with no problem but then I can't "end" the function where I want.
    Any pointers how I can achive what I want here?
    BR Daniel

    The solution is the to put a span around and make the on-click there:<br><br>
    select 'Daniel' namn, <br>'>span onclick="return test();"><br>>a href="javascript:test2();"><br>Calling func return true/false<br>>/a><br>>/span>'  id3
    from dualSee http://apex.oracle.com/pls/otn/f?p=22968:5:1350065385503137::::: for details.
    /D

  • Query (Select) that return TRUE  or false

    Hi
    I Need to do a query that return true or false
    SELECT TRUE INTO v_Envia_Maplink
    FROM SNCDE, SNAPL
    WHERE SNCDE.CDESEQ = OLD.CDESEQ AND
             SNAPL.APLCFJSEQ = CFJSEQ_VR AND
             SNCDE.APLCOD = SNAPL.APLCODHow can to do it ?

    Hi,
    you can use DECODE and have TRUE or FALSE returned.
    SQL> SELECT comm, DECODE(COMM, NULL, 'FALSE', 'TRUE')
    FROM EMP;
    COMM DECOD
    FALSE
    FALSE
    FALSE
    TRUE
    500 TRUE
    FALSE
    1400 TRUE
    FALSE
    FALSE
    FALSE
    FALSE
    COMM DECOD
    0 TRUE
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    FALSE
    selected.
    SQL>
    ThanksThanks
    something that retunr datatype BOOLEAN ?

  • Checking an Array with a form input field to return true or false?

    I have an array that when dumped, lists dates for all days of the month. There is a form, where the user specifies the date and when submitted, transfers to a processing.cfm file which is where i want the <cfif> to check if the date specified in form exists in the array (this way, it only limits the user of only being able to select a date from this month for an event). Is it possible to have a cfif where it will check whether or not the array contains the date the user has specified and the return true (if contains the date specified), and transfers the form to email.cfm (where it will email all the form inputs) or will return false (if outside that range) then return back to the eventform.cfm?

    Nevermind. Figured it out.
    Heres my code if it will help anyone:
    <!---CFSET's--->
                    <cfset theDate = Now()>
                    <cfset NextMonth = DateAdd('m', 1, theDate) />
                    <cfset nextMonthNum = daysInMonth(#NextMonth#) />
                    <cfset weekNum = (#weekOfMonth(now())#) />
                    <cfset daysNum = daysInMonth(now()) />
                    <cfset dateToday = Now()>
                    <cfscript>
                                                      function weekOfMonth(thisDate) {
                                                                var thisDay=day(thisDate);
                                                                var thisWeek=0;
                                                                if (thisDay LTE 7)
                                                                thisWeek=1;
                                                                else if (thisDay GT 7 AND thisDay LTE 14)
                                                                thisWeek=2;
                                                                else if (thisDay GT 14 AND thisDay LTE 21)
                                                                thisWeek=3;
                                                                else
                                                                thisWeek=4;
                                                                return thisWeek;
                                            </cfscript>
                    <cfset datearray = ArrayNew(1)>
                    <cfif #DatePart('w', TheDate)# GTE 2 AND #weekNum# GTE 3>
                        <cfloop index="x" from="1" to="#daysNum#">
                                      <cfset datearray[x] = "#DateFormat(now(), "mm")#/#x#/#DateFormat(now(), "yy")#" />
                                <cfset recordnumber = #x#>
                                                      </cfloop>
                        <cfloop index="y" from="1" to="#nextMonthNum#">
                                  <cfset potato = #y# + #recordnumber# >
                                      <cfset datearray[potato] = "#DateFormat(NextMonth, "mm")#/#y#/#DateFormat(NextMonth, "yy")#" >
                        </cfloop>
                                  <cfelse>
                                  <cfloop index="z" from="1" to="#daysNum#">
                                <cfset datearray[z] = "#DateFormat(now(), "mm")#/#z#/#DateFormat(now(), "yy")#">
                                  </cfloop>
                            </cfif>
                    <cfif #arrayContains( datearray, "#form.activitydate#" )#>
                              <cflocation url="monkey.cfm">
                                  <cfelse>
                                      <cfset datetrue = "no">
                                <script>
                                                                                    alert("Date Not Valid. Please Specify Event Date Within Valid Range.<br>(Allow a couple seconds to refresh)")
                                                                                    history.go(-1)
                                                                          </script>
                    </cfif>

  • Create link which returns true or false

    i need something that allows the server to send a message to the client asking them if they wish to acept a file. Idealy i would like it to be a link similar to that of msn messenger. but i cant seem to find something similar.. any sugestions as to what i could use would be great

    ive looked intho this option and it seems u required the actionevent listener to perform this task. howeve because im calling another gui there wont be a action event. i need create the pannel without a action click is there a way to do this?
            Component source = (Component) actionEvent.getSource();
            JOptionPane optionPane = new JOptionPane("Accept file?",
                JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);
            JDialog dialog = optionPane.createDialog(source,
                "File Sent");
            dialog.show();
            int selection = OptionPaneUtils.getSelection(optionPane);
            System.out.println(selection);Message was edited by:
    helen_166
    Message was edited by:
    helen_166

  • CI - Powershell Boolean Rule Always Returns True

    I'm trying to create a configuration baseline / item for a particular piece of software using a powershell script of data type Boolean. However, I'm having the issue that the evaluation is always returning compliant whether the workstation is or not. The
    script is as follows:
    $ErrorActionPreference = "SilentlyContinue"
    $Condition1 = (Test-Path -LiteralPath 'HKLM:\SOFTWARE\Adobe\Premiere Pro')
    $Condition2 = (Test-Path -LiteralPath 'C:\Program Files\Adobe\Adobe Premiere Pro CS6\Presets\Textures\720_govt1_bar.png')
    if ($Condition1) {
    if ($Condition2) {echo $true}
    else {echo $false}
    else {echo $true}
    This script works perfectly fine when run locally and always returns $true or $false as expected. However it only ever returns Compliant when used in a CI. It doesn't matter what the state of the 2 conditions are, it always evaluates Compliant.
    Any ideas?

    I'm beginning to wonder if there is variation between how well this feature works on Windows 7 and Windows 8.1. I'm beginning to notice that it usually works well on 7 but I have constant hell with it on 8. The last thing I tried which seemed to work (assuming
    it was not just randomness) was accepting the default "Platform" settings of the CI/CB. Before I had chosen Windows 7 and 8.1 only and was never able to return any value except Compliant on 8. Accepting the all platforms default Finally
    allowed me to show a state of Non-Compliant on 8. This was using a powershell script of string data type as discussed previously.
    My latest torment is discovering how to force a true re-evaluation of an updated CI/CB. In my non-compliant Win8 example, I have added a remediation script to an existing Monitor-Only CI and configured it to remediate. In my Win 7 members of the collection,
    everything works successfully, the condition is remediated and the state reports Compliant but on the Win8, although the local Control Panel applet shows both the CB and CI to have new revisions and the evaluation shows it has run with a new date/time,
    the remediation script never runs and changes to Compliant.
    Any suggestions how I can force an updated CI/CB to really re-evaluate, not just report it has?

  • If thing 1 is true return true. If thing 2 is true return false. (not quite like select function)

    I have two inputs within my LV program.  I need to output true (or value for true) if input 1 is true but output false (or value for false) if input 2 is true.  The select function allows different outputs but for only 1 input. 

    It should be fairly eeasy to come up with a boolean structure fo this.  For example, you have if input 1 as a true and input 2 as a true, what does it output???
    Normally you can make a table to figure out what structure you could use.  1 = true, 0 = false
    Input 1   Input 2   Output
    0            0            0
    0            1            0  
    1            0            1
    1            1             0 (I am assuming)
    That means if you write it out out need (input 1) * (input 2)' or an And terminal with input 1 wired to a terminal and input 2 wired to a not and then to the other and terminal (see picture)
    Kenny
    Attachments:
    ab not.gif ‏3 KB

  • How can I send an email when a function returns false?

    Im trying to make this code work, but i still receive an email when the function is equal to false. Can anyone assist me in finding the issue? What the program does is look for servers that has a set limit (in GB) on specific drives.
    #This Program goes through all the servers and informs any level below the limit
    $ErrorActionPreference = "SilentlyContinue";
    $scriptpath = $MyInvocation.MyCommand.Definition
    $dir = Split-Path $scriptpath
    #=================Function============
    Function isLow($server, $drive, $limit)
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'";
    [float]$size = $disk.Capacity;
    [float]$freespace = $disk.FreeSpace;
    $sizeGB = [Math]::Round($size / 1073741824, 2);
    $freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
    if($freeSpaceGB -lt $limit){
    return $true;
    else{
    return $false;
    #================Servers==============
    #------------------###server1--------------
    $server = "###server1";
    $drive = "C:";
    $lim = 25;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    $server = "###server1";
    $drive = "D:";
    $lim = 35;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    #-----------------###(more servers ect.)--------------
    #================EMAIL===============
    $smtpServer = "192.168.x.x"
    $ReportSender = "[email protected]"
    $users = "[email protected]"
    $MailSubject = "ALERT!!! Low DiskSpace"
    foreach($user in $users){
    if($true){
    Write-Host "Sending Email notification to $user"
    $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
    $msg = New-Object Net.Mail.MailMessage
    $msg.To.Add($user)
    $msg.From = $ReportSender
    $msg.Subject = $MailSubject
    $msg.IsBodyHTML = $True
    $msg.Body = $Alert
    $smtp.Send($msg)
    else($false){
    Write-Host "No one is pass the limit"

    Using a CSV is good.  Just load the "$servers" hash array from a CSV and the rest will work the same. The overall structure would work better if it was more like this.
    Function isLow($server, $drive, $limit){
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'"
    if($disk.FreeSSpace -lt $limit){
    $true
    }else{
    $false
    $servers=@()
    $servers=@{
    Server="###server1"
    Drive='C:'
    Limit=25Gb
    $servers=@{
    Server="###server2"
    Drive='D:'
    Limit=15Gb
    $servers=@{
    Server="###server3"
    Drive='C:'
    Limit=50Gb
    $results=foreach($servers in $servers){
    if(isLow $server.Server $server.Drive $server.Limit){
    '{0} || {1} is low<br>' -f $servers.Server,$server.Drive
    if($results){
    Write-Host 'Sending Email notification' -fore green
    $mailprops=@{
    SmtpServer='192.168.x.x'
    From='[email protected]'
    To=$users
    Subject='ALERT!!! Low DiskSpace'
    Body=$results
    BodyAsHtml=$true
    Send-MailMessage @mailprops
    }else{
    Write-Host 'No one is past the limit' -ForegroundColor green
    The biggest issue is to realize that this is a computer.  If you type the same thing more than once then consider that the computer can do it for you.  Once you learn to think like a computer all of this becomes easier.
    ¯\_(ツ)_/¯

  • Is their a activeX api function to set the database option "database logging enabled" to true or false?

    Hello!
    I want to decide dynamically while running a sequence to log the results to a database or not.
    So I need to set the "database logging enabled" property by a activex function call.
    Does a activex api function exist? I didn't found one, or is their an other way to change the property value?
    Thanks and regards
    M. Brosig

    Hi,
    Ah! I understand.
    You can change the runtime properties from you sequence or inside your step by using the Lookup string of
    "RunState.Caller.Locals.DatabasesOptions.DisableDatabaseLogging"
    Use the TS API  PropertyObject.SetValBoolean("DatabasesOptions.DisableDatabaseLogging", 0, newValue) method with RunState.Caller.Locals as your ActiveX Reference. (where newValue would be True or False.)
    Depending at what level you perform this API method depends how many "RunState.Caller" you have in your lookup string.
    eg.
    My example of
    PropertyObject.SetValBoolean("DatabasesOptions.DisableDatabaseLogging", 0, newValue) with RunState.Caller.Locals as your ActiveX Reference is based on a step in MainSequence which has been called by the Process Model sequence.
    If you have a step in a Sub-Sequence of MainSequence then the lookup string would be
     "RunState.Caller.RunState.Caller.Locals" as the activeX reference.
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Regex: how can Matcher.matches return true, but Matcher.find return false?

    Consider the class below:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class RegexBugDemo {
         private static final Pattern numberPattern;
         static {
                   // The BigDecimal grammar below was adapted from the BigDecimal(String) constructor.
                   // See also p. 46 of http://www.javaregex.com/RegexRecipesV1.pdf for a regex that matches Java floating point literals; uses similar techniques as below.
              String Sign = "[+-]";
              String Sign_opt = "(?:" + Sign + ")" + "?";     // Note: the "(?:" causes this to be a non-capturing group
              String Digits = "\\p{Digit}+";
              String IntegerPart = Digits;
              String FractionPart = Digits;
              String FractionPart_opt = "(?:" + FractionPart + ")" + "?";
              String Significand = "(?:" + IntegerPart + "\\." + FractionPart_opt + ")|(?:" + "\\." + FractionPart + ")|(?:" + IntegerPart + ")";
              String ExponentIndicator = "[eE]";
              String SignedInteger = Sign_opt + Digits;
              String Exponent = ExponentIndicator + SignedInteger;
              String Exponent_opt = "(?:" +Exponent + ")" + "?";
              numberPattern = Pattern.compile(Sign_opt + Significand + Exponent_opt);
    //     private static final Pattern numberPattern = Pattern.compile("\\p{Digit}+");
         public static void main(String[] args) throws Exception {
              String s = "0";
    //          String s = "01";
              Matcher m1 = numberPattern.matcher(s);
              System.out.println("m1.matches() = " + m1.matches());
              Matcher m2 = numberPattern.matcher(s);
              if (m2.find()) {
                   int i0 = m2.start();
                   int i1 = m2.end();
                   System.out.println("m2 found this substring: \"" + s.substring(i0, i1) + "\"");
              else {
                   System.out.println("m2 NOT find");
              System.exit(0);
    }Look at the main method: it constructs Matchers from numberPattern for the String "0" (a single zero). It then reports whether or not Matcher.matches works as well as Matcher.find works. When I ran this code on my box just now, I get:
    m1.matches() = true
    m2 NOT findHow the heck can matches work and find NOT work? matches has to match the entire input sequence, whereas find can back off if need be! I am really pulling my hair out over this one--is it a bug with the JDK regex engine? Did not seem to turn up anything in the bug database...
    There are at least 2 things that you can do to get Matcher.find to work.
    First, you can change s to more than 1 digit, for example, using the (originaly commented out) line
              String s = "01";yields
    m1.matches() = true
    m2 found this substring: "01"Second, I found that this simpler regex for numberPattern
         private static final Pattern numberPattern = Pattern.compile("\\p{Digit}+");yields
    m1.matches() = true
    m2 found this substring: "0"So, the problem seems to be triggered by a short source String and a complicated regex. But I need the complicated regex for my actual application, and cannot see why it is a problem.
    Here is a version of main which has a lot more diagnostic printouts:
         public static void main(String[] args) throws Exception {
              String s = "0";
              Matcher m1 = numberPattern.matcher(s);
              System.out.println("m1.regionStart() = " + m1.regionStart());
              System.out.println("m1.regionEnd() = " + m1.regionEnd());
              System.out.println("m1.matches() = " + m1.matches());
              System.out.println("m1.hitEnd() = " + m1.hitEnd());
              m1.reset();
              System.out.println("m1.regionStart() = " + m1.regionStart());
              System.out.println("m1.regionEnd() = " + m1.regionEnd());
              System.out.println("m1.lookingAt() = " + m1.lookingAt());
              System.out.println("m1.hitEnd() = " + m1.hitEnd());
              Matcher m2 = numberPattern.matcher(s);
              System.out.println("m2.regionStart() = " + m2.regionStart());
              System.out.println("m2.regionEnd() = " + m2.regionEnd());
              if (m2.find()) {
                   int i0 = m2.start();
                   int i1 = m2.end();
                   System.out.println("m2 found this substring: \"" + s.substring(i0, i1) + "\"");
              else {
                   System.out.println("m2 NOT find");
                   System.out.println("m2.hitEnd() = " + m2.hitEnd());
              System.out.println("m2.regionStart() = " + m2.regionStart());
              System.out.println("m2.regionEnd() = " + m2.regionEnd());
              System.out.println("m1 == m2: " + (m1 == m2));
              System.out.println("m1.equals(m2): " + m1.equals(m2));
              System.exit(0);
         }Unfortunately, the output gave me no insights into what is wrong.
    I looked at the source code of Matcher. find ends up calling
    boolean search(int from)and it executes with NOANCHOR. In contrast, matches ends up calling
    boolean match(int from, int anchor)and executes almost the exact same code but with ENDANCHOR. Unfortunately, this too makes sense to me, and gives me no insight into solving my problem.

    bbatman wrote:
    I -think- that my originally posted regex is correct, albeit possibly a bit verbose, No, there's a (small) mistake. The optional sign is always part of the first OR-ed part (A) and the exponent is always part of the last part (C). Let me explain.
    This is your regex:
    (?:[+-])?(?:\p{Digit}+\.(?:\p{Digit}+)?)|(?:\.\p{Digit}+)|(?:\p{Digit}+)(?:[eE](?:[+-])?\p{Digit}+)?which can be read as:
    (?:[+-])?(?:\p{Digit}+\.(?:\p{Digit}+)?)        # A
    |                                               # or
    (?:\.\p{Digit}+)                                # B
    |                                               # or
    (?:\p{Digit}+)(?:[eE](?:[+-])?\p{Digit}+)?      # COnly one of A, B or C is matched of course. So B can never have a exponent or sign (and A cannot have an exponent and C cannot have a sign).
    What you probably meant is this:
    (?:[+-])?                                   # sign       
        (?:\p{Digit}+\.(?:\p{Digit}+)?)         #   A
        |                                       #   or
        (?:\.\p{Digit}+)                        #   B
        |                                       #   or
        (?:\p{Digit}+)                          #   C
    (?:[eE](?:[+-])?\p{Digit}+)?                # exponent
    and that this must be a sun regex engine bug, but would love to be educated otherwise. Yes, it looks like a bug to me too.
    A simplified version of this behavior (in case you want to file a bug report) would look like this:
    When `test` is a single digit, m.find() returns _false_ but matches() returns true.
    When `test` is two or more digits, both return true, as expected.
    public class Test {
        public static void main(String[] args) {
            String test = "0";
            String regex = "(?:[+-])?(?:\\p{Digit}+\\.(?:\\p{Digit}+)?)|(?:\\.\\p{Digit}+)|(?:\\p{Digit}+)(?:[eE](?:[+-])?\\p{Digit}+)?";
            java.util.regex.Matcher m = java.util.regex.Pattern.compile(regex).matcher(test);
            System.out.println("matches() -> "+test.matches(regex));
            if(m.find()) {
                System.out.println("find()    -> true");
            } else {
                System.out.println("find()    -> false");
    }

  • Lot of returns on Playbook according to Futureshop tech. ? True or False ?

    Hi,
    I'm in Quebec city,
    According to a FutureShop tech. "1 of 2 Playbook sold are returned " ? "A lot more than other tablet"...
    True or False ? 50% ?
    What are the reason of return ? 
    He also told me "Playbook hardware is cheap"...
    I don't think so, I think that RIM is making good product.
    His friend, who work at BestBuy as seller, says the same.
    I'm the proud owner of a PlayBook, never had problem, and I don't hesitate to recommend it to my friends.
    So what's the truth ?  Thanks.

    Ha, you are not alone. I am annoyed by RIM-bashing also.
    It seems a popular sport of late, but as is usual, it normally comes from those immature people with some other inadequacy  in which they feel putting another down makes them feel greater.
    But I am also annoyed by mosquitoes and arrogant people the same, and 10,000 years, nothing has kept either from multiplying.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Page Validation - Function Returning Boolean - Check for NULL

    I have 3 Page Validations which all fire on "When Button Pressed" = "Submit".
    <br><br>
    Number 1 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT1".
    <br>
    Number 2 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT2".
    <br>
    Number 3 is of type "Function Returning Boolean" and has the following code:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NOT NULL, I get the Error from Validation 1. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NULL, I get the Error from Validation 2. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NOT NULL, I don't get an Error Message. Perfect.
    <br><br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NULL, I get Error Message 1 & 2, <strong>but nothing from 3.</strong>
    <br><br>
    If I change the code to:
    <br><br>
    IF :P199_BUSINESS_UNIT1 = '01'   AND
       :P199_BUSINESS_UNIT2 = '01'  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    and change both values to '01', I get the appropriate Error Message.
    <br><br>
    What is going on? Is there some reason I can't check for NULL in a Function Returning Boolean?

    Scott,
    <br><br>
    Instead of adding the Validations, I changed my code from:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;
    <br>to the following and got the desired results:
    <br><br>
    IF  REPLACE(:P199_BUSINESS_UNIT1,<strong>'%null'</strong> || '%',NULL) IS NULL   AND
        REPLACE(:P199_BUSINESS_UNIT2,<strong>'%null'</strong> || '%',NULL) IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    Note that I changed the word REPLACE to upper case and the second occurrence of the word NULL to upper case to accentuate the fact that the '%null' is case sensitive, using "%NULL' does not work, it has to be "%null' in lower case.
    <br><br>
    <strong>Thanks for your help.</strong>

  • [Help plz]Can't set a boolean attribute to true or false

    Hello,
    I'm new in NWDS development. I need to develop a download functionality
    I used a FileDownload UIElement for that and I created a node context (ExcelExport) with 3 attributes :
    - ExcelFile
    - ExcelIcon
    - And ExcelEnabled (Boolean type)
    My problem is that everytime I try to set the attribute ExcelEnabled to true or false, it return me a java.lang.NullPointerException
    I'm binding this attribute with "Enabled" property of the UIElement.
    Have anyone got this error before? Thanks a lot for your help.
    Kind regards,
    Safae.

    Hello Safae,
    Have you tried to put true/false value for the enabled property? I mean without using a context attribute?
    Also try to create the attribute out of the node.
    Regards,
    ImaneA.

  • Extract Function return NULL

    Hello All,
    I am new to XML so bear with me. I have a situation where I need to extract column field name from XML file stored in table column. I am trying to use extract function but getting NULL value from below SQL. In this case I am expecting to have list of all caption text listed. Please let me know what wrong I am doing below.
    SELECT X.XML.EXTRACT('/report/criteria/columns/column/columnHeading/caption/text()').GETSTRINGVAL() FROM <Table_name>
    XML File is stored in Column name XML in table
    - <saw:report xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlVersion="201008230" xmlns:sawx="com.siebel.analytics.web/expression/v1.1">
    - <saw:criteria xsi:type="saw:simpleCriteria" subjectArea=""Study Execution"" withinHierarchy="true">
    - <saw:columns>
    - <saw:column xsi:type="saw:switchGroupColumn" columnID="c997a816d5ca37338">
    - <saw:choices>
    - <saw:choice>
    - <saw:column xsi:type="saw:regularColumn" columnID="c8b17a7121096d3b2">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Study"."ICON Study No."</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="suppress" wrapText="true" interaction="action">
    - <saw:actionLinks showPopupMenuForOneLink="false">
    - <saw:actionLink actionLinkID="c8b17a7121096d3b2_ale3731f8d930e8604">
    - <saw:action>
    <saw:actionName>Deviations - Site Summary PM Dash Board</saw:actionName>
    - <saw:parameters allowExtraParameters="true">
    - <saw:parameter name="__navigateToBIContent__" type="string" mandatory="true" removable="true" order="999" multiValues="false">
    <saw:prompt>__navigateToBIContent__</saw:prompt>
    <saw:description />
    </saw:parameter>
    </saw:parameters>
    - <saw:assignments>
    - <saw:assign name="__navigateToBIContent__" fixed="true" hidden="true" parentFixed="false" parentHidden="false" xsi:type="saw:stringAssign">
    <saw:value>/shared/Clinical Operations/Project Managment Dashboard/Quality Tab/Deviations - Site Summary PM Dash Board</saw:value>
    </saw:assign>
    </saw:assignments>
    - <saw:implementation xsi:type="saw:ScriptActionType" executeOnClient="true">
    <saw:functionName>__navigateToBIContent__</saw:functionName>
    <saw:scriptLanguage>JScript</saw:scriptLanguage>
    <saw:scriptPath />
    </saw:implementation>
    - <saw:clientImplementation>
    <saw:customisation invokeConfirmation="false" />
    </saw:clientImplementation>
    </saw:action>
    - <saw:linkText>
    <saw:text>Deviation Site Summary</saw:text>
    </saw:linkText>
    </saw:actionLink>
    </saw:actionLinks>
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec interaction="none" />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    </saw:choice>
    - <saw:choice>
    - <saw:column xsi:type="saw:regularColumn" columnID="cd77e27e7b33767de">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Geography"."Region"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="suppress" wrapText="true" interaction="action">
    - <saw:actionLinks showPopupMenuForOneLink="false">
    - <saw:actionLink actionLinkID="cd77e27e7b33767de_alad0f25191c60257b">
    - <saw:action>
    <saw:actionName>Deviations - Site Summary PM Dash Board</saw:actionName>
    - <saw:parameters allowExtraParameters="true">
    - <saw:parameter name="__navigateToBIContent__" type="string" mandatory="true" removable="true" order="999" multiValues="false">
    <saw:prompt>__navigateToBIContent__</saw:prompt>
    <saw:description />
    </saw:parameter>
    </saw:parameters>
    - <saw:assignments>
    - <saw:assign name="__navigateToBIContent__" fixed="true" hidden="true" parentFixed="false" parentHidden="false" xsi:type="saw:stringAssign">
    <saw:value>/shared/Clinical Operations/Project Managment Dashboard/Quality Tab/Deviations - Site Summary PM Dash Board</saw:value>
    </saw:assign>
    </saw:assignments>
    - <saw:implementation xsi:type="saw:ScriptActionType" executeOnClient="true">
    <saw:functionName>__navigateToBIContent__</saw:functionName>
    <saw:scriptLanguage>JScript</saw:scriptLanguage>
    <saw:scriptPath />
    </saw:implementation>
    - <saw:clientImplementation>
    <saw:customisation invokeConfirmation="false" />
    </saw:clientImplementation>
    </saw:action>
    - <saw:linkText>
    <saw:text>Deviation Site Summary</saw:text>
    </saw:linkText>
    </saw:actionLink>
    </saw:actionLinks>
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    </saw:choice>
    - <saw:choice>
    - <saw:column xsi:type="saw:regularColumn" columnID="cb13030672571aad9">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Geography"."Country"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="suppress" wrapText="true" interaction="action">
    - <saw:actionLinks showPopupMenuForOneLink="false">
    - <saw:actionLink actionLinkID="cb13030672571aad9_al40e4484c67de09d6">
    - <saw:action>
    <saw:actionName>Deviations - Site Summary PM Dash Board</saw:actionName>
    - <saw:parameters allowExtraParameters="true">
    - <saw:parameter name="__navigateToBIContent__" type="string" mandatory="true" removable="true" order="999" multiValues="false">
    <saw:prompt>__navigateToBIContent__</saw:prompt>
    <saw:description />
    </saw:parameter>
    </saw:parameters>
    - <saw:assignments>
    - <saw:assign name="__navigateToBIContent__" fixed="true" hidden="true" parentFixed="false" parentHidden="false" xsi:type="saw:stringAssign">
    <saw:value>/shared/Clinical Operations/Project Managment Dashboard/Quality Tab/Deviations - Site Summary PM Dash Board</saw:value>
    </saw:assign>
    </saw:assignments>
    - <saw:implementation xsi:type="saw:ScriptActionType" executeOnClient="true">
    <saw:functionName>__navigateToBIContent__</saw:functionName>
    <saw:scriptLanguage>JScript</saw:scriptLanguage>
    <saw:scriptPath />
    </saw:implementation>
    - <saw:clientImplementation>
    <saw:customisation invokeConfirmation="false" />
    </saw:clientImplementation>
    </saw:action>
    - <saw:linkText>
    <saw:text>Deviation Site Summary</saw:text>
    </saw:linkText>
    </saw:actionLink>
    </saw:actionLinks>
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec interaction="none" />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    </saw:choice>
    </saw:choices>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cf5c435bd3d235724">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Study"."Sponsor Name"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cf48a34febca748ff">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Study"."Project Status"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="ce51ccb4c38ed538f">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Project Goverance"."Project Manager"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cf4bc5bea2531f3fe">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Study"."Indication"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="c430e05de61704a98">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Key Deviations"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cf658139b454c5a7f">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Non-Key Deviations"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="c1276c4cb2684ce42">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Key/Non-Key NA Deviations"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cea25118bedcf2772">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Site Life Cycle Metrics"."# of Sites Activated by Deviation"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    <saw:formatSpec suppress="repeat" wrapText="true" />
    </saw:displayFormat>
    - <saw:tableHeading>
    - <saw:caption fmt="text">
    <saw:text>Site Life Cycle Metrics</saw:text>
    </saw:caption>
    </saw:tableHeading>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    - <saw:caption fmt="text">
    <saw:text># of Sites Activated</saw:text>
    </saw:caption>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cae9b8f9cb7b8daba">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Key Deviations per Active Site"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="repeat" wrapText="true">
    <saw:dataFormat minDigits="2" maxDigits="2" commas="true" negativeType="minus" xsi:type="saw:number" />
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cbb0790d62c120f67">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Site Life Cycle Metrics"."# of Sites Activated with FPS by Deviation"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    <saw:formatSpec suppress="repeat" wrapText="true" />
    </saw:displayFormat>
    - <saw:tableHeading>
    - <saw:caption fmt="text">
    <saw:text>Site Life Cycle Metrics</saw:text>
    </saw:caption>
    </saw:tableHeading>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    - <saw:caption fmt="text">
    <saw:text># of Recruiting Sites (FPS)</saw:text>
    </saw:caption>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cec29c1b67bd731bc">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Key Deviations per Recruiting Site (FPS)"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="repeat" wrapText="true">
    <saw:dataFormat minDigits="2" maxDigits="2" commas="true" negativeType="minus" xsi:type="saw:number" />
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cf52f2d88d2e78ff9">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Subject Life Cycle Metrics"."# of Actual Subjects Randomized by Deviation"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    <saw:formatSpec suppress="repeat" wrapText="true" />
    </saw:displayFormat>
    - <saw:tableHeading>
    - <saw:caption fmt="text">
    <saw:text>Subject Life Cycle Metrics</saw:text>
    </saw:caption>
    </saw:tableHeading>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    - <saw:caption fmt="text">
    <saw:text># of Actual Subjects Randomized</saw:text>
    </saw:caption>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="c804cdbe82e3fa7f3">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Key Deviations per Rand Patient"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="repeat" wrapText="true">
    <saw:dataFormat minDigits="2" maxDigits="2" commas="true" negativeType="minus" xsi:type="saw:number" />
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="ce344decda5f6fd83">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Total Waivers"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    <saw:formatSpec suppress="repeat" wrapText="true" />
    </saw:displayFormat>
    - <saw:tableHeading>
    - <saw:caption fmt="text">
    <saw:text>Deviation Metrics</saw:text>
    </saw:caption>
    </saw:tableHeading>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    - <saw:caption fmt="text">
    <saw:text># Total Waivers</saw:text>
    </saw:caption>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="c0d6921698af79211">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Inclusion/Exclusion Waivers"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cef66aab5dfc4449d">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"- Deviation Metrics"."# Other Waivers"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="cb963b668b55786bb">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Deviation Level"."Deviation Level"</sawx:expr>
    </saw:columnFormula>
    - <saw:displayFormat>
    - <saw:formatSpec suppress="repeat" wrapText="true" interaction="clientEvent">
    <saw:clientEventSpec channel="Level" />
    </saw:formatSpec>
    </saw:displayFormat>
    - <saw:columnHeading>
    - <saw:displayFormat>
    <saw:formatSpec interaction="none" />
    </saw:displayFormat>
    </saw:columnHeading>
    </saw:column>
    - <saw:column xsi:type="saw:regularColumn" columnID="c15b89d8487d41b29">
    - <saw:columnFormula>
    <sawx:expr xsi:type="sawx:sqlExpression">"Deviation"."Deviation Type"</sawx:expr>
    </saw:columnFormula>
    </saw:column>
    </saw:columns>
    - <saw:filter>
    - <sawx:expr xsi:type="sawx:logical" op="and">
    <sawx:expr xsi:type="sawx:savedFilter" path="/shared/Clinical Operations/_filters/Study Execution/PM Dashboard - Quality" name="PM Dashboard - Quality" />
    - <sawx:expr op="prompted" xsi:type="sawx:special">
    <sawx:expr xsi:type="sawx:sqlExpression">"Deviation Level"."Deviation Level"</sawx:expr>
    </sawx:expr>
    </sawx:expr>
    </saw:filter>
    </saw:criteria>
    - <saw:views currentView="0">
    - <saw:view xsi:type="saw:compoundView" name="compoundView!1">
    - <saw:cvTable>
    - <saw:cvRow>
    - <saw:cvCell viewName="titleView!1">
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:cvCell>
    </saw:cvRow>
    - <saw:cvRow>
    <saw:cvCell viewName="columnSelectorView!1" />
    </saw:cvRow>
    - <saw:cvRow>
    - <saw:cvCell viewName="tableView!1">
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:cvCell>
    </saw:cvRow>
    - <saw:cvRow>
    <saw:cvCell viewName="filtersView!1" />
    </saw:cvRow>
    </saw:cvTable>
    </saw:view>
    <saw:view xsi:type="saw:titleView" name="titleView!1" includeName="false" startedDisplay="dateTime" />
    - <saw:view xsi:type="saw:tableView" name="tableView!1" clientEventChannels="MD1" clientEventEnabled="true">
    - <saw:edges>
    - <saw:edge axis="page" showColumnHeader="true">
    - <saw:displayGrandTotals>
    - <saw:displayGrandTotal id="t1" grandTotalPosition="none">
    - <saw:memberFormat>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:memberFormat>
    - <saw:dataBodyFormat>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:dataBodyFormat>
    </saw:displayGrandTotal>
    </saw:displayGrandTotals>
    </saw:edge>
    <saw:edge axis="section" />
    - <saw:edge axis="row" showColumnHeader="true">
    - <saw:displayGrandTotals>
    <saw:displayGrandTotal id="t2" grandTotalPosition="after" />
    </saw:displayGrandTotals>
    - <saw:edgeLayers>
    <saw:edgeLayer type="column" columnID="c997a816d5ca37338" />
    <saw:edgeLayer type="column" columnID="c430e05de61704a98" />
    <saw:edgeLayer type="column" columnID="cf658139b454c5a7f" />
    <saw:edgeLayer type="column" columnID="c1276c4cb2684ce42" />
    <saw:edgeLayer type="column" columnID="cea25118bedcf2772" />
    <saw:edgeLayer type="column" columnID="cae9b8f9cb7b8daba" />
    <saw:edgeLayer type="column" columnID="cbb0790d62c120f67" />
    <saw:edgeLayer type="column" columnID="cec29c1b67bd731bc" />
    <saw:edgeLayer type="column" columnID="cf52f2d88d2e78ff9" />
    <saw:edgeLayer type="column" columnID="c804cdbe82e3fa7f3" />
    - <saw:edgeLayer type="column" columnID="ce344decda5f6fd83">
    - <saw:headerFormat>
    - <saw:displayFormat>
    <saw:formatSpec />
    </saw:displayFormat>
    </saw:headerFormat>
    </saw:edgeLayer>
    <saw:edgeLayer type="column" columnID="c0d6921698af79211" />
    <saw:edgeLayer type="column" columnID="cef66aab5dfc4449d" />
    </saw:edgeLayers>
    </saw:edge>
    <saw:edge axis="column" />
    </saw:edges>
    </saw:view>
    - <saw:view xsi:type="saw:columnSelectorView" name="columnSelectorView!1" labelPosition="left" goButton="false">
    - <saw:selector prompt="true" columnID="c997a816d5ca37338">
    - <saw:label>
    - <saw:caption>
    <saw:text>Select Level</saw:text>
    </saw:caption>
    </saw:label>
    </saw:selector>
    </saw:view>
    - <saw:view xsi:type="saw:dvtchart" name="dvtchart!1">
    - <saw:display type="bar" subtype="default" renderFormat="default" mode="online" xAxisLiveScrolling="false" yAxisLiveScrolling="false" clientEventEnabled="false" animateOnDisplay="true">
    <saw:style barStyle="default" lineStyle="default" scatterStyle="default" fillStyle="default" bubblePercentSize="100" effect="2d" />
    </saw:display>
    - <saw:canvasFormat height="330" width="750" showGradient="true">
    <saw:dataLabels display="default" label="default" position="below" transparentBackground="true" valueAs="default" />
    - <saw:title mode="custom">
    - <saw:caption>
    <saw:text>Severity vs Deviation Type</saw:text>
    </saw:caption>
    </saw:title>
    - <saw:gridlines default="true">
    - <saw:horizontal>
    <saw:major visible="false" />
    <saw:minor visible="false" />
    </saw:horizontal>
    - <saw:vertical>
    <saw:major visible="false" />
    <saw:minor visible="false" />
    </saw:vertical>
    </saw:gridlines>
    </saw:canvasFormat>
    - <saw:selections>
    - <saw:categories>
    - <saw:category>
    <saw:columnRef columnID="c15b89d8487d41b29" />
    </saw:category>
    </saw:categories>
    - <saw:measures showMeasureLabelsOnCategory="false">
    - <saw:column measureType="y">
    <saw:columnRef columnID="c430e05de61704a98" />
    </saw:column>
    - <saw:column measureType="y">
    <saw:columnRef columnID="cf658139b454c5a7f" />
    </saw:column>
    - <saw:column measureType="y">
    <saw:columnRef columnID="c1276c4cb2684ce42" />
    </saw:column>
    </saw:measures>
    - <saw:seriesGenerators>
    <saw:measureLabels />
    </saw:seriesGenerators>
    - <saw:page>
    - <saw:column>
    <saw:columnRef columnID="cb963b668b55786bb" />
    </saw:column>
    </saw:page>
    <saw:sections displayAsSlider="false" />
    </saw:selections>
    - <saw:legendFormat position="default" transparentFill="true">
    <saw:textFormat />
    </saw:legendFormat>
    - <saw:axesFormats syncAxis="false">
    - <saw:axisFormat axis="Y1">
    - <saw:title mode="custom">
    - <saw:caption>
    <saw:text>Severity</saw:text>
    </saw:caption>
    </saw:title>
    <saw:labels />
    <saw:textFormat />
    <saw:scale scaleValues="auto" showMajorTicks="false" showMinorTicks="false" logarithmic="false" defaultTicks="true" />
    </saw:axisFormat>
    - <saw:axisFormat axis="X" displayScaleLabels="true">
    - <saw:title mode="custom">
    - <saw:caption>
    <saw:text>Deviation Type</saw:text>
    </saw:caption>
    </saw:title>
    <saw:labels rotate="15" rotateLabels="true" stagger="false" skip="false" abbreviation="default" />
    <saw:textFormat />
    <saw:scale scaleValues="auto" showMajorTicks="false" showMinorTicks="false" logarithmic="false" />
    </saw:axisFormat>
    </saw:axesFormats>
    - <saw:pageEdgeState>
    - <saw:QDR>
    - <saw:staticMemberGroup>
    - <saw:groupType>
    <sawx:columnRefExpr columnID="cb963b668b55786bb" />
    </saw:groupType>
    - <saw:members xsi:type="saw:stringMembers">
    <saw:value>Patient</saw:value>
    </saw:members>
    </saw:staticMemberGroup>
    </saw:QDR>
    - <saw:selectionGroups>
    <saw:selectionGroup columnID="cb963b668b55786bb" groupID="0" />
    </saw:selectionGroups>
    </saw:pageEdgeState>
    </saw:view>
    <saw:view xsi:type="saw:filtersView" name="filtersView!1" />
    </saw:views>
    <saw:prompts scope="report" subjectArea=""Study Execution"" />
    </saw:report>
    Edited by: Dinesh Chauhan on Jan 19, 2012 4:34 AM

    2) In reality I'll have another column defined in same table which will have same value as columnFormula (from xml file). I would need to extract caption from the XMLType and store in another column.OK, let's see if I understand correctly.
    You want to extract the caption text from the column where the columnFormula contains the value in COL1?
    If I'm correct, it's this one :
    <sawx:expr xsi:type="sawx:sqlExpression">" Site Life Cycle Metrics"."# of Sites Activated with FPS by Deviation"</sawx:expr>Assuming there's a unique match, you can do :
    SQL> SELECT XMLCast(
      2           XMLQuery(
      3             'declare default element namespace "com.siebel.analytics.web/report/v1.1"; (: :)
      4              declare namespace x = "com.siebel.analytics.web/expression/v1.1"; (: :)
      5              /report/criteria/columns/column[ora:contains(columnFormula/x:expr,$val)>0]/columnHeading/caption/text'
      6             passing t.xml
      7                   , t.col1 as "val"
      8             returning content
      9           )
    10           as varchar2(100)
    11         ) as caption_text
    12  FROM temp_xml t
    13  ;
    CAPTION_TEXT
    # of Recruiting Sites (FPS)
    If you want to update the same table, say COL2, you can do it directly like this :
    UPDATE temp_xml t
    SET t.col2 =
           XMLCast(
             XMLQuery(
               'declare default element namespace "com.siebel.analytics.web/report/v1.1"; (: :)
                declare namespace x = "com.siebel.analytics.web/expression/v1.1"; (: :)
                /report/criteria/columns/column[ora:contains(columnFormula/x:expr,$val)>0]/columnHeading/caption/text'
               passing t.xml
                     , t.col1 as "val"
               returning content
             as varchar2(100)
    ;

  • Function return boolean with combine query and validation

    Wondering how would you combine a query and the condition together...
    Right now i have a computation that would do a single sql query.
    and in my validation i would use a function return boolean call the result from the computation to do some if statements
    wondering how would you combine the two in the validation? ( tried pasting both in the validation but it doesn't seem to work.)
    Select count(NAME_ID)
    FROM table
    WHERE to_char(NAME_ID) = :P1_NAME_ID;
    IF :P1_results = 1 THEN
    RETURN TRUE;
    END IF;
    RETURN FALSE;

    OK, then does this work for you as validation on your item; P1_NAME_ID ?
    DECLARE
       l_rowcount   PLS_INTEGER;
    BEGIN
       SELECT COUNT (name_id)
         INTO l_rowcount
         FROM my_table
        WHERE TO_CHAR (name_id) = :P1_NAME_ID;
       IF l_rowcount = 1
       THEN
          RETURN TRUE;
       ELSE
          RETURN FALSE;
       END IF;
    END;Jeff

Maybe you are looking for

  • How to locally backup multiple iPhones with different IDs

    Hi all, I have a simple need to backup 2 iPhones using different Apple IDs.  I understand that I can use iCloud to backup each on the cloud and no issue there.  But when I ran local backup for both on the same computer, here comes the problem... The

  • Creation of package in 4.6C

    Hi, I want to create a package in 4.6C.. Is there any transaction for creating a package, apart from SE80.. In my requirement, i need to run a BDC for creating a package and for that reason i cannot use SE80. Suggest if any other tranx is there.. In

  • Update OSX 10.2.8 Build 6R73 repeatedly fails to install.

    Hi, I have an elderly but beloved iBook, 900Mhz Power PC G3 with 640 Mb. I have just replaced the failed hard drive and I have used the disks that came with the iBook to install OSX 10.2.1. I have successfully installed some updates e.g. Quicktime 6.

  • Does Oracle BPEL PM support WS-Coordination?

    Hi, I'm looking for a BPEL PM that implements transaction management, following the WS-Coordination specifications. Oracle has defined a Web Service Coordination Framework specification (WS-CF) in July 28, 2003. Does Oracle BPEL PM 10.1.2 implements

  • I cannot get rid of yahoo for search no matter what I;ve tried

    I am running windows 7 - FF 14.0.1 I cannot get rid of yahoo for search in search bar and resets to yahoo in search engines pres -no matter what I've tried - I had a YTD youtube downloader addon - i removed it - I change about:config url to http://ww