Using CONSTANT in Condition Statement

Hi
What I am trying to do is put CONSTANT into IN Condition Statement.
When I use Bind variables just like :bind, It works properly
But What if I use as a CONTANT, It doesn't work.
In my opinion, parenthesis is not work well.
Please help me out
thanks in advance and below is PL/SQL CODE
PROCEDURE PROC_MAIN
iUserID          IN     VARCHAR2,
iJobID IN VARCHAR2
) AS
C_AGENT CONSTANT VARCHAR(20) := '10,11';
C_staff CONSTANT VARCHAR(20) := '40';
C_newStaff CONSTANT VARCHAR(20) := '50';
C_ETC CONSTANT VARCHAR(20) := '20,30';
BEGIN
vJobId :=
CASE iJobID
WHEN '41' THEN C_AGENT
WHEN '42' THEN C_staff
WHEN '43' THEN C_newStaff
WHEN '40' THEN C_ETC
END;
insert into tbl_monthly
(emp_no, salary)
select emp_no, salary from tbl_emp
where Staff_cat in vJobId ;
end;
Message was edited by:
allbory

Hi,
Please check the changes:
Note: table_name is changed to test.
CREATE OR REPLACE PROCEDURE PROC_MAIN
iUserID IN VARCHAR2,
iJobID IN VARCHAR2
) AS
C_AGENT CONSTANT VARCHAR(20) := '10,11';
C_staff CONSTANT VARCHAR(20) := '40';
C_newStaff CONSTANT VARCHAR(20) := '50';
C_ETC CONSTANT VARCHAR(20) := '20,30';
vJobId          VARCHAR2(20);BEGIN
vJobId :=
CASE iJobID
WHEN '41' THEN C_AGENT
WHEN '42' THEN C_staff
WHEN '43' THEN C_newStaff
WHEN '40' THEN C_ETC
END;
EXECUTE IMMEDIATE 'INSERT INTO tbl_monthly(empno, salary) SELECT empno, sal FROM scott.emp WHERE deptno IN ('||vJobId||')' ;
END;

Similar Messages

  • How to use Constants in Switch statements?

    Hello all,
    The following code snippet gives error, please give me guidance.
    ========
    static Object tokenize(StreamTokenizer st)
    throws NumberFormatException, IOException {
    Object token = null;
    try {
    if (st.nextToken() == st.TT_EOF) {
    throw new EOFException();
    } catch (IOException e) {
    throw e;
    switch(st.ttype) {
    case st.TT_NUMBER:
    token = new Double(st.nval);
    break;
    case st.TT_WORD:
    token = st.sval;
    break;
    case st.TT_EOL:
    throw new NumberFormatException();
    default:
    throw new NumberFormatException();
    return token;
    =================
    regards.

    Perhaps it wants you to do "StreamTokenizer.TT_WORD" rather than "st.TT_WORD".
    Why catch IOException, just to throw it again?

  • Using conditional statements stored inside a variable

    I'm trying to store the body of different emails inside of my
    database to use in email sent with cfmail. The content of the
    emails has conditional statements using cfif and other variables
    based on a query running. If I set the content as a variable and
    then place that inside of the cfmail tag it does not process the
    cold fusion code. Is there a way that I can process this code so
    that the final output is what is placed within the cfmail tag or is
    it not possible to do what I'm trying to accomplish? Thanks in
    advance for any ideas.

    Here is a sample taken from the text file. The output created
    by the cfsavecontent tag is identical to the text file.
    Dear <cfif IsDefined(GetData.strFirstName) AND
    GetData.strFirstName IS NOT
    "">#GetData.strFirstName#<cfelse>Member</cfif>,
    Thank you for joining xxxxxxxxx. We're glad to
    have you as a member and appreciate your support. Your
    membership
    application has been processed and your member packet will
    arrive soon.
    Your new membership number is #GetData.strCustomerID#. This
    number is useful
    when buying product from our online store, renewing your
    membership or
    contacting us with questions or comments.
    <cfif GetData.ExpirationDate IS "9999-12-1">We are
    especially grateful for your commitment to xxxxxxxx
    through your Life Membership.<cfelse>Your membership is
    current through #DateFormat(GetData.ExpirationDate, "MMMM
    YYYY")#.</cfif>

  • How to use Conditional statements in SQL Loader control file

    Hi,
    I am using sql loader to load a flat file to the table. I am using control file for this purpose as show below:
    LOAD
    INTO TABLE store_shrink
    TRUNCATE
    FIELDS TERMINATED BY "     "
    TRAILING NULLCOLS
    SITE_ID char,
    ST_SHRINK char,
    ST_REVENUE char,
    SHRINK_PR char ":ST_SHRINK/:ST_REVENUE"
    My question is this. If in the flat file the value of 'ST_REVENUE' is '0', then I want 'SHRINK_PR' to be '0' as well, and skip the calculation (:st_shrink/:st_revenue).
    How to achieve this with the conditional statement or using any Oracle function?
    Any help or suggestion is greatly appreciated.
    Thanks in advance.

    Hi there,
    I tried the following in my above query and it doesn't work somehow. Anyone has an idea? I have been on internet throughout but to no avail. Please help:
    LOAD
    INTO TABLE store_shrink
    TRUNCATE
    FIELDS TERMINATED BY "     "
    TRAILING NULLCOLS
    SITE_ID char,
    ST_SHRINK char,
    ST_REVENUE char,
    SHRINK_PR char "case (when :st_revenue<>'0.00' then :SHRINK_PR=:ST_SHRINK/:ST_REVENUE else :SHRINK_PR='0.00') end"
    )

  • Java programming standard for conditional statement

    Hi,
    Is it proper Java standard to use constants first in a conditional statement? I've never seen coding in this way, even when I was in college I never saw it in any of our books.
    example:
    String x = null;
    if (null==x){
    //Do some stuff
    }

    kevjava wrote:
    yawmark wrote:
    ...hence, more work.Not if "NAME_KEY" (i.e., the literal value) changes.
    ~If some wise guy resets it to null, then you've lost all benefit of making a constant out of it to begin withIf that happens, you've got some people problems to deal with! Anyways, if it's really a constant, it'll be final, right?
    .... and I was sort-of reiterating that it was a self-named constant... you're right, of course, but I guess I'm just peaved at having to see stuff like...
    private String JAN="JAN";
    private String FEB="FEB";
    // ...and on and on...
    // later...
    if (FEB.equals(month)) {
    // do stuff
    } else {
    // do stuff
    }Have you ever actually seen code like that in production? I wonder, what are you up to that a class needs its own, private, set of months?
    My point is that the three-letter abbreviation is always going to be "FEB" (yes, i18N and language specializations aside)Why put them aside, though? They're not exactly corner cases

  • Conditional statement in html

    This is actually not a JSP question but an HTML question. I could'nt find any good html forum sites out there, and since I received excellent replies in my previous post, I am hoping that those of you who know JSP also know html. Heres my question, is there any conditional statement in html (I don't want to use scripts)? The only conditional statement I found was the logic:equal (not equal) statement. And it seems to only work for forms. I am using JSP in conjunction with html so I used an inner html variable declaration in my JSP function. This variable will be used by my html code. And I would like to check the value of that variable in html.
    Heres my JSP function containing the inner html declaration:
    function showItemEdit(field)
    var elements = editWindowDiv.document.all;
    elements("editWindowField").value = "";
    fieldhtml.innerHTML = field;
    var retVal = null;
    retVal = window.showModalDialog("javascript:document.write(window.dialogArguments.innerHTML);editWindowInit();",editWindowDiv,
    "dialogWidth:335px;dialogHeight:185px;scroll:no;status:no;unadorned:no");
    if (retVal == "OK")
    alert("OK");
    else
    alert("Cancel");
    The inner html variable, fieldhtml.innerHTML, is the value I would like to check in my html code.
    This is what I woul like to accomplish in my html code:
    if fieldhtml == register then
    <tr>
    <td class="bodymd">  <bean:message key="label.register"/>:</td>
    <td><input type="text" name="editWindowField" value="" maxlength="5"></td>
    </tr>
    else
    <tr>
    <td class="bodymd">  <bean:message key="label.shift_no"/>:</td>
    <td><input type="text" name="editWindowField" value="" maxlength="3"></td>
    </tr>
    end if
    I am not sure how to accomplish if-else statements in html. I would appreciate any help. Thanks!

    You are mixing things a bit. There is no JSP in your example. You cannot do conditional statements in HTML. However, you can use JavaScript to output HTML:
    if(someCondition){
    document.write("<yourHTMLTags>whatever</yourHTMLTags>");
    else{
    document.write("<yourHTMLTags>something else</yourHTMLTags>");
    }

  • Using multiple 'and' conditions in a SQL query

    Is it possible to reduce the SQL required to query using multiple 'and' conditions, e.g. I have a query like the following:
    select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
    from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
    where stat.apy_apn_id = apps.rgn_apt_id
    and apps.rgn_apt_id = appt.rgn_apt_id
    and stat.application_completed is null
    and stat.application_started_date > '01-MAY-11'
    and stat.amount_paid is null
    and stat.personal_details = 'C'
    and stat.further_details = 'C'
    and stat.education = 'C'
    and stat.employment = 'C'
    and stat.personal_statement = 'C'
    and stat.choices = 'C'
    and stat.reference = 'C'
    and stat.student_finance = 'C'
    Is there a way, to reduce all the multiple 'and' queries, to be read from say one line? If you know what I mean.......

    Ah, Ok this looks nice, thanks very much. It doesn't quite run as is because the stat.amount_paid query value is 'is null', while the others are 'C'. I tried amending the relevant line to various versions of the following:-
    in (select 'is null' 'C','C','C','C','C','C','C','C' from dual)
    which doesn't work.
    I can get the following to work so I am assuming that the it is not possible to use different query values within the brackets of the 'in (select....' statement?
    select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
    from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
    where stat.apy_apn_id = apps.rgn_apt_id
    and apps.rgn_apt_id = appt.rgn_apt_id
    and stat.application_completed is null
    and stat.application_started_date > '01-MAY-11'
    and stat.amount_paid is null
    and (stat.personal_details, stat.further_details, stat.education,
    stat.employment, stat.personal_statement, stat.choices, stat.reference, stat.student_finance)
    in (select 'C','C','C','C','C','C','C','C' from dual)
    Thanks for everybodys help - the suggested alternatives seem so much more elegant

  • Text box not empty conditional statement

    I've been asked to develop a survey and, in several places, a
    score is given for the completion of text box. However, if there is
    no text in the box, then a score of zero should be given.
    I thought the best way to do this would be to use a hidden
    field with a conditional statement saying "if text box is not empty
    then score=4, else score=0.
    However, firstly I'm not sure how to write this and secondly,
    how do you check if a text box is empty?
    I think it really calls for some human input but the client
    is quite sure this is how he wants it.
    The scores are all going to be inserted into a mysql database
    and sorted out there, so there may be some fudge available there
    but if php could do something nice in the code, that would be
    preferable.
    Thanks in advance.
    Andrew

    Drewbles wrote:
    > However, firstly I'm not sure how to write this and
    secondly, how do you check
    > if a text box is empty?
    Believe it or not, with the PHP function called empty();
    http://docs.php.net/manual/en/function.empty.php
    if (empty($_POST['fieldName'])) {
    // give a score of 0
    } else {
    // give a positive score
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to avoid using constants ?

    Hello,
    I am starting a new project and I am thinking of a way to avoid using constants.
    For example, in a report, it selects all the order with types ZLN and ZLB.
    I know that I have several possibilities :
    - hard code it in the program (using constants which I want to avoid)
    - create a specific table with all the types that I want to select (this may be the best solution but it can be very long -> too much table to create)
    - put the parameter in the selection screen (but then we have to put default values which come back to the same problem)
    So, I didn't found any perfect solution, Do you know what is the method recommended by SAP ?
    What kind of technics did you use in you projects ?
    Thank you for your help !

    Hi Friend ,
    As you taught , there are  multiple  ways to handle the constants in the program.
    But finally time & efficency matters alot  .
    so my  idea would be  i will  list all the constant & get the quick understanding of the constant type's.
    For example : Order type is Customizing data  which will maintained  by Fun.Consultant  , so i will give work for him to maitain the Varient against  Order type in the TVARC table .so that  in the program  i will declare one order type vraible  under atselection-screen event i will write select Query to get the vaule from the TVARC table which will be maintaine . we can write the execption also with sy-subrc <> o.if it is not maintianed .so far all customizing data fields  this would be the best way for constants maintaining outside your program  .
    Similarly if any system constants then we can get it in runtime  with SYST table parameters .
    if there are any  ABAP Program Constants  ( Titles,labels ,case condition parameters,ect) maintain in the tprogram ext elements , or you can generically maintain a Utility class where you can create an attribute  so that whereeven you want you can reuse the same  .
    Regards,

  • OMP_SET_NUM_THREADS in a conditional statement?

    I am having problems using OMP_SET_NUM_THREADS in a conditional statement. For example a code like following will make the program to hang indefinitely after starting to execute a parallel DO loop:
    if(mybool.eq.0) then
    call OMP_SET_NUM_THREADS(iprocessors)
    else
    call OMP_SET_NUM_THREADS(1)
    endif
    Is there a problem using this function in conditional statements?
    I am using Forte Studio 7 under Solaris 8 and 10 (I know that it is old but for the moment this is what I have to use...).
    Thanks,
    Rak

    This is probably a bug in Forte 7.
    Can you isolate the problem in a small test case and post the code here. We'll try it on the latest compiler and see if it works or not.
    You know you can download Sun Studio 12 and run it on Solaris 10. (SS 12 is not supported on Solaris 8)

  • Got action sequence to "loop" but it shows in all states - conditional statement to fix it?

    Using Flash Catalyst & Notepad (to open and alter the code in the "Main" MXML file) I'm able to "loop" an action sequence on the home state for my swf by changing the code as follows:
    ORIGINAL CODE
    <s:Parallel id="Sequence3">
    ALTERED CODE
    <s:Parallel id="Sequence3" effectEnd="Sequence3.play()">
    The desired effect is a sequence (of 4 images) that loops whenever a user is viewing the home state.  It is activated "On Application Start"
    The PROBLEM is that the loop continues in all other states (it appears in the background - behind the objects that are supposed to show up on the other pages and only begins to show up in each state when the sequence begins another loop).
    I am assuming I need a conditional statement --- something along the lines of:
    while (condition){ statements;}
    ...in other words, ONLY while currentstate = "Home" it should loop the sequence. What would be the correct code for this conditional statement and where would the conditional statement be inserted to loop the sequence as desired???  Or... is there another better way??
    My current code for this action sequence is:
    <s:Parallel id="Sequence3" effectEnd="Sequence3.play()">
                <s:Parallel target="{designlayer1}">
                    <s:Fade alphaTo="0" duration="500" startDelay="2100"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage2}">
                    <s:Fade alphaTo="0" startDelay="2100"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage3}">
                    <s:Fade alphaTo="0" startDelay="2100"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage4}">
                    <s:Fade alphaTo="0" startDelay="2100"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage5}">
                    <s:Fade alphaTo="0" startDelay="1650"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage6}">
                    <s:Fade alphaTo="0" startDelay="1800"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage7}">
                    <s:Fade alphaTo="0" startDelay="1950"/>
                </s:Parallel>
                <s:Parallel target="{designlayer5}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="5300"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage8}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="5350"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage9}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="5350"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage10}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="5350"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage11}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="4750"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage12}">
                    <s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
                    <s:Fade alphaTo="0" startDelay="5000"/>
                </s:Parallel>
                <s:Parallel target="{designlayer6}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7900"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage13}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7550"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage14}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7900"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage15}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7750"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage16}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7900"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage17}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
                    <s:Fade alphaTo="0" startDelay="7900"/>
                </s:Parallel>
                <s:Parallel target="{designlayer7}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage18}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage19}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage20}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage21}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="10650"/>
                </s:Parallel>
                <s:Parallel target="{bitmapimage22}">
                    <s:Fade alphaTo="0" duration="0"/>
                    <s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
                    <s:Fade alphaFrom="1" alphaTo="0" startDelay="10800"/>
                </s:Parallel>
            </s:Parallel>
    Thank you!!!!!!!!

    Figured out my issue...
    I had to select each layer for the 4 photo sequence and "Remove From State" for each layer.  If this is done with all layers except the "Home" state, the images show only where appropriate.
    So...   "Loop an action sequence" is really easy.
    I've seen a lot of complaining that "FC can't do it" but with a very simple code mod, I was able to do it WITHOUT using the video timer method.
    I should also mention that I've never worked with Flash at all before this project and am only self-taught in HTML (basics).  I was able to make a pretty good looking Flash component for a web site and never would have attempted it without FC.  I have to say, while FC is a bit limited, GUI-based Flash is a great add for Adobe and will save me over $2k per year in web admin.
    To edit the document in Notepad as mentioned in the first post:
    the full text can be found here http://www.judahfrangipane.com/blog/2010/09/03/flash-catalyst-jailbreak-for-flex-developer s/
    Editing MXML Documents
    To edit your projects MXML documents we first need to find the path to  the Flash Catalyst workspace. To do this publish your Flash Catalyst  project (CMD / CTRL + ENTER). Now, the browsers URL shows the path to  the project workspace. So in this URL,  "file:///Users/judah/Library/Application Support/Adobe/Flash  Catalyst/workspace/Project/bin-debug/Main.html", the project MXML  documents are located at, "file:///Users/monkeypunch/Library/Application  Support/Adobe/Flash Catalyst/workspace/Project/" when on a Mac.
    Flash Catalyst project files
    Project Files Description
    /src - location of the application source files
    /bin - the location of any additional flex libraries
    /bin-debug - location of testing swf
    /html-template - location of the html template that wraps around your application
    /src/Main.mxml - the main application file. make your application changes here
    /src/Main.css - the css stylesheet of the main application
    /src/components - the location of custom components and component skins
    /src/assets/graphics - location of optimized FXG graphic symbols
    /src/assets/images - location of images
    You can edit these XML documents in any text editor. To apply the  changes you need to save the file and refresh the Flash Catalyst  project. You can do this by opening the changed document in Flash  Catalyst code view. When we do this it will recognize the document has  changed and prompt you to use the newer version of the file. Select Yes.  If the project does not rebuild immediately publish it using CMD +  Enter.

  • How to use outer join condition in my below query.

    Hi All,
    How to use outer join condition in my below query.
    In the table  APPS_JP.GEDIS_OFFER_HEADER goh I have more records
    in the table APPS_JP.GEDIS_ORDER_BUILDS gob I have less number of records.
    I want all the records from APPS_JP.GEDIS_OFFER_HEADER goh
    including other conditions.
    I have tried goh.OFFER_NO=gob.OFFER_NO(+) but same result.
    [code]SELECT   GOH.ORIG_SYSTEM,
               gsp.USER_NAME,
               goh.ORDER_NO,
               goh.OMEGA_ORDER_NUMBER,
               goh.ORDER_TYPE,
               gc.CUSTOMER_ID,
               gc.OMEGA_CUSTOMER_NUMBER,
               CASE WHEN gc.PRIVATE = 'N' THEN gc.CUSTOMER_NAME ELSE '' END
                  AS COMPANY_NAME,
               goh.ORDER_STATUS,
               goh.TOTAL_SELLING_PRICE,
               goh.TOTAL_MARGIN,
                  ga1.ADDRESS1
               || ','
               || ga1.ADDRESS2
               || ','
               || ga1.ADDRESS3
               || ','
               || ga1.POSTAL_CODE
               || ','
               || ga1.CITY
                  AS SHIPPING_ADDRESS,
                  ga2.ADDRESS1
               || ','
               || ga2.ADDRESS2
               || ','
               || ga2.ADDRESS3
               || ','
               || ga2.POSTAL_CODE
               || ','
               || ga2.CITY
                  AS BILLING_ADDRESS,
               ga.ADDRESS_ID,
               gol.DESCRIPTION,
               APPS_JP.TZ.to_local_date (goh.OFFER_DATE, goh.OFFER_DATE_UTC)
                  AS OFFER_DATE,
               gc.LEVEL_8,
               goh.NO_OF_BUILDS,
               gob.SFDC_ID,
               goh.PURCHASE_ORDER_NO AS PO,
               gc1.CUSTOMER_NAME AS END_USAGE,
               gol.LOB,
               goh.TOTAL_MARGIN_PCT,
               goh.TOTAL_DISCOUNT,
               goh.TOTAL_DISCOUNT_PCT
        FROM   APPS_JP.GEDIS_OFFER_HEADER goh,
               APPS_JP.GEDIS_ORDER_BUILDS gob,
               APPS_JP.GEDIS_ORDER_LINES gol,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER gorc,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER ship,
               APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER bill,
               APPS_JP.GEDIS_CUSTOMER gc,
               APPS_JP.GEDIS_CUSTOMER gc1,
               APPS_JP.GEDIS_CONTACT gct,
               APPS_JP.GEDIS_ADDRESS ga,
               APPS_JP.GEDIS_ADDRESS_NORM ga1,
               APPS_JP.GEDIS_ADDRESS_NORM ga2,
               (SELECT   DISTINCT SALESPERSON_ID, USER_NAME
                  FROM   APPS_JP.GEDIS_SALESPERSON
                 WHERE   SALESPERSON_ID IN
                               (SELECT   TO_NUMBER (COLUMN_VALUE) AS SALESPERSON_ID
                                  FROM   TABLE (APPS_GLOBAL.SplitString ('337309'))))
               gsp
       WHERE       goh.ORDER_NO <> 0
               AND goh.OFFER_NO <> 0
               AND goh.OFFER_NO=gol.OFFER_NO
               AND gol.BUILD_NO = 1
               AND gol.LINE_NO = 1
               AND goh.OFFER_NO=gob.OFFER_NO
               AND gob.BUILD_NO = 1
               AND goh.OFFER_NO = gorc.OFFER_NO
               AND gct.CONTACT_ID = gorc.CONTACT_ID
               AND ga.CUSTOMER_ID = gc.CUSTOMER_ID
               AND ga.PRIMARY = 'Y'
               AND goh.LEAD_SALESPERSON=gsp.SALESPERSON_ID
               AND goh.OFFER_NO = ship.OFFER_NO
               AND ship.RELATION_TYPE = 'SHIP'
               AND ga1.ADDRESS_ID = ship.ADDRESS_ID
               AND ga1.CUSTOMER_ID = gc1.CUSTOMER_ID
               AND goh.OFFER_NO = bill.OFFER_NO
               AND bill.RELATION_TYPE = 'BILL'
               AND ga2.ADDRESS_ID = bill.ADDRESS_ID
               AND goh.OFFER_DATE BETWEEN APPS_JP.TZ.LOCAL_TO_DB_DATE (
                                             SYSDATE - 30
                                      AND  APPS_JP.TZ.LOCAL_TO_DB_DATE (SYSDATE)
               AND gorc.RELATION_TYPE = 'BASE'
               AND gorc.CUSTOMER_ID = gc.CUSTOMER_ID
               AND goh.SALES_CHANNEL = gc.SALES_CHANNEL
               AND gc.SALES_CHANNEL = 'SMB'
               AND goh.LEAD_SALESPERSON IN (goh.CREATED_BY, goh.LEAD_SALESPERSON)
    ORDER BY   goh.OFFER_NO;[/code]
    Please help me how to use this outer join condition.
    Thanks in advance.

    Hi,
    If you want all the rows from goh, then you don't want any conditions like  goh.OFFER_NO <> 0.
    Make all the joins to goh outer joins, and make all conditions that apply to any tables joined to goh (or to tables joined to them) part of the join condition, like this:
    FROM             APPS_JP.GEDIS_OFFER_HEADER     goh
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_BUILDS     gob  ON   gob.OFFER_NO = goh.OFFER_NO
                                                         AND  gob.BUILD_NO = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_ORDER_LINES      gol  ON   gol.OFFER_NO = goh.OFFER_NO
                                                         AND  gol.BUILD_NO = 1
                                                         AND  gol.LINE_NO  = 1
    LEFT OUTER JOIN  APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER
                                                    gorc ...
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Simplify the problem as much as possible.  For example, do you really need all those tables to show what the problem is?  Of course, you need them in tyour real query, but if you understand a solution that only involves 4 or 5 tables, you'll know how to apply it to any number of tables.
    Explain, using specific examples, how you get those results from that data.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ https://forums.oracle.com/message/9362002#9362002

  • Long execution times for TestStand conditional statements

    I have two test stations – one here, one at the factory in China that has been operating for about a year. The test program uses TestStand 3.1 and calls primarily dll's developed using CVI. Up until a couple months ago, both test stations performed in a similar manner, then the computer at the factory died and was replaced with a new, faster computer. Now the same test sequence at the factory take three times as long to execute (30 min at the facotry, 10min here).
    I have recoded the execution time at various point during the execution, and have found that the extra times seems to be occurring during the evaluation of conditional statements in TestStand (i.e. for loops, if statements, case statements). For example, one particular ‘for’ evaluation takes 30 ms on the test station here, but takes 400 ms at the test station at the factory (note: this is just the evaluation of the for condition, not the execution of the steps contained within the for loop).
    The actual dll calls seem to be slightly faster with the new computer.
    Also the ‘Module Times’ reported don’t seem to match the actual time for the module for the computer at the factory. For example, for the following piece of TestStand code:
    Label1
    Subsequence Call
    Label2
    I record the execution time to the report text in both Label1 and Label2. Subtracting one from the other gives me about 18 seconds. However the ‘Module Time’ recorded for ‘Subsequence Call’ is only 3.43 seconds.
    Any body have any ideas why the long execution time with the new computer? I always setup the computers in exactly the same way, but maybe there is a TestStand setting somewhere that I have missed? Keep in mind, both test stations are running exactly the same revision of code.

    Got some more results from the factory this morning:
    1) Task Manager shows that the TestExec.exe is the only thing using CPU to any significant degree. Also CPU Usage History show that the CPU Usage never reaches 100%.
    2) I sent a new test program that will log test execution time in more places. Longer execution times are seen in nearly every area of the program, but one area where this is very dramatic is the time taken to return from one particular subsequence call. In this subsequence I log the time just before the <End Group> at then end of Main. There is nothing in Cleanup. I then log the time immediately after returning from this sequence. On the test system I have here this takes approximately 160 ms. On the test system at the factory this takes approximately 14.5 seconds! The program seems to be hanging here for some reason. Every time this function is called the same thing happens and for the same amount of time (and this function is called about 40 times in the test program, so this is kill me).

  • Problem with 0FIGL_VC1 when use constant selection in the query

    Please kindly help me. I have this problem for 2 weeks already.
    When I create a query from virtual cube 0FIGL_VC1 (balance sheets / p&l statements), if I use constant selection in any of key figure, my report could not display financial statment correctly. 
    My report layout
    Columns :  key figures  (including 0FIGL_VC1_CK001)
    Rows:  0GLACCEXT  (financial statement item) << as hierarchy
    Initially, the query is processed correctly.
    However, based on the requirement from my customer, I really have to use "constant selection" for some of my columns. Whenever I do so, the query display incorrectly. (Some nodes of financial statement item just disappear. (it seem like all contra item will disappear.)  
    Please help!

    If I dont use constant selection in the query, data are display correctly.
    But If I use constant selection in the query, some financial statement item dont display any value
    Example :
       Financial statement item(Display in hier)     Period1   Total Period1(Constant selection)
                 A                                                       10            60
                 B                                                       20            60
                 C                                                       30            60
                 D                                                       0              60
    - Financial statement item "D"  has some value.
    - Financial statement item "D"  is in the hierarchy,one gl account has been assigned to more than one group differentiated by debit/credit indicator.
    Please help!!

  • What is the use of at new statement?

    What is the use of at new statement?

    Hi,
    AT - itab
    Syntax
    LOOP AT itab result ...
      [AT FIRST.
       ENDAT.]
        [AT NEW comp1.
         ENDAT.
           [AT NEW comp2.
           ENDAT.
           AT END OF comp2.
           ENDAT.]
         AT END OF comp1.
         ENDAT.]
      [AT LAST.
      ENDAT.]
    ENDLOOP.
    Extras:
    1. ...  FIRST
    2. ... |{END OF} compi
    3. ...  LAST
    Effect
    The statement block of a LOOP loop can contain control structures for control level processing. The respective control statement is AT. The statements AT and ENDAT define statement blocks that are executed at control breaks, that is, when the control structure is changed. The additions to the AT statements determine the control break at which their statement blocks are executed. Within these statement blocks, the statement SUM can be specified to add together the numeric components of a control level. For the output behavior result, the same applies as for LOOP AT.
    The prerequisite for control level processing is that the internal table is sorted in exactly the same sequence as the component of its line type - that is, first in accordance with the first component, then in accordance with the second component, and so on. The line structure and the corresponding sorting sequence gives a group structure of the content of the internal table, whose levels can be evaluated using AT statements. The AT- ENDAT control structures must be aligned one after the other, in accordance with the group structure.
    The statement blocks within the AT- ENDAT control structures are listed if an appropriate control break is made in the current table line. Statements in the LOOP- ENDLOOP control structure that are not executed within an AT- ENDAT control structure are executed in each pass of the loop.
    In order that control level processing is carried out properly, the following rules must be observed:
    After LOOP, a restricting condition cond can only be specified if this selects a consecutive line block of the internal table. Otherwise, the behavior of control level processing is undefined.
    The internal table cannot be modified within the LOOP loop.
    A work area wa specified in the LOOP statement after the addition INTO must be compatible with the line type of the table.
    The content of a work area wa specified after the addition INTO in the LOOP statement must not be modified.
    If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
    The components of the current control key remain unchanged.
    All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
    All the other components to the right of the current control key are set to their initial value.
    When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa.
    Addition 1
    ... FIRST
    Effect
    The control level is defined by the first line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT FIRST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Addition 2
    ... |{END OF} compi/>
    Effect
    : Control levels are defined by the beginning or end of a group of lines with the same content in the component compi (where i = 1, 2, and so on) and in the components to the left of compi. The control breaks take place when the content of the component compi or another component to the left of compi changes.
    The compi components can be specified as described in Specification of Components, with the limitation that access to object attributes is not possible here.
    Note
    If the INTO or ASSIGNING additions are used in the LOOP statement, a field symbol can be entered after AT |{END OF} outside classes, to which the corresponding component of the work area wa or the field symbol <fs> is assigned. This form of dynamic component specification is obsolete and has been replaced by specification in the format (name).
    Addition 3
    ... LAST
    Effect
    : The control level is defined by the last line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT LAST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Regards,
    Prashant

Maybe you are looking for

  • Error While addding a new datafile

    Dear All, We have the tablespace PSAPUSER1D in one of our production systems,which is 100% full .I am trying to extend the tablespace using brtools,but i am unable to do it and it is giving the following error. BR0280I BRSPACE time stamp: 2007-11-05

  • Custom serializer/deserializer in Weblogic 9 web service

    We are able to select XML from the database which is properly formatted to the schema definition of the method return type. Therefore, the serialization/deserialization of XML to JAVA and then back to XML does not make sense. Is there a way to use a

  • Ovi map cambodia

    hi, how to get the non-navigaion map of cambodia to my nokia 5800 music express? according to the follwing link the map is available: http://www.nokia.de/ovi-dienste-und-apps/nokia-maps/anleitungen/mapping/coverage i've tried with nokia ovi suite and

  • Where to find Genuine Fractals 3.5 for Mac anymore?

    HI, I'm a freelance illustrator working a lot with Photoshop CS.... running OSX 3.9. I'm wondering where previous versions of Genuine Fractals 3.5 might be found? I looked around the GF home page and couldn't find any links. Where would one go to fin

  • Determine avg of student_marks quickly

    Hi every body, i have a table thrat contain approximately one million records, and i made a function that determine avg of selected student, but i takes 1 to 2 minutes (or more) to return the avg of this student, my question is : 1) is this normal. 2