How to give not null value in a rule for a field

hi,
i want to create a rule through rule designer where i want a field say "country" should not be left blank. when i go to the rule designer and select country through attribute value i get 2 conditions "=" and "!=" what shoud i give the value as so that the country field is not null.
TIA

I don't think you can have null value in the rule designer , rather you can created one more UDF and populate this UDF with something based on the nulllness/not-null of the country field and use this new UDF in the rule .
Hope this helps .
Thanks
Suren

Similar Messages

  • How can I skip Null values from being part of sorting

    Hi,
    I am using ADF sorting for table, where i dont want to consider null values of that column when i do sorting . Now when I do ascending sort null values for that column are coming first and then the not null values are coming in ascending order.

    User,
    Always mention your JDev version.
    Now when I do ascending sort null values for that column are coming first and then the not null values are coming in ascending order.
    .. which is expected. How would you want it to be? You may probably want to have a custom sortListener for the table and try out. Ex : Custom sort function in ADF table
    -Arun

  • How to use Not Null in

    Hi All,
    I did one personalization which is related to DFF of an Item.
    It is working partially but i need the perfect solution will u please resolve my doubts.
    My requirement is as follows:
    I have one DFF in Items page say attribute1 which has a maximum of 3 values i.e., 'A' or 'B' or 'C'
    In my Purchase order Auto create form, when an select an requisition, the related lines are displayed for me.
    When i select an line and if the line has an item which has an attribute values of either 'A' or 'B' or 'C'.
    Then i need to display an error message.
    For this I do the following steps.
    In conditions tab i wrote the following condiitons:
    Not Null IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    But my condition evaluates to false, even though i have values in attribute1---------------------- My question is will the above query is right or not. if not will u please provide me the correct syntax of how to use not null.
    'A' IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    The above query is working fine. Please help me on this issue.
    Thanks and Regards
    Zaheer

    Dear Zaheer,
    you compare the organization with Operating unit, Please use
    fnd_profile.value('MFG_ORGANIZATION_ID') inspite of org_id.
    Tariq.

  • How do I restrict null values??????

    Hi,
    Created BW report Purchase Orders Awaiting Goods Receipting. Having difficulty in restricting the report to those orders that have not been goods receipted. How do I restrict null values. 
    thanks in advance
    S VR

    Hi,
    I believe you are using Standard Business Content.
    You can use the following reports for overcome your requirement:
    Query Name: 0PUR_C01_Q0017 - Quantities – Purchase Order – Delivery - Invoice
    Link: http://help.sap.com/saphelp_nw04/helpdata/en/99/670539b15b186ce10000000a114084/content.htm
    Try to use it. And let me know still you are having some doubts.
    Regards,
    Vivek V

  • How to pass apex item value into custom xml for chart or guage?

    Re-opening the old thread : Re: How to pass apex item value into custom xml for chart or guage?
    Which was not answered.
    Roel - Thanks. Its working - but in a semi quotes in the custom XML
    <pointers>
    <pointer value= '&P5_RUNNING_TOTAL.'
    <label enabled="true">
    <position placement_mode="ByPoint" x="50" y="15" />
    <format>{%Value}{numDecimals:1}</format>
    <background enabled="false" />
    </label>
    </pointer>
    </pointers>This question was helpful for us to resolving one recent thread : AnyChart - set Dial axis intervals dynamically?
    (Re: AnyChart - set Dial axis intervals dynamically?
    Edited by: P.Ranish on Dec 13, 2012 6:23 AM

    P.Ranish wrote:
    Is there any update for this question ???
    Edited by: P.Ranish on Dec 13, 2012 3:36 AMNo, And there won't be in the future.
    Please stop posting followup's to old threads, if you have a real problem please search the forum first and post a new question with all information
    Roel wrote:
    Try using &P5_RUNNING_TOTAL. or #P5_RUNNING_TOTAL#Just to make it clear - this will only work if page is reloaded after setting the item values dynamically via AJAX

  • Filter by form shows only "Is Null" and "Is Not Null" value in split database

    Hello,
    I have a SPLIT database into FE (forms, queries...) and BE (tables with data) ready for distribution.
    PROBLEM
    When "Filter by Form" is chosen
    only 2 values are available in combobox filter ("Is Null", "Is Not Null"). All other functionalities of the form work fine (data display), which means that tables are linked
    correctly.
    In the UNSPLIT database "Filter by Form" works OK (i.e. comboboxes show lists of possible values to choose from).
    All the forms (and queries) behave like this.
    Recordsource of all forms are queries.
    Type of filtered fields => text (no memo fields, no comboboxes)
    QUESTION:
    What is the reason of this behavior and how can it be fixed so that "Filter by Form" works in SPLIT database (and displays available values in comboboxes)?
    Thank you for help.

    Hi,
    this is the default behaviour with linked tables. To change it:
    open the form in design view
    select the text box you want to use for the filter
    in the properties of the text box click at the data tab and change the FilterLookUp property from "Database default" to "Always"
    See also
    https://msdn.microsoft.com/en-us/library/office/ff194556(v=office.15).aspx.
    cu
    Karl
    Access FAQ (de/it): http://www.donkarl.com
    Access Lobby: http://www.AccessDevelopers.org

  • How can I delete null values from List Item?

    Hi Friends,
    I used List item for field job_Type, I entered values in List item at design time through property pallet. When I run form I will see null values in this List Item.
    How can I remove these null values from the List?
    Best regards,
    Shahzad

    Dear Shahzad,
    It can be removed by adding the following code in the When-new-Form-Instance.
    Set_item_property('List name', required, property_true);
    :block_name.list_name := <put your default value here>; (If you didn't oput the default value, then you will get some problem and the cursor may not navigate away from the list).
    Senthil Alagu .P.

  • How can i pass NULL value in Store Procedure?

    Hi guys,
    I am calling one store procedure from MS SQL Server 200, i had create the follow layout:
    But i need pass to MSQL SEVER the CPF = NULL, when i execute the procedre the CPF send empty value (not null).
    I already changed Communication Channel parammeter "Interpretation of Empty String Values" to "Null Value" value.
    But the interface always send empty string instead of null.
    How can anybody help me, please?
    Edited by: João Noberto dos Santos Junior on Jun 24, 2009 5:00 PM

    Hi,
    To achieve this through "Interpretation of Empty String Value" in the cc, you will have to implement a patch which is sent to you by SAP when an OSS is raised. By default its not available, i mean you can configure it but it will actually not work.
    As a temporary solution you can map your element with a constant/mapwithdefault field with value mentioned as NULL.
    Regards,
    Anshul

  • How to give a default value in an inputText on a Form (Jdev 11G Preview2)

    First Test :
    In the .jspx I have a Form with an inputText :
    -id = inputText1
    -value=#{bindings.ppartId.inputValue}
    In the page Def (in the <methodAction ..for the submit button) I modified the NDValue in order to have
    <NamedData NDName="ppartId" NDType="java.lang.Integer"
    NDValue="${ParticipantInfo.participantId}"/>
    --> After clicking on the submit button I got a null value for the ppartId (in my model method) [In my ManagedBean ParticipantInfo, participantId is OK]
    Second Test
    In the .jspx I have a Form with an inputText :
    -id = inputText1
    -value=#{bindings.ppartId.inputValue}
    I replace the value
    -id = inputText1
    -value=#{ParticipantInfo.participantId}
    --> I saw the correct value when running the form but After clicking on the submit button I got a null value for the ppartId (in my model method)
    So my problem is : I just want to give a default value on an inputText on a form with a Managedbean. How to do that ?
    Could I modify the code of the action ofthe submit button to do that but how ?
    public String saisierapide_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("SaisieRapide");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    }

    Hi,
    if your attribute binding is bound to a variable, then you can achieve this by setting the DefaultValue attribute for the variable to the desired value. E.g.
      <variable Name="ppartIdVariable" Type="java.lang.String"
                DefaultValue="${ParticipantInfo.participantId}"/>
    <attributeValues id="ppartId" IterBinding="variables">
      <AttrNames>
        <Item Value="ppartIdVariable"/>
      </AttrNames>
    </attributeValues>HTH,
    Patrik

  • How to update the null values to some number on the NUMBER type of column

    Hello All,
    I have one NUMBER type of column in DB table. It has some (null) values. I want to update with value 1. I tried to run the Update statement , It gives 0 rows updated.
    SELECT objectid,attr20 FROM table;
    object id attr20
    ====== ====
    fff70b67-8d54-4ad7-bc57-7b40a0d8b219     (null)
    cac5264a-b363-487b-bfe6-6b84d60064e9     (null)
    2fc2a626-51d8-401c-9495-18aacd4c35c8     (null)
    1b60bfa4-ff68-4488-adf6-2a83528c0e20     (null)
    1c662829-24c1-4b3c-9289-0128e170c043     5
    74f11331-545b-435f-bf4b-f57c7a6b4500     2
    c941c1ac-a18e-47ec-843c-dbe2a5b51001     0
    d7eba203-93c0-48ea-a109-9b06015ef387     0
    eba72fa3-21d8-4489-bb93-917ebbd67de2     0
    I ran following query but no success.
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = NULL
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = null
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 = ''
    0 rows updated
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 =' '
    Error starting at line 1 in command:
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 =' '
    Error report:
    SQL Error: ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    can some one help me out to update such values ????

    Hi,
    "=" will not work for NULL values. Please remeber two NULL values are NOT same. Try IS operator.
    UPDATE eb_tcsservfnadoc SET attr20 = 1 WHERE attr20 IS NULLRegards,
    Avinash

  • How to eliminate explicit "null" values

    Hello,
    I am having a problem in eliminating the explicit "null" values while retrieving them from the database.
    Here is my problem as follows,
    For the optional fields in a form i am explicitly entering "null" as value or else it is throwing null pointer exception in linux. While i am trying to display the values existing in a table it is displaying fine when i use this condition
    if(varialble.equals("null") ||varialble.equals("") || variable.equals(null))
    varialble = "";
    else
    out.println(variable)
    But when i use the same for the values i retrieve from the view it is displaying "Null" for the explicit "null" values and null from implicit null values.
    Please help me out how to remove the explicit null values. It would be great help if somebody replies me at the earliest.
    Thanks in advance
    daya

    the following is the code which i am using to retrieve values.
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    import StrChk.*;
    public class DataSearch extends HttpServlet
         Connection con=null;
         Statement st=null;
         ResultSet rs=null;
         ResultSetMetaData rsmd=null;
         PrintWriter out=null;
         public void doPost(HttpServletRequest req, HttpServletResponse res)
         throws IOException,ServletException
              String key;
              String sql;
              res.setContentType("text/html");
              out = res.getWriter();
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection("jdbc:odbc:daya","daya","daya");
                   st = con.createStatement();
              catch(Exception e)
                   System.out.println("Error Accessing DataBase:"+e);
              key = req.getParameter("key");
    //          Search(str1.retString(key));
              Search(key);
         public void Search(String key)
              int res=0;
              boolean flag=true,found=false;
              StringTokenizer strt = new StringTokenizer(key, " ");
              String sql;
              String str1,str2;
              int i=0;
    int count = strt.countTokens();
    String keywords[] = new String[count+1];
              keywords=key;
              i++;
              if(count > 1)
         count++;
                   while(strt.hasMoreTokens())
                   keywords[i] = strt.nextToken();
                        i++;
              out.println("<html><title>DataSearch</title>");
              out.println("<script>");
              out.println("function myclose(){ self.close(); } ");
              out.println("</script><body>");
              for(i=0; i<count && flag==true; i++)
                   try
              /* sql = "select ";
                   sql += " nvl(\"Topic Title\",' '), ";
                   sql += " nvl(\"Name\",' '), ";
                   sql += " nvl(\"Title\",' '), ";
                   sql += " nvl(\"Affiliation\",' '), ";
                   sql += " nvl(\"Street Name\",' '), ";
                   sql += " nvl(\"City\",' '), ";
                   sql += " nvl(\"State\",' '), ";
                   sql += " nvl(\"Country\",' '), ";
                   sql += " nvl(\"Zip Code\",' '), ";
                   sql += " nvl(\"Phone\",' '), ";
                   sql += " nvl(\"Fax\",' '), ";
                   sql += " nvl(\"eMail\",' '), ";
                   sql += " nvl(\"Web Site\",' ') ";
                   sql += " from SEARCHVWUSERDET where ";
                   sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%')";*/
                   sql = "select ";
                   sql += " nvl(\"Name\",' '), ";
                   sql += " nvl(\"Title\",' '), ";
                   sql += " nvl(\"Affiliation\",' '), ";
                   sql += " nvl(\"Street Name\",' '), ";
                   sql += " nvl(\"City\",' '), ";
                   sql += " nvl(\"State\",' '), ";
                   sql += " nvl(\"Country\",' '), ";
                   sql += " nvl(\"Zip Code\",' '), ";
                   sql += " nvl(\"Phone\",' '), ";
                   sql += " nvl(\"Fax\",' '), ";
                   sql += " nvl(\"eMail\",' '), ";
                   sql += " nvl(\"Web Site\",' '), ";
                   sql += " nvl(\"Key Words\",' ') ";
                   sql += " from searchcombi where ";
                   sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%') or";
                   sql += " lower(\"Key Words\") like " + "lower('%" + keywords[i] + "%')";
                   sql += " order by \"Name\" ";
                   rs = st.executeQuery(sql);
                   //out.println(sql);
                   if(rs.next())
                        if(i == 0)
                             flag=false;
                        found=true;
                        res=0;
                   do
                        res++;
                   }while(rs.next());
                   out.println(res++);
                   out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ keywords[i]+"\", ");
                   out.println("Total Matches found : "+res+"</center><br>");
                   rs = st.executeQuery(sql);
                   while(rs.next())
                        res++;
                             out.println("<table width=600 align=center>");
                             str1 = disp(rs.getString(1),keywords[i]);
                             out.println(str1);
                             //if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
                             if(str1 == "null" || str1 == "")
                                  str1 = "";
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Name </td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                                  //System.out.println(str1);
                                  //out.println(str1);
                             str2="";
                             str1 = disp(rs.getString(2),keywords[i]);
                             if(!str1.equals("") || !str1.equals(""))
                                  str2 = str1;          
                             str1 = disp(rs.getString(3),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             if(!str2.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Title, Affiliation</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
                                  out.println(str2);     
                                  out.println("</td></tr>");
                             str2="";
                             str1 = disp(rs.getString(4),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  str2 = str1;          
                             str1 = disp(rs.getString(5),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(6),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(7),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(8),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             if(!str2.equals(""))
                                  out.println("<tr><td valign=top width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Address </td>");
                                  out.println("<td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
                                  out.println(str2);     
                                  out.println("</td></tr>");
                             str1 = disp(rs.getString(9),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Phone</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp(rs.getString(10),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Fax</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");      
                             str1 = disp(rs.getString(11),keywords[i]).toLowerCase();
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>eMail</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp(rs.getString(12),keywords[i]).toLowerCase();
                             if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
                                  str1="";
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Web Site</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp((rs.getString(13)).replace(',',' '),keywords[i]);
                             if(str1 == "null" || str1 == null || str1 == "")
                             //if(!rs.wasNull())
                                  out.println("nothing");
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Key Words</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             out.println("<tr><td width=150><hr></td><td><hr></td></tr>");
                             out.println("</table><br>");
                   } // end while
                   } // end if
                   catch(Exception e)
                        System.out.println("Exception while executing query: "+ e);
              } // end for
              if(!found)
                   out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ key+"\", ");
                   out.println("Total Matches found : 0</center><br>");
              out.println("<center><a href=\"javascript:myclose()\"><font color=red face=\"verdana, geneva, arial, sans-serif\" size=2>Close</a></center>");
              out.println("</body></html>");
         public void doGet(HttpServletRequest req, HttpServletResponse res)
         throws IOException,ServletException
              doPost(req,res);
         public String disp(String str1, String str2)
              int i,j,k;
              boolean found=false;
              String s1,s2,s3;
              String t1,t2;
              t1 = initCap(str1);
              s1 = t1.toLowerCase();
              s2 = str2.toLowerCase();
              for(i=0;i<s1.length() && !found ;i++)
                   k=i;
                   for(j=0;j<s2.length() && k < s1.length() && s1.charAt(k) == s2.charAt(j) ;j++,k++);
                   if(j==s2.length())
                        found=true;
              if(found)
                   i--;
                   s3 = t1.substring(0,i);
                   s3 += "<font color=blue face=\"verdana, geneva, arial, sans-serif\" size=2><b>";
                   s3 += t1.substring(i,i+str2.length());
                   s3 += "</font></b>";
                   s3 += t1.substring(i+str2.length(),t1.length());
              else
                   s3 = t1;
              return s3;
         public String initCap(String str)
              StringTokenizer st = new StringTokenizer(str," ");
              String s1="";
              String s2="";
              String s3="";
              String s4="";
              while(st.hasMoreElements())
                   s1 = (String)st.nextElement();
                   if(s1.length() > 0)
                        s2 = s1.substring(0,1);
                        s2 = s2.toUpperCase();
                   if(s1.length() > 1)
                        s3 = s1.substring(1,s1.length());
                   s2 += s3;
                   s4 +=" "+s2;
              return s4;

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • How can I get null values for the later weeks

    Hi All,
    When I execute this code I get the records till current week.
    How can I display the output so that I get null values for the later weeks. (with the help of v_numOfWeeks variable in the code)
    Thanks,
    Vikram
    DECLARE
       v_query VARCHAR2(4000);
       TYPE ref_cursor IS REF CURSOR;
       v_refcur ref_cursor;
       v_sum NUMBER;
       v_id NUMBER;
       v_name VARCHAR2(1000);
       v_weeknum NUMBER;
       v_pernum NUMBER;
       v_numOfWeeks NUMBER := 5;
    BEGIN
    v_query := ' SELECT SUM(product_bkg), postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                              FROM ops_cv_extract b, (SELECT row_id, desc_text postn_name
                          FROM s_postn) postn_tbl
                          WHERE lvl_6_id = 5767
                          AND fiscal_year = 2008
                          AND b.week_num < 4
                          AND b.period_num = 3
                          AND b.postn_id = TO_NUMBER(postn_tbl.row_id)
                          GROUP BY postn_id, postn_tbl.postn_name, b.week_num, b.period_num
                          ORDER BY  postn_tbl.postn_name, b.week_num';
    OPEN v_refcur FOR v_query;
    LOOP
       FETCH v_refcur INTO v_sum, v_id, v_name, v_weeknum, v_pernum;
       EXIT WHEN v_refcur%notfound;
       dbms_output.put_line('P'|| v_pernum||'W'|| v_weeknum||' '||v_name||' '||v_sum);
    END LOOP;
    END;
    This is the output when I execute this code.
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W2 COMM CNTRL TAM 216 12561.4
    P3W3 COMM CNTRL TAM 216 2027.1
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    This is the output I'd like to get
    P3W1 COMM CNTRL ISAM 213 26961.61
    P3W2 COMM CNTRL ISAM 213 12870.4
    P3W3 COMM CNTRL ISAM 213 245.88
    P3W4 COMM CNTRL ISAM 213
    P3W5 COMM CNTRL ISAM 213
    P3W1 COMM CNTRL ISAM 273 72831.2
    P3W2 COMM CNTRL ISAM 273 8739.38
    P3W3 COMM CNTRL ISAM 273 3764.92
    P3W4 COMM CNTRL ISAM 273
    P3W5 COMM CNTRL ISAM 273
    P3W1 COMM CNTRL TAM 213 49844
    P3W2 COMM CNTRL TAM 213 20515.17
    P3W3 COMM CNTRL TAM 213 16167.46
    P3W4 COMM CNTRL TAM 213
    P3W5 COMM CNTRL TAM 213
    P3W1 COMM CNTRL TAM 273 -3336.71
    P3W2 COMM CNTRL TAM 273 -1376.68
    P3W3 COMM CNTRL TAM 273 19707.42
    P3W4 COMM CNTRL TAM 273
    P3W5 COMM CNTRL TAM 273
    P3W1 Damon Walters -609.07
    P3W2 Damon Walters 30030.24
    P3W3 Damon Walters 37475.1
    P3W4 Damon Walters
    P3W5 Damon Walters Edited by: polasa on Oct 28, 2008 6:42 PM

    Sure, in a Single SQL ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>-- Start Of Test Data --
    satyaki>with week_tab
      2  as
      3    (
      4      select 1 period_num, 1 week_num, 10 bkg1 from dual
      5      union all
      6      select 1, 2, 40 from dual
      7      union all
      8      select 1, 3, 30 from dual
      9      union all
    10      select 1, 2, 20 from dual
    11      union all
    12      select 1, 1, 10 from dual
    13      union all
    14      select 1, 1, 20 from dual
    15      union all
    16      select 1, 3, 10 from dual
    17      union all
    18      select 2, 1, 15 from dual
    19      union all
    20      select 2, 2, 20 from dual
    21      union all
    22      select 2, 3, 10 from dual
    23      union all
    24      select 2, 1, 15 from dual
    25      union all
    26      select 2, 2, 30 from dual
    27      union all
    28      select 2, 3, 20 from dual
    29    )
    30  -- End Of Test Data --
    31  select period_num,
    32         week_num,
    33         (
    34            select sum(week_tab.bkg1)
    35            from week_tab
    36            where period_num = m.period_num
    37            and   week_num   = m.week_num
    38            group by week_num, period_num
    39         ) sum_bkg1
    40  from (
    41        select dum.week_num,
    42              wk.period_num
    43        from (
    44                select 1 week_num from dual
    45                union all
    46                select 2 from dual
    47                union all
    48                select 3 from dual
    49                union all
    50                select 4 from dual
    51                union all
    52                select 5 from dual
    53              ) dum ,
    54              (
    55                select distinct period_num
    56                from week_tab
    57          ) wk
    58      ) m;
    PERIOD_NUM   WEEK_NUM   SUM_BKG1
             1          1         40
             1          2         60
             1          3         40
             1          4
             1          5
             2          1         30
             2          2         50
             2          3         30
             2          4
             2          5
    10 rows selected.
    Elapsed: 00:00:00.48
    satyaki>Regards.
    Satyaki De.

  • How to remove gaps/null values from set of columns in a row

    Im trying to implement a solution for removing null value columns from a row.
    Basically in below example i have five codes and corresponding id's for that codes.What im trying to achive here is if
    i have a null code then i have to move next not null code and id into its new location.
    Example:
    'A1'cd1,'A2'cd2,null cd3,'A4'cd4,null cd5,'i1'id1,'i2'id2,null id3,'i4' id4,null id5 So here cd4 and id4 should take positions of cd3 and id3.
    Output should look like this
    cd1 cd2 cd3 cd4 cd5     id1 id2 id3 id4 id5
    A1  A2   A4              i1  i2  i4Any help would be highly appreciated for below example:
    with temp_table as
    (select 'A1'cd1,'A2'cd2,null cd3,'A4'cd4,null cd5,'i1'id1,'i2'id2,null id3,'i4' id4,null id5 from dual union all
    select 'A11',null,null,'A44','A55','id11',null,null, 'id44','id55' from dual union all
    select null,'A111',null,null,'A555',null,'id111',null, null,'id555' from dual union all
    select 'A',null,null,'A1111','E55','id11',null,null, 'id111','id1111' from dual )
    select * from temp_table;Edited by: GVR on Dec 1, 2010 8:27 AM

    I like case expression B-)
    The same question of my homepage http://www.geocities.jp/oraclesqlpuzzle/7-81.html
    with temp_table(cd1,cd2,cd3,cd4,cd5,id1,id2,id3,id4,id5) as(
    select 'A1' ,'A2' ,null,'A4'   ,null  ,'i1'  ,'i2'   ,null,'i4'   ,null     from dual union all
    select 'A11',null ,null,'A44'  ,'A55' ,'id11',null   ,null,'id44' ,'id55'   from dual union all
    select null,'A111',null,null   ,'A555',null  ,'id111',null,null   ,'id555'  from dual union all
    select 'A'  ,null ,null,'A1111','E55' ,'id11',null   ,null,'id111','id1111' from dual)
    select
    case when SumCD1 = 1 then CD1
         when SumCD1+SumCD2 = 1 then CD2
         when SumCD1+SumCD2+SumCD3 = 1 then CD3
         when SumCD1+SumCD2+SumCD3+SumCD4 = 1 then CD4
         when SumCD1+SumCD2+SumCD3+SumCD4+SumCD5 = 1 then CD5 end as CD1,
    case when SumCD1+SumCD2 = 2 then CD2
         when SumCD1+SumCD2+SumCD3 = 2 then CD3
         when SumCD1+SumCD2+SumCD3+SumCD4 = 2 then CD4
         when SumCD1+SumCD2+SumCD3+SumCD4+SumCD5 = 2 then CD5 end as CD2,
    case when SumCD1+SumCD2+SumCD3 = 3 then CD3
         when SumCD1+SumCD2+SumCD3+SumCD4 = 3 then CD4
         when SumCD1+SumCD2+SumCD3+SumCD4+SumCD5 = 3 then CD5 end as CD3,
    case when SumCD1+SumCD2+SumCD3+SumCD4 = 4 then CD4
         when SumCD1+SumCD2+SumCD3+SumCD4+SumCD5 = 4 then CD5 end as CD4,
    case when SumCD1+SumCD2+SumCD3+SumCD4+SumCD5 = 5 then CD5 end as CD5,
    case when SumID1 = 1 then ID1
         when SumID1+SumID2 = 1 then ID2
         when SumID1+SumID2+SumID3 = 1 then ID3
         when SumID1+SumID2+SumID3+SumID4 = 1 then ID4
         when SumID1+SumID2+SumID3+SumID4+SumID5 = 1 then ID5 end as ID1,
    case when SumID1+SumID2 = 2 then ID2
         when SumID1+SumID2+SumID3 = 2 then ID3
         when SumID1+SumID2+SumID3+SumID4 = 2 then ID4
         when SumID1+SumID2+SumID3+SumID4+SumID5 = 2 then ID5 end as ID2,
    case when SumID1+SumID2+SumID3 = 3 then ID3
         when SumID1+SumID2+SumID3+SumID4 = 3 then ID4
         when SumID1+SumID2+SumID3+SumID4+SumID5 = 3 then ID5 end as ID3,
    case when SumID1+SumID2+SumID3+SumID4 = 4 then ID4
         when SumID1+SumID2+SumID3+SumID4+SumID5 = 4 then ID5 end as ID4,
    case when SumID1+SumID2+SumID3+SumID4+SumID5 = 5 then ID5 end as ID5
    from (select cd1,cd2,cd3,cd4,cd5,id1,id2,id3,id4,id5,
          nvl2(cd1,1,0) as SumCD1,
          nvl2(cd2,1,0) as SumCD2,
          nvl2(cd3,1,0) as SumCD3,
          nvl2(cd4,1,0) as SumCD4,
          nvl2(cd5,1,0) as SumCD5,
          nvl2(id1,1,0) as SumID1,
          nvl2(id2,1,0) as SumID2,
          nvl2(id3,1,0) as SumID3,
          nvl2(id4,1,0) as SumID4,
          nvl2(id5,1,0) as SumID5
          from temp_table)
    order by cd1,cd2,cd3,cd4,cd5;
    CD1   CD2    CD3   CD4   CD5   ID1    ID2    ID3     ID4   ID5
    A     A1111  E55   null  null  id11   id111  id1111  null  null
    A1    A2     A4    null  null  i1     i2     i4      null  null
    A11   A44    A55   null  null  id11   id44   id55    null  null
    A111  A555   null  null  null  id111  id555  null    null  nullMy SQL articles of OTN-Japan
    http://www.oracle.com/technology/global/jp/pub/jp/ace/sql_image/1/otnj-sql-image1.html
    http://www.oracle.com/technology/global/jp/pub/jp/ace/sql_image/2/otnj-sql-image2.html

  • How to avoid the null values from xml publisher.

    I am creating a report which have the claim numbers with the values CLA001,CLA111,null, null . when i preview my report it is showing some spaces for null values also. How can i avoid the spaces from the report.
    I am giving for loop for the claim numbers in the template.
    <?for-each:ROW?> <?sort:CLAIMNUMBER;'ascending';data-type='text'?>
    <?CLAIMNUMBER?>
    <?end for-each?>
    Please help me out to solve this problem.
    Thanks,
    vasanth.

    Hi Sheshu,
    According to your description, you are experiencing the null values and infinity values when browser the calculated measure, right?
    Based on my research, the issue is caused by that dividing a non-zero or non-null value by zero or null. In this cases, we need to check for division by zero to avoid this situation. Here is the sample query for you reference.
    IIF(
    Measures.[Measure B]=0,null,
    Measures.[Measure A] / Measures.[Measure B]
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Can not wifi print with EPSON ARTISAN 837

    hi, can anyone help to fix the problem of wifi printing? my system is lion 10.7.2, and printer is epson artisan 837. i have searched internet, but can not find solution. also i called epson and was told laterest 10.7 not support wifi printing. but, s

  • Some effects are not loading/missing

    OK, recently re-installed final cut studio(not for the effects reason, instead because of motion's frequent crashing), anyway...I have noticed that a lot of effects no longer show up....ones I have noticed or the glow effects(outter glow, light rays,

  • Buid mSata into a MacBook Pro

    Hello, i have a MacBook Pro early 2011. Is there a possibility to build a mSata drive into it? Greets from Germany

  • Configuring Restart On property in Cronacle for running scripts in loop

    Hello all, We have a scenario where in we have run a script or job chain in a loop. The loop count is fixed, however the count is coming in from a parameter. - Could you tell us if the parameter value can be set dynamically as a result of execution o

  • Creating hyperlink in column based on data, in ALV Web Dynpro ABAP

    Hi, I have a scenario in which i need to create hyperlink on a column. However all rows in that column need not be hyperlink. Based on the data i need to create it as hyperlink. eg: Column1 Column2       ABC        1234       DEF     5678       GHI