General Code Syntax Question

Once in a while I come upon a situation where I need to use a
nested
if/else. Typically to first check to see if a value is null,
and, if not,
then do a proper check of the values. For instance:
dim returnValue
If myVariable is db.null value then
returnValue = X
else
if myVariable > 5 then
returnValue = X
else
returnValue = Y
end if
end if
I find that ugly, due to having to repeat 'X' twice, which
can be a pain if
X is actually a reall long string or the like.
What's a better way to handle that?
I've used this on occasion:
dim returnValue = X
If myVariable is db.null value then
nothing
else
if myVariable > 5 then
nothing
else
returnValue = Y
end if
end if
Which seems a tad less messy.
Thoughts?
-Darrel

dim returnValue = X
IF myVariable NOT null THEN
IF myVariable <= 5 THEN
returnValue = Y
END IF
END IF
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"darrel" <[email protected]> wrote in message
news:embksf$1uo$[email protected]..
>> dim returnValue = X
>>
>> IF myVariable <= 5 THEN
>> returnValue = Y
>> END IF
>
> The problem is that I have to check for NULL value
first. I can't compare
> a null value to an integer else I get an error.
>
> Perhaps this is just a limitation in ASP.net?
>
> -Darrel
>

Similar Messages

  • Code syntax for logical ABM components

    Hello,
    I have a simple programming question. I have a simple condition along the lines of,
    If  -1.5< Vd <1.5, then condition 1
    Otherwise, condition 2
    How does one do this in the ABM code syntax? I know in C+ it'd be along the lines of what I'd written above or use the && statement, however , I am not sure what is correct in Multisim.
    Thanks for any help

    Hello,
    Check the Multisim Help menu. Go to the search tab and type "supported mathematical function". You'll find All the functions with ekamples on using the ABM.
    For if you wanted the voltage of something based on some condition then,
    V={if(testCondition, condition1, condition2)}
    You can also see this white paper for more specific examples.
    http://www.ni.com/white-paper/5632/en
    Regards,
    Miguel V
    National Instruments

  • General Code of XA JDBC

    In my project , i need to write a general code for XA
    The problem I am facing to look for general method for passing URL . I couldn't find any way , even with alot of googling.
    Every provider, JDBC pointbase etc ,has its own method.
    BUT XADATASOURCE and XACONNECTION mentioned in JAVax.sql doesnt have method to pass URL ..
    XADATASource has method declration for
    XADataSource oxds1 = new XADataSource();
    oxds1.getXAConnection(String user ,String password)
    But where to specify URL..
    Please help on this. this is urgently needed in my project

    Thanks for your response.!
    My requirement is to write "GENERAL CODE" for suporting XA , it shouldn't be vendor specific. I noted it that every vendor has some SetURL like method but
    NO GENERAL INTERFACE METHOD that would be supported by each vendor
    For reference javax.sql.XADataosurce interfcae hs following setMethod
    void setLogWriter(java.io.PrintWriter out) throws SQLException;
    void setLoginTimeout(int seconds) throws SQLException;
    and above two doesn't have reference here
    and one relevaen method is
    XAConnection getXAConnection(String user, String password)
    but in this I CAN"T PASS URL
    Thanks

  • SOAP:Server, System Error SystemError , code MESSAGE.GENERAL /code

    Hi!!!
    I am testing a webservice and I am getting the following error
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>System Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context/>
                   <code>MESSAGE.GENERAL</code>
                   <text/>
                </s:SystemError>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
    </SOAP:Envelope>
    Kindly help me with the same.
    Thanking all of you in anticipation
    Regards,
    Kiran

    Hi Michal,
    Thanks for your prompt response. The above stated error is what I got after accessing it from soapUI.
    I tried to access it from the browser and it gave the following message
    - <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP:Header />
    - <SOAP:Body>
    - <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <faultcode>SOAP:Client</faultcode>
      <faultstring>Empty HTTP request received</faultstring>
      <faultactor>http://sap.com/xi/XI/Message/30</faultactor>
    - <detail>
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIProtocol</SAP:Category>
      <SAP:Code area="MESSAGE">EMPTY_HTTP_REQUEST_RECEIVED</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Empty HTTP query received; message processing not possible</SAP:Stack>
      </SAP:Error>
      </detail>
      </SOAP:Fault>
      </SOAP:Body>
      </SOAP:Envelope>
    Thanks for your help.
    Regards,
    Kiran

  • A syntaxic question...

    Hi guys,
    I've posted about this on this very forum before, but I can't find my own question... and the answers that you people provided, so I'll do it again: what's wrong with the following, knowing that I have Developer Tools installed and that I clearly remember writing a script along those lines a long time ago, when I was still using Tiger?
    Here goes:
    "move mouse
    720, 450 {from left, from top}"
    Where the goal is to move the mouse pointer center screen on startup (don't bother about compiling and saving as an app, just about the right syntax). Something's missing, but I can't put my finger on it...

    The app developer once told me that the delay in activating the mouse was built-in, because it took the Trackpad some time (usually no more than a second or two) to fully activate. So I guess I can't get anything better than what I already have: at least I don't accidentally trigger the Apple menu by trying to move my mouse pointer to screen center...
    Well, trying to stress my brain to figure out an impossible solution.
    FWIW, here's the code, before modification:
    move mouse {720, 450} -- {from left, from top}
    click mouse
    delay 0.1
    click mouse
    delay 0.1
    move mouse {730, 460} -- {from left, from top}
    I'm going to add a two-second delay between the two mouse clicks, just in case. I'll keep you posted. As for the compliment, it's amply deserved, and I'm not the only one on this forum who says so...
    I you are trying to simulate a double click, you need to make the delay closer to what a human would do. Two seconds will most likely turn the double click into two single click.
    2
    All this is probably not need since you fessed up to it being a driver problem.
    Cheers!
    Thanks again for your rewarding comments.

  • General Airport Extreme questions

    I have some general questions regarding the dual band technology and how it relates to my specific setup. A bit of background:
    I have 20Mbps cable internet and I am running the new Airport Extreme on a pc running XP to broadcast my wireless signal. I have an iPhone 3GS, iPhone 4 and iPad. I also have an Airport Express that I use in bridge mode so that I can connect my PS3 in a wired fashion.
    My questions:
    -How do wireless networks work when you have both "g" and "n" devices? (which I do)
    Does the router send out simultaneously a 2.4 and 5.0 signal for each capable device to pick up? Do the g devices pick up the 2.4 signal while the n devices pick up the 5.0? Or do all devices pick up the 2.4 signal since there are non "n" rated devices on the network? I have read many conflicting ideas on this.
    - I have spoken with multiple Apple customer service people and have gotten differing advice on how to improve my devices' connectivity to the network as I have been experiencing unacceptable levels of interference on all devices.
    One rep reccomended that in the Airport Utilities, under wireless options that I check the 5GHz box to setup a seperate 5GHZ network for the n devices. Another rep dismissed this idea.
    Does creating this new 5.0 network keep the network signal from being bumped down to "g" speeds when "g" rated devices are connected?
    How am I to better off setting my networks up so that my n devices as well as my g devices get the best performance and connectivity?
    -I use an Airport Express in bridge mode with my PS3 and it seems to be helping my connections speeds. When I was connected wirelessly, the speeds would either be non-existent or unacceptable. I know the PS3 has a "g" antenna. I have the airport express connected to the 5.0ghz wireless network in Airport Utilities. Am I actally now connecting to the 5.0ghz signal and converting to the PS3 at higher bandwidth then I would be otherwise if I was connected to the 2.4ghz wireless signal?
    I appologize for the longwinded post.
    Any insight I will be most appreciated as I am banging my head against the wall here.
    Scott

    The default setup for the AirPort Extreme provides a dual band wireless network with a Radio Mode that looks like this:
    802.11a/n --- 802.11n/g/b
    The 5 GHz band is on the left and the 2.4 GHz is on the right of the --- dashes
    Also as a default, the same wireless network name is used for both bands. The theory here is that any device will automatically connect to the best signal quality. This works great for older "g" devices because they can only connect to the 2.4 GHz band, so you know where they will be at all times. You never need to be concerned about a "g" device slowing down a faster "n" device on the 5 GHz band because the "g" device cannot even connect to the 5 GHz band.
    But note that newer "n" devices can connect to either the 5 GHz band or the 2.4 GHz band. So, it's possible that you may have a "n" device and a "g" device on the 2.4 GHz band and the "n" connection will slow a bit if the "g" device is really active.
    It gets a bit more complicated if you have a new iPhone, which can connect at "n" speeds, but only to the 2.4 GHz band. The new iPad can connect to either 2.4 GHz or 5 GHz.
    Most users are better off if they leave the settings as recommended on the AirPort Extreme. That's because each device will connect to the band with the best available signal quality. Isn't that what you really want?
    If you will concentrate on signal quality, which is a combination of signal strength and low noise, you'll be fine.
    Most problems arise when users think that they want to connect to the 5 GHz band because the speeds can be faster there. So, they assign a separate name to the 5 GHz network and then "point" their computer at that band. The potential issue with doing this is that 5 GHz signals are much weaker than 2.4 GHz signals.
    So, if the computer is several rooms away and you have "forced" it to connect to 5 GHz, you are likely telling it to connect to a signal that is both +weaker and slower+ than the 2.4 GHz signal at that location. The signal always slows down as it moves further from the router or encounters obstructions.
    As I said, most users will do well to use the default settings and let each device find the best connection automatically. With a mix of a number of devices, you'll never be able to find the single "perfect" setting. With wireless, there are always compromises. No way to avoid that, I'm afraid.

  • General and specific questions on the applicability of Sun Studio 11

    Hi. In an e-mail letter from Sun Microsystems I read about Sun Studio 11 to "utilize its record-setting parallelizing compilers." From this message I was attracted by the possibility of adding something like parallel processing, not by changing the processor (hardware), but by adding Sun-Studio-11 software to a Linux operating system. Now I already have a Fortran compiler, the Intel Fortran Compiler for Linux, which is free and can handle Cray-style pointers, a feature hard to find in a free Fortran compiler.
    1a. So for the most basic of questions, without having parallel-processing hardware, just an ordinary processor [a 1-GigaHertz (GHz) Advanced MicroDevices Duron central processing unit, in my case], is it possible to have parallel processing and thereby increase one's computing speed by installing Sun Studio 11 in a Linux operating system?
    1b. If so, by what factor could one expect the speed of computation to increase over not having Sun Studio 11 installed? (If the gain in speed is dependent on the type of computations being performed, I imagine possibly using a Fortran code to perform numerical calculations using and perhaps searching for minima or maxima in a two-or-more-dimensional surface. So please give me an idea of the sort of gain in speed one could expect for these two types of activites, calculations using formulas and searches for minima and maxima among already-computed quantities.)
    1c. Again if so, how could one just by adding software have parallel processing without two or more hardware processors? In other words, what is the basic working principle of the software to make the simultaneous performance of multiple tasks (multitasking or parallel processing) possible?
    2a. Does Sun Studio 11 include a Fortan compiler?
    2b. If so, must one use it to have parallel processing with Sun Studio 11?
    2c. Or will the Intel Fortran Compiler for Linux work with Sun Studio 11 to have a parallel processing capability?
    Concerning hardware requirements I read that Sun Studio 11 requires a minimum of 512 MegaBytes (MB) of memory, presumably Random Access Memory (RAM). My Hewlett-Packard, ZE1110, Pavilion, notebook computer has 256 MB of RAM, but is expandable to a maximum of 512 MB of RAM. So in this respect it is in principle at least technically possible for me to meet the minimum system requirement for Sun Studio 11 with my computer, if I choose to increase its RAM. Somehow accommodating the cost of such a RAM addition, including whether one may have to buy two, matching, 256-MB RAM modules or just presumably one additional 256-RAM module, is another requirement. But before spending money for such an upgrade, one should first thoroughly investigate other matters to determine if other things are going to work and to determine what gain, if any, one could expect in computing speed with Sun Studio 11 and an additional 256 MB of RAM; then decide, based on such data, whether the purchase is personally worth the money or not. That's one motivation behind this posting; another motivation is for me to learn some things.
    Lastly I would like to here thank whoever was thoughtful enough to provide the Sun Download Manager (SDM) 2.0, which allows the pausing and resumption of the 207-MB download studio11-lin-x86.tar.bz2 for the Linux version of the Sun Studio 11! Using a slow, dialup, Internet connection like mine having a maximum speed of 28.8 kilobits/second, this makes it possible to download that file over a number of Internet sessions instead of having to have an uninterrupted, 19-or-more-hour Internet session. Besides the invconvenience of tying up one's telephone line for that long a time, it might be even be difficult to have such an uninterrupted Internet session for that long a time. I have at least started such a download using the SDM 2.0 potentially over multiple Internet sessions. Whether or not I carry it out to completion could depend on whether everything looks good with Sun Studio 11 for my particular situation. Thanks in advance for your help.

    Thanks for both of your postings here. I'm mostly trying to learn something here.
    From Maxim Kartashev: "For example, if one thread (or process, or lwp) frequently performs an I/O operation, then the other thread (process, lwp) can utilize processor resources to perform, say, some computations while first one waits for operation to complete."
    I think I might understand what you meant above. I guess lwp in the above context stands for light-weight process. And I think you may be talking about a potential gain in speed with just one, ordinary processor. I guess you meant that one program, or perhaps group of programs, could perform input/output processes at the same time it is performing calculations because different parts of the processor are being used in these two groups of processes. Then on "while first one waits for operation to complete" I guess you meant that if the input/output operations finish before the computations finish, then thread 1 that was performing the input/output operations will have to wait until the current computations ordered by thread 2 are complete before thread 1 can utilize the computational resources for its own computations; i.e., two threads can't use the same computational resources of an ordinary processor at the same time. How is my thinking so far, Maxim, right, partly right, or all wrong?
    Now if the above thinking of mine is right, then it appears that one could have some gain in speed doing things like you suggest with just one, ordinary processor. And if so, I imagine that the gain could be a maximum of a factor of two for a program that requires spending as much time in input and output as it does in computation; i.e., keeping both the computational and input/output resources working all of the time without the input/output resources waiting on the computational resources or vice versa. How is my thinking here?
    If the above thinking is correct, just for purposes of discussion with just one, ordinary processor, not a dual processor, and a program which does nothing but computations there would be no gain in speed using Sun Studio 11 and a Fortran compiler over not using Sun Studio 11. In other words, to increase the speed of computation one would have to buy a faster computer, buy parallel processing hardware for an existing computer and use parallel-processing software, or somehow figure out how to harness two or more computers to work for you at the same time with instructions from one piece or perhaps set of pieces of code set up for parallel processing using two or more different computers. The latter case would be a computer analogue or "two 'heads' are better than one," not human heads, but computers. How is my thinking here?
    Here I am still assuming that it is possible for one processor to be used to do two different kinds things at once. However, I don't see how one Fortran program could instruct two things to be done at once. This is because I have not seriously studied parallel processing, I suppose. That is I am used to a sequential set of instructions that proceed from top to botton down the lines of code; i.e., one instruction or line of code can't be executed until the line of code before it has been completely executed. That is the computing "world" with which I am familiar. So how about someone here teaching me with an example of parallel-processing Fortran code how parallel processing works, explaining what instruction or group of instructions tells the computer to execute input and computational instructions at the same time?
    Based on the encouraging information from one or more other people I have been able to use the Intel Fortran for Linux 8.1.024, if I remember correctly, in a computer with a 1-GigaHertz (GHz), Advanced MicroDevices (A.M.D.), Duron Processor. So this is at least one case where it is not essential to have an Intel processor to use the Intel Fortran Compiler for Linux 8.1.024.
    Is the Sun Fortran compiler free for personal use? And can it handle Cray-style pointers?

  • Please help with an ICM script editor syntax question.

    I need to modify a set variable node.  What I have now is Call.PeripheralVariable8+".wav" and this works.  What I need it to say is Call.PeripheralVariable8+anything+".wav" but when I insert an * for the anything it's seen as a multiplier.  What's the syntax to do this?  The anything I need to add is _9xxx where xxx are other numbers, but the _9 will be in all, if that helps any.  Thanks in advance !!

    You can use the concatenate() function to build up your string, as you no doubt know.
    As far as the wildcard goes ... your intention must be to try to SET the call variable and later on test the call variable with an IF node. Is that right?
    You would be able to test parts of the string using the substr() function - which is based on character position. If that is a fixed value that you know, it's easy. If it's not, you can first use the find() function to locate something (like the "_9"), returning the position, and then use the substr() function to pull it off.
    Can you write some pseudo-code here to define exactly your intention? You can set up a dummy script and send a dummy call through using Call Tracer and watch the output to see how your code is working.
    Regards,
    Geoff

  • ABAP Runtime ERROR Error Code & Syntax Error in program SAPLSFES

    Hi,
    I am installing SAP XI 3.0 and as part of that I have installed the ABAP and Java WAS. I am applying SPs for the ABAP stack and I successfully applied the BASIS SPs 10 and 11(applied seperately). I was applying the SPs 12 and 13(together) and after running for some time the system crashed and I restarted the O/S and SAP to see that the SPs didn't go thru. Now when I try to log on using SAP GUI, it says "<b>ABAP Runtime ERROR Error Code</b>" which is blank and at the Bottom there is this message "<b>Syntax Error in program SAPLSFES</b>".
    Pls any one help me ,
    Kind Regards,
    Gopi.

    Hi Gopi,
       If u r applying patches, the system would be running a background job SAPLSTPA. Hence you willnot be able to login till the job is complete.
      You can check the job completion in the Windows MMC console.
    Rgds
    Ganesh

  • Simple Task - Syntax Question (how do you pass variables from one component to another component - databinding)?

    Hi all,
    I'm trying to pass some width/height/URLs from a Video Player component to a Social Bookmarking component's embed text input field. (for people to grab and share videos).
    I know this is a simple task, but it's the end of the day and I seem to be having a brain failure... What's the syntax to achieve this? Do I have to import the video player component? These widths/heights/URLs are all being dynamically generated from an XML... should I be pulling it from the XML or just reuse the variables that already exist in the Video Player component?
    Here's my code...
    Video Player:
    [Bindable]
    public var source:String = "";
    [Bindable]
    public var autoPlay:Boolean = false;
    [Bindable]
    public var fullScreenMode:Boolean = false;
    [Bindable]
    public var clipTag:String = "_movie";
    [Bindable]
    public var iag_code:String = "";
    [Bindable]
    public var officialURL:String = "http://www.movies.com/";
    [Bindable]
    public var referer:String = "unknown";
    [Bindable]
    public var gID:String;
    [Bindable]
    public var starterImageURL:String = 'http://www.movies.com/jazzmaster/images/default_starter_image.
    [Bindable]
    public var oldWidth:Number;
    [Bindable]
    public var oldHeight:Number;
    Sharing Component:
    <mx:HBox
      height="10%"
      horizontalCenter="-25"
      verticalCenter="0"
      paddingBottom="5">
      <mx:Text text="Embed Code:" paddingTop="1" color="#FFFFFF" fontSize="12"/>
      <mx:TextInput  text="{oldWidth}"/>
    </mx:HBox>
    The code above throws an error... "Attempted access of inaccessible property oldWidth through a reference with a static type com:SharingBookmarks."
    Thanks all!
    DK

    Try this..
    create a new flex project and add a folder called "src"
    create a new MXML component named "VideoComp.mxml" and copy/paste
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var videoWidth:int = 300;
    [Bindable]
    public var videoHeight:int = 300;
    ]]>
    </mx:Script>
    <mx:Label text="Vidoe" />
    <mx:TextInput text="{videoWidth}" id="w" change="this.videoWidth = int(w.text);" />
    <mx:TextInput text="{videoHeight}" id="h" change="this.videoHeight = int(h.text);" />
    </mx:VBox>
    create a new MXML component named, "SharingComp.mxml" add copy/paste this..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var videoWidth:int;
    [Bindable]
    public var videoHeight:int;
    ]]>
    </mx:Script>
    <mx:Label text="Sharing Comp." />
    <mx:Label text="{videoWidth}" />
    <mx:Label text="{videoHeight}" />
    </mx:VBox>
    and here is the main.mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:src="src.*">
        <mx:Script>
            <![CDATA[
                private function doSomething():void
                 sharingComp.videoHeight = videoComp.videoHeight;
                 sharingComp.videoWidth = videoComp.videoWidth;
            ]]>
        </mx:Script>
       <src:VideoComp id="videoComp" />
       <mx:Button click="doSomething()" label="copy" />
       <src:SharingComp id="sharingComp" />
    </mx:Application>
    Hope this helps,
    BaBo,

  • Code syntax error in header using a template?

    Now running CS5 DW in a 32 bit Windows/Vista ultimate environment. The improved error messages have brought to light a problem that I apparently have had for a long time but didn't know it as CS4 simply flagged the line but no message.
    Many of my site pages use a template http://a0540807.uscgaux.info/Templates/A0540807_Skeleton_2010.dwt
    If I build or edit a page using this template in CS5, when in code view I see "There is a syntax error on line 57. Code hinting may not work until you fix this error.  Line 57 is within the header of the page and is simply </script>
    But if I simply detach the template from the page, the error goes away and it says no syntax errors.
    So I am confused, is there an issue with the code or is this a Dreamweaver issue dealing with template usage?
    While the error appears cosmetic, I keep wondering what to do to eliminate. Apparently, I have had this situation a long time as Line 57 is also identified back in CS4 but no error message until CS5. Any pointers are appreciated. Thanks.
    Andy

    I don't actually think there is any problem with your page...run one of your child pages through the W3C validator: http://validator.w3.org/ . I cast a page from your template and it came through with flying colors!
    Beth

  • Help AVL Tree in JAVA code (remove) question-answer

    Hi,
    everyone. I have question.
    I want codes in Java for AVL Tree.
    I but must have remove methods or choose elements.
    It`s main for me.
    If you know, please write in code JAVA or contact e-mail.
    or link to page or if you have self code.
    thanks,
    regards
    [email protected]

    I have a better idea.
    Why don't you try to do it yourself, and when you get stuck, post your code and details of what difficulty you're having.
    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

  • Reason Code - several questions

    Hi all
    I have checked FAQ, discussions, help etc, but I could not find any reply to the following questions:
    1) If I am in excel changing a value and get my popup with the reason codes assigned to the roles,
        the order of the reason codes seem to be complete random, at least it is neither alphabetical for the technical name nor the description.
        HOW is the order? How can I influence display order?
        Business Case is that depending on the process, one user has different subset of reason codes
    2) Evaluation of reason codes:
        Currenty with JAM, you can not evaluate Reason Codes systematically, it is just a series of feeds, wich does not meet our requirements
        With Change History, you have more possibilities for evaluation in URL-UI
        Is there any possibility / workaround / development planned that we can have these reason codes in Excel already?
        Business Case is that if the planner works on a material, he wants to see the reason codes in excel directly,
        so he knows while planning on one view all reason codes given.
    3) Is there any chance that we can set up thresholds for reason codes? Any workaround? Any development planned?
        Business Case is that we dont want to have reason code if we just make a minor change, but e.g. only when the change is higher than 5%
        This is a repeating question we get from different persons / roles from customer
    Thanks
    Irmi

    Hi Irmi,
    #1. We faced this issue in my previous project but could not determine the sorting order of the reason codes.  They appear to be random.  We checked to see if it's in the order they were created but that did not seem to be it either.
    #2. Can you select by the hash tag? such as #upside?  Try to do that in Feed and you should be able to display only the ones that your searched for.
    #3. If reason codes are set up for your user, they will pop up no matter the change.  One way to do this is to create a RC saying <5% change and just ignor those feeds.
    thank you -
    Kamala

  • General JPA query question

    Hello world,
    I'm new to JPA 2.0 and there are few things I don't understand.
    BTW: I can't figure out the keywords to search for this question, so please pardon me if it's one of the most asked.
    Using the Preview, I've seen that alignment went straight to Hell, so I tried to make this as readable as I could using pipes in place of white spaces in the result sets.
    I have a couple of tables:
    CUST table (for customers):
    CUST_ID (pk, integer)
    CUST_NAME (varchar)
    ORD table (for orders):
    ORD_ID (pk, integer)
    ORD_STATUS (char) can be: N for new, S for shipped, D for delivered
    CUST_ID (fk, integer)
    The relationship is, of course, a "one to many" (every customer can place many orders).
    Content of the tables:
    CUST_ID|CUST_NAME
    1|elcaro
    2|tfosorcim
    3|elppa
    ORD_ID|ORD_STATUS|CUST_ID
    2|N|1
    3|N|1
    4|N|1
    5|S|1
    6|S|1
    7|D|1
    8|D|1
    9|D|1
    10|D|2
    11|N|2
    12|S|3
    13|S|3
    Here's how I annotated my classes:
    Customer.java:
    @Entity(name = "Customer")
    @Table(name = "CUST")
    public class Customer implements Serializable
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "CUST_ID")
    private Integer id;
    @Column(name = "CUST_NAME")
    private String name;
    @OneToMany(mappedBy = "customer")
    private List<Order> orders;
    // Default constructor, getters and setters (no annotations on these)
    Order.java:
    @Entity(name = "Order")
    @Table(name = "ORD")
    public class Order implements Serializable
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "ORD_ID")
    private Integer id;
    @Column(name = "ORD_STATUS")
    private Character status;
    @ManyToOne
    @JoinColumns
    @JoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID")
    private Customer customer;
    // Default constructor, getters and setters (no annotations on these)
    Everything works just fine, the following JPQL query yields the results I expected:
    select c from Customer c
    it returns three objects of type Customer, each of which contains the orders that belong to that customer.
    But now, I want to extract the list of customers that have orders in status 'N', along with the associated orders (only the status 'N' orders, of course).
    Back in the good ol' days I would have written an SQL query like this:
    select c.cust_id, c.cust_name, o.ord_id, o.ord_status
    from cust c
    inner join ord o on (o.cust_id = c.cust_id)
    where o.ord_status = 'N'
    and it would have returned the following result set:
    CUST_ID|CUST_NAME|ORD_ID|ORD_STATUS
    1|elcaro|2|N
    1|elcaro|3|N
    1|elcaro|4|N
    2|tfosorcim|11|N
    The following JPQL query, however, doesn't yield the expected results:
    select distinct c from Customer c join c.orders o where o.status = 'N'
    it returns the correct set of customers (customer 'elppa' doesn't have any status 'N' order and is correctly excluded), but each customer contains the full set of orders, regardless of the status.
    It seems that the 'where' clause is only evaluated to determine which set of customers has to be extracted and then the persistence provider starts to navigate the relationship to extract the full set of orders.
    Thinking a little about it, I must admit that it makes sense.
    I then tried out another JPQL query:
    select c, o from Customer c join c.orders o where o.status = 'N'
    this JPA query yields results that are similar to the ones produced by the previous SQL query: each result (4 results as expected) is a 2-object array, the first object is of type Customer and the second object is of type Order. But, again, the objects of type Customer contain the full set of related orders (as I expected, this time). Not to mention the fact that now the orders are not contained in the Customer objects, but are returned separately, just as in an SQL result set.
    Now the question is:
    Is it possible to write a JPA query that filters out, not only the customers that don't have an order in status 'N', but the related orders (fetched during relationship navigation) that are not in status 'N' as well?
    What I'd like to be able to get is a 2-customer result where each customer contains only its status 'N' orders.
    I read the Java EE 6 Tutorial and one of the examples (the Order Application) has a schema that is similar to mine, but I couldn't find a query like this (in the downloaded source code).
    Although I think the above is standard behavior, I use an Oracle Weblogic 12c server (through its Eclipse adapter) and the persistence provider appears to be EclipseLink.
    Thanks in advance.
    Best regards,
    Stefano
    Edited by: user11265230 on 17-apr-2012 14.11

    Hello,
    When returning an entity from JPQL, it gives you the entity as it is in the database. Your "select distinct c from Customer c join c.orders o where o.status = 'N'" is asking for all customers that have an order with a status of 'N', so that is what it gives you. There is no condition to filter anything on the relationship when building the Customer object in JPA - doing so would mean returning a managed entity that does not reflect what is in the database. This would affect other queries, since JPA requires that queries return the same instance of an entity regardless of the query that is used to bring it back. So a query using your "where o.status = 'N'" would cause conflicting results when used with a query using "where o.status = 'Y'". And these queries would make the EntityManager unable to determine what has changed on the returned objects.
    EclipseLink does have the ability to filter over relationships, it is just not available through standard JPA and I would strongly discourage it. Instead of querying for Customers, why not change the query to get Orders instead -
    "select o from Customer c join c.orders o where o.status = 'N'". Assuming Orders have a ManyToOne back reference to their Customer, this will mean you do not need to travers the Customer-> order relationship. If using
    "select c, o from Customer c join c.orders o where o.status = 'N'"
    I am not sure why you would use the orders from the returned customers instead of the orders returned in the results though.
    You could also return "select c.id, c.name, o.id, o.status from Customer c join c.orders o where o.status = 'N'" which is the equivalent of what you would get from the SQL you initially posted.
    Regards,
    Chris

  • Formatted search with UDF and syntax question

    Can you explain the syntax with when to use the dollar sign and negative in writing a query for a formatted search based on user entry?
    I now want to create a formatted search to pull values based on the user's entry into a UDF on the item master screen.
    User entry into UDF U_Customer Code
    to create Formatted search for UDF U_Rep01
    I tried the following, but it does not work.
    SELECT T0.U_REP01 FROM dbo.OCRD T0
    WHERE T0.CARDCODE = $http://$OITM.U_CUSTOMERCODE
    Thanks.
    Please advise.

    The right syntax would be like this:
    SELECT T0.U_REP01 FROM dbo.OCRD T0
    WHERE T0.CARDCODE = $[OITM.U_CUSTOMERCODE\]
    However, the logic of query may not be correct.  Select something must be already in the system and Where should also be locatable.
    Thanks,
    Gordon

Maybe you are looking for

  • How can i create a photobook with a layout that respect standard photo format?

    I used iphoto to create a photobook but there is serious problem, i can use only fixed layout and this layouts are problems. I can't put my shoot in standard photographic format, so i need to zoom and move my photo to fit well in your fixed layout. I

  • Can't put my finger on what's wrong with iMac

    From the beginning: My wife asked me to copy a couple scratched dvd-rs the other night.  The superdrive couldn't read one, but the other showed up on the desktop.  I tried to copy it and got an error that the iMac couldn't copy the disc.  Thinking it

  • MDM Adapter dynamic configuration

    Hi All, The scenario is, PI picks up a file from ECC using sender File adapter and sends it to different MDM ports using the Receiver MDM adapter. The only difference in the different receiver MDM communication channels sending the data to different

  • Leading

    Why is it that sometimes the leading just doesn't work in InDesign and Illustrator? Has anyone else had this problem?

  • Portable HD and deletions

    I would like to delete iPhoto from an external hard drive but leave Aperture and Light Room. How do I do this?