BC4J Objects with PKs based on two columns using multiple sequences

I have implemented a BC4J object that is based on a DB table that has two columns as the primary key. For example Table A's primary key is Group and ID and there is a DB sequence for each Group.
I use the BC4J object using servlets and JSPs and I have been able to implement an Update form.
I now want to implement a Create (New) form. I've read forum postings and info on the help regarding using the SequenceImpl class to override the EntityImpl object's create method as shown below:
protected void create(AttributeList attributeList)
super.create(attributeList);
SequenceImpl mySeq = new SequenceImpl("MY_SEQ",getDBTransaction());
setMyObjectId(mySeq.getSequenceNumber());
But as you can see I need to know the value of the group attribute before I can get the next value sequence:
For new EO belonging in Group1 I need sequence from "GROUP1_SEQ", Group 2 from "GROUP2_SEQ", etc.
I would like to put this code in the Entity Object where it belongs. I guess my problem is simply how to create a new row in the View Object with a passed parameter which is the value of Group.
Thanks in advance!

Angelo:
How is the EO suppose to receive the group id? Is it from the view row? If so, the VO can pass that group id to the EO through the attribute list and calling the
public Row createAndInitRow(AttributeList nvp);
API.
Example code would be:
ViewObject myVO;
// myVO is initialized
AttributeList nvp = new oracle.jbo.NameValuePairs();
// GroupID is the attr name of the Group ID
nvp.setAttribute("GroupID", <some-value>);
Row row = myVO.createAndInitRow(nvp);
If you do that the create(AttributeList attributeList) method of the EO will receive the GroupID value coming from the VO.
Then, you can use that for your sequence.
Thanks.
Sung

Similar Messages

  • Update column based on two columns

    Hi,
    MinValue     MaxValue    Desc
    -1                -1    
    -1                 1    
    -1                 2    
    0                  0    
    0                  1    
    0                  2 
    The above is my table which is having three columns MinValue, MaxValue, Desc. First two columns have data and I need to update the 3rd column 'Desc' based on two columns data.
    I need to update like,
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    The data in 'MaxValue' is like 1,2,3,4,5...50. So for each description it should append this value as mentioned above(till 'Up to 50', 'At least 50'). How can I do this with case statement?
    Thanks,
    Gangadhar

    declare @T table ( MinValue int,MaxValue int, [Desc] nvarchar(100) );
    insert @T ( MinValue, MaxValue )
    values ( -1, 1 ) , ( -1, 1 ) , ( -1, 2), ( 0, 0), ( 0, 1), ( 0, 2)
    select *
    from @T
    update @T
    set [Desc] = case
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    end
    select *
    from @T
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Sorting based on two columns in report

    Hi,
    we have one issue on sorting based on two columns in report.
    In the report we are doing sorting on two columns(week_id and stage_name). I have attached the screen shot for the same. The sorting is first done on the week_id and then on the stage_name. The issue comes when we have no data for the stage 1 - Prospect in W1. The stage goes to the second position.
    Please suggest if there is any work around to show the 1 - Prospect stage in W1.
    Regards,
    Ambika Nanda.

    what is w1? where is screenshot? and is stage seoncd sort? if so what is the issue?

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Parent-Child hierarchy based on two-column key

    Hello
    Is it possible to create a parent-child hierarchy, if the primary key of the table consists of two columns?
    My table looks like:
    TRACE_ID | DIAG_ID | SUPER_DIAG_ID
    with TRACE_ID and DIAG_ID as PK.
    If I define only DIAG_ID as PK, I can add a logical dimension (PC-hierarchy) without problems.
    However when I also add TRACE_ID to my PK, I cannot select a member key in the new logical dimension window and therefore not create a logical dimension.
    Is this a limitation of OBIEE and I have to merge the two colums (which would be rather bad, as there are FK relations to DIAG_ID) or is there a solution?
    Regards
    Matthias

    Dear Gowtham  ,
    I am very well aware of the level based hierarchy available in BO .
    The issue that i have raised is all about the Parent Child Hierarchy which creates the recursive query.
    I.e Every Parent has a child and that child can be parent of some other . (See the original example for more illustration)

  • Compare two tables based on two columns

    Hi,
    my tables looks like this:
    Desc Table A (account)
    Account1_id
    Account2_id
    name,
    empid
    Table B (Bill )
    BillNo
    Advertiserid
    agencyid
    total vvalue
    I need to pick up total value from table B where the unique combination of advertiser-Agency id is the same as the given account1_id -Account2_id combination in table A for each employee id.
    In other words my output should be like
    Empid | Account_id (should be same as advertiserid)| Account2_id (same as agencyid) | sum(total_value) for this adv-agency combination.....
    objective: Get the total value from table B for each unique account1-account2 combination (advertiser-agency in other words) .
    I am not sure if I should use a coreelated subquery or how to handle the situation....Right now I am just checking the two columns separately like this:
    select.......from a,b
    where b.advertiser_id = a.account1_id and b.agencyid = b.account2id
    Is it correct to do so? I have a feeling that I am missing something if I join them seperately like this......Any advice on this?
    I am using Oracle 10g. Hope I am clear.Please let me know. Thankx in advance.

    Here you go:
    SQL> WITH bill AS
      2  (
      3          SELECT 1000 AS billno, 101 AS advertiserid, 102 AS agencyid, 5000 AS total_value FROM DUAL UNION ALL
      4          SELECT 1001, 101, 103, 5000 FROM DUAL UNION ALL
      5          SELECT 1002, 101, 102, 1000 FROM DUAL
      6  ), account AS
      7  (
      8          SELECT 101 AS account1_id, 102 AS account2_id, 'John' AS name, 50 AS empid FROM DUAL UNION ALL
      9          SELECT 101, 103, 'James', 40 FROM DUAL UNION ALL
    10          SELECT 101, 105, 'Joe', 60 FROM DUAL
    11  )
    12  /* End Sample Data */
    13  SELECT a.name
    14       , a.empid
    15       , a.account1_id
    16       , a.account2_id
    17       , SUM(b.total_value)
    18  FROM   account a
    19  JOIN   bill    b ON  a.account1_id = b.advertiserid
    20                   AND a.account2_id = b.agencyid
    21  GROUP BY a.name
    22         , a.empid
    23         , a.account1_id
    24         , a.account2_id
    25  ;
    NAME                 EMPID          ACCOUNT1_ID          ACCOUNT2_ID   SUM(B.TOTAL_VALUE)
    John                    50                  101                  102                 6000
    James                   40                  101                  103                 5000

  • Unique row based on two columns and single column

    Dear Members,
    I have a table which contains duplicate rows, for which a query should be able to fetch the unique row from the table. Here the unique is not based on one column, but it should be on two columns and also check for uniqueness on one column.
    create table addr ( firstname varchar2(10), lastname varchar2(10), area varchar2(3));
    insert into addr values('bob', 'james', '1');
    insert into addr values('bob', 'james', '1');
    insert into addr values('harry', 'bert', '1');
    insert into addr values('jimmy', 'bert', '1');
    insert into addr values('sam', 'mac', '1');
    insert into addr values('sam', 'knight', '1');
    insert into addr values('tom', 'sand', '1');
    insert into addr values('cat', 'mud', '1');
    The output of query should contain 3 rows.
    bob - james
    harry - bert or jimmy - bert [ either one of them, but not both ]
    sam - mac or sam - knight [ either one of them, but not both ]
    tom - sand
    cat - mud
    SELECT firstname, lastname as total from addr WHERE area = '1' GROUP by firstname,lastname; This does not take of single column duplication..
    Any suggestions..

    SQL> with t_data
    as
    select 'bob' as firstname, 'james' as lastname, '1' as area from dual union all
    select 'bob', 'james', '1' from dual union all
    select 'harry', 'bert', '1' from dual union all
    select 'jimmy', 'bert', '1' from dual union all
    select 'sam', 'mac', '1' from dual union all
    select 'sam', 'knight', '1' from dual union all
    select 'tom', 'sand', '1' from dual union all
    select 'cat', 'mud', '1' from dual
    SELECT
            firstname,
            lastname,
            area
    FROM
                    SELECT
                            t.*,
                            row_number() over(partition BY firstname order by 1) rn,
                            row_number() over(partition BY lastname order by 1) rn1
                    FROM
                            t_data t
    WHERE
            rn     = 1
    AND rn1 =1 ; 
    FIRSTNAME       LASTNAME        AREA
    bob             james           1
    cat             mud             1
    jimmy           bert            1
    sam             knight          1
    tom             sand            1
    SQL>

  • Populating a table with two columns using a custom bean

    hello,
    Can someone provide me or give me a link to an example of populating a table (with two columns) with a custom bean?
    thank you
    fwu

    1)create a java class
    2)have a list as a class variable
    3) populate the list in the constructor..
    4) map the values in the af:table
    //Employee pojo
    public class Employee {
        public Employee() {
            super();
        private String empName;
        private String empManager;
        private String job;
        public void setEmpName(String empName) {
            this.empName = empName;
        public String getEmpName() {
            return empName;
        public void setEmpManager(String empManager) {
            this.empManager = empManager;
        public String getEmpManager() {
            return empManager;
        public void setJob(String job) {
            this.job = job;
        public String getJob() {
            return job;
    //maanged bean
    public class Bean {
    private List<Employee> employee;
        public Bean() {
            super();
            employee = new ArrayList<Employee>();
          Employee e1 = new Employee();
          e1.setEmpName("xxxxx");
          e1.setEmpManager("xxxxxxxx");
          e1.setJob("xxxxxxx");
          Employee e2 = new Employee();
          e2.setEmpName("yyyyyyy");
          e2.setEmpManager("yyyyyyy");
          e2.setJob("yyyyyyt");
          Employee e3 = new Employee();
          e3.setEmpName("zzzzzz");
          e3.setEmpManager("zzzzzzz");
          e3.setJob("zzzzzzzz");
          employee.add(e1);
          employee.add(e2);
          employee.add(e3);
          employee.add(e4);
        public void setEmployee(List<Employee> employee) {
            this.employee = employee;
        public List<Employee> getEmployee() {
            return employee;
        }in the table map like
    <af:table value="#{Bean.employee}" var="row" rowBandingInterval="0"
                        id="t1">
    <af:column headerText="Employee Name" id="c1">
                  <af:inputText value="#{row.empName}" id="it5"/>
                </af:column>
                <af:column headerText="Employee Manager" id="c2">
                  <af:inputText value="#{row.empManager}" id="it2"/>
                </af:column>
    </af:table>

  • Qualified list item based on two columns

    - fact table inludes following columns
    key1
    key2
    measure1
    In segment designer, update counts:
    the query must counts two columns "key1 and key2" that key1 and key2 together must be distinct.

    Here you go:
    SQL> WITH bill AS
      2  (
      3          SELECT 1000 AS billno, 101 AS advertiserid, 102 AS agencyid, 5000 AS total_value FROM DUAL UNION ALL
      4          SELECT 1001, 101, 103, 5000 FROM DUAL UNION ALL
      5          SELECT 1002, 101, 102, 1000 FROM DUAL
      6  ), account AS
      7  (
      8          SELECT 101 AS account1_id, 102 AS account2_id, 'John' AS name, 50 AS empid FROM DUAL UNION ALL
      9          SELECT 101, 103, 'James', 40 FROM DUAL UNION ALL
    10          SELECT 101, 105, 'Joe', 60 FROM DUAL
    11  )
    12  /* End Sample Data */
    13  SELECT a.name
    14       , a.empid
    15       , a.account1_id
    16       , a.account2_id
    17       , SUM(b.total_value)
    18  FROM   account a
    19  JOIN   bill    b ON  a.account1_id = b.advertiserid
    20                   AND a.account2_id = b.agencyid
    21  GROUP BY a.name
    22         , a.empid
    23         , a.account1_id
    24         , a.account2_id
    25  ;
    NAME                 EMPID          ACCOUNT1_ID          ACCOUNT2_ID   SUM(B.TOTAL_VALUE)
    John                    50                  101                  102                 6000
    James                   40                  101                  103                 5000

  • Update multiple rows based on two columns in same row

    I have a 1000 rows in a table I would like to update with a unique value. This unique value is a cocatenation of two columns in teh same row.
    Each row has a (i) date and a (ii) time and a (iii) date_time column. I would like to update the date_time (iii) column with a cocatenation of the (i) date and (ii) time columns.
    I know how I would update a single row but how can I update multiple rows with a cocatenation of each of the two columns - i.e put a different value into the date_time column for each row?

    this?
    update table tab_name
    set date_time =date||time
    where your_condition

  • Split one column value into two columns using t-sql

    Hi All,
    I have one varchar column in a table.
    Col1
    ABC-12C4
    BC-A345
    CD
    XYZ
    How to split this into two columns like this using t-sql
    Col1   Col2
    ABC    12C4
    BC      A345
    CD     
    XYZ
    Thanks,
    RH
    sql

    assuming a static delimiter, and the split will end up with a max of 2 columns, something like this would work.  basically you just need to determine where the delimiter is, and then use the left and right functions to find the 2 pieces.
    declare @t table(value varchar(10))
    insert into @t(value)
    values
    ('ABC-12C4'), ('BC-A345'), ('CD'), ('XYZ')
    select
    case
    when charindex('-', value) != 0 then left(value, charindex('-', value) - 1)
    else value
    end as col1,
    case
    when charindex('-', value) != 0 then right(value, len(value) - charindex('-', value))
    else ''
    end as col2
    from @t

  • Method Validator based on two columns

    Hi,
    I have a table called FndCities with attributes city_id (pk), country_id (fk) and city_name.
    I want to check if a city name is unique for a certain country. For example England can have a city name called "London", but USA might have a city called "London". However neither England not USA can have two "London" cities.
    I have implemented a custom method validator and here is the logic:
    In the FndCitiesImpl.java i created the following method:
    public boolean validateCityName(String data) {
    FndCitiesDefImpl entityDef = (FndCitiesDefImpl)getDefinitionObject();
    String originalValue = (String)getPostedAttribute(CITYNAME);
    Number originalValuePk = (Number)getPostedAttribute(COUNTRYPKFK);
    if (data != null && !data.equalsIgnoreCase(originalValue)) {
    return !(entityDef.existsByCityName(getDBTransaction(),data, originalValuePk));
    return true;
    and in the FndCitiesDefImpl.java i have implemented the method existsByCityName(DBTransaction, city_name, country_id).
    In the creation method my custom validation works fine, however when i edit a record, becuase the if statement watches for changes in the city name, when changing the Country the validation is not performed. I cannot the country id in the validateCityName method because validation is performed on one column.
    How can i achieve this?
    Thanks
    Antonis

    Hi Antonis,
    Not sure what you mean again by "JDeveloper does not handle the constraints properly." I have exactly this situation in my application (JDev 10.1.3.1), and I am using a database constraint to enforce uniqueness across 2 columns. I've customized the error messages (see Re: Unique key existence check and ER: ADF BC - allow custom error msgs for common exceptions (e.g. DML) ). Works just dandy.
    John

  • Opening file present in treeview by clicking on it within a table? I had created a table with a row and two columns. in one column i had dislayed treeview and want that if i click on the file in treeview it gets opened in other column. Can this happen?

    I also got a code in some website related to my problem but there are errors in this code that i am not able to understand can you correct those errors:
    using System;
    using System.IO;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Microsoft.Web.UI.WebControls;
    namespace shark.TreeView
    /// <summary>
    /// Summary description for DocTree.
    /// </summary>
    public class DocTree : System.Web.UI.Page
    protected Microsoft.Web.UI.WebControls.TreeView TreeCtrl;
    public DocTree()
    Page.Init += new System.EventHandler(Page_Init);
    private void Page_Load(object sender, System.EventArgs e)
    if ( ! this.IsPostBack )
    // add tree node "type" for folders and files
    string imgurl = "/shark/webctrl_client/1_0/Images/";
    TreeNodeType type;
    type = new TreeNodeType();
    type.Type = "folder";
    type.ImageUrl = imgurl + "folder.gif";
    type.ExpandedImageUrl = imgurl + "folderopen.gif";
    TreeCtrl.TreeNodeTypes.Add( type );
    type = new TreeNodeType();
    type.Type = "file";
    type.ImageUrl = imgurl + "html.gif";
    TreeCtrl.TreeNodeTypes.Add( type );
    // start the recursively load from our application root path
    // (we add the trailing "/" for a little substring trimming below)
    GetFolders( MapPath( "~/./" ), TreeCtrl.Nodes );
    // expand 3 levels of the tree
    TreeCtrl.ExpandLevel = 3;
    private void Page_Init(object sender, EventArgs e)
    InitializeComponent();
    // recursive method to load all folders and files into tree
    private void GetFolders( string path, TreeNodeCollection nodes )
    // add nodes for all directories (folders)
    string[] dirs = Directory.GetDirectories( path );
    foreach( string p in dirs )
    string dp = p.Substring( path.Length );
    if ( dp.StartsWith( "_v" ) )
    continue; // ignore frontpage (Vermeer Technology) folders
    nodes.Add( Node( "", p.Substring( path.Length ), "folder" ) );
    // add nodes for all files in this directory (folder)
    string[] files = Directory.GetFiles( path, "*.aspx" );
    foreach( string p in files )
    nodes.Add( Node( p, p.Substring( path.Length ), "file" ) );
    // add all subdirectories for each directory (recursive)
    for( int i = 0; i < nodes.Count; i++ )
    if ( nodes[ i ].Type == "folder" )
    GetFolders( dirs[ i ] + "\\", nodes[i ].Nodes );
    // create a TreeNode from the specified path, text and type
    private TreeNode Node( string path, string text, string type )
    TreeNode n = new TreeNode();
    n.Type = type;
    n.Text = text;
    if ( type == "file" )
    // strip off the physical application root portion of path
    string nav = "/" + path.Substring( MapPath( "/" ).Length );
    nav.Replace( '\\', '/' );
    n.NavigateUrl = nav;
    // set target if using FRAME/IFRAME
    n.Target="doc";
    return n;
    #region Web Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    this.Load += new System.EventHandler(this.Page_Load);
    #endregion
    and the design that i got on website for the code that i displayed just above it is
    <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
    <%@ Page language="c#" Codebehind="DocTree.aspx.cs" AutoEventWireup="false" Inherits="shark.TreeView.DocTree" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript (ECMAScript)" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    </HEAD>
    <body>
    <form id="DocTree" method="post" runat="server">
    <table height="100%" cellSpacing="0" cellPadding="8" border="0">
    <tr height="100%">
    <td vAlign="top">
    <iewc:treeview id="TreeCtrl" runat="server" SystemImagesPath="/shark/webctrl_client/1_0/treeimages/">
    </iewc:treeview>
    </td>
    <td vAlign="top" width="100%" height="100%">
    Click on any *.aspx page in the tree and it should load here <iframe id="doc" name="doc" frameBorder="yes" width="100%" scrolling="auto" height="100%">
    </iframe>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </HTML>
    This is my code for viewing treeview but it is not expanding plz help me in this also
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.IO;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;
    using System.Media;
    using System.Drawing;
    using System.Drawing.Imaging;
    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    if (Page.IsPostBack == false)
    System.IO.DirectoryInfo RootDir = new System.IO.DirectoryInfo(Server.MapPath("~/Files"));
    // output the directory into a node
    TreeNode RootNode = OutputDirectory(RootDir, null);
    // add the output to the tree
    MyTree.Nodes.Add(RootNode);
    TreeNode OutputDirectory(System.IO.DirectoryInfo directory, TreeNode parentNode)
    // validate param
    if (directory == null) return null;
    // create a node for this directory
    TreeNode DirNode = new TreeNode(directory.Name);
    // get subdirectories of the current directory
    System.IO.DirectoryInfo[] SubDirectories = directory.GetDirectories();
    // OutputDirectory(SubDirectories[0], "Directories");
    // output each subdirectory
    for (int DirectoryCount = 0; DirectoryCount < SubDirectories.Length; DirectoryCount++)
    OutputDirectory(SubDirectories[DirectoryCount], DirNode);
    // output the current directories file
    System.IO.FileInfo[] Files = directory.GetFiles();
    for (int FileCount = 0; FileCount < Files.Length; FileCount++)
    DirNode.ChildNodes.Add(new TreeNode(Files[FileCount].Name));
    } // if the parent node is null, return this node
    // otherwise add this node to the parent and return the parent
    if (parentNode == null)
    return DirNode;
    else
    parentNode.ChildNodes.Add(DirNode);
    return parentNode;
    This is my design
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <style type="text/css">
    .auto-style2
    width: 412px;
    .auto-style3
    width: 174px;
    .auto-style4
    width: 743px;
    .auto-style5
    width: 506px;
    height: 226px;
    </style>
    </head>
    <body>
    <form id="form1" method="post" runat="server">
    <table align:"center" class="auto-style4" border="1" style="table-layout: fixed; border-spacing: 1px">
    <tr>
    <td class="auto-style3">
    <br />
    <br />
    <br />
    <br />
    </td>
    <td class="auto-style2">
    <br />
    <br />
    <br />
    <br />
    </td>
    </tr>
    <tr>
    <td class="auto-style3" valign="top">
    <asp:TreeView Id="MyTree" PathSeparator = "|" ExpandDepth="0" runat="server" ImageSet="Arrows" AutoGenerateDataBindings="False">
    <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" ForeColor="#5555DD"></SelectedNodeStyle>
    <NodeStyle VerticalPadding="0px" Font-Names="Tahoma" Font-Size="10pt" HorizontalPadding="5px" ForeColor="#000000" NodeSpacing="0px"></NodeStyle>
    <ParentNodeStyle Font-Bold="False" />
    <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD"></HoverNodeStyle>
    </asp:TreeView>
    </td>
    <td class="auto-style2">
    <base target="_blank" /> <iframe frameborder="0" scrolling="yes" marginheight="0" marginwidth="0"
    src="" class="auto-style5"></iframe>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    Hi meghage,
    From your code, it is a WebForm project.
    This forum is to discuss problems of Windows Forms. Your question is not related to the topic of this forum.
    You can consider posting it in asp.net forum for supports . Thanks.
    ASP.NET: http://forums.asp.net
    Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Percentage calculation in t-sql based on two columns

    Hi All
    I have a source table with 4 columns and data like this..
    ID  Cnt   Col1   Col2 
    1    22    17      5   
    2    20    15      5   
    3    12    5       7   
    4    10    null    10    
    5    25    25      null   
    My output should look like this..
    ID  Cnt    Col1   Col2  Col1%   Col22%
    1    22    17        5      77.27    22.73
    2    20    15        5      75.00    25.00
    3    12     5         7      41.66    58.34
    4    10               10      0          100
    5    25    25                100        0
    Create Statement:
    CREATE TABLE [dbo].[Sample] (
     [ID] Int NOT NULL,
     [Cnt] Int NULL,
     [Col1]  Int NULL,
     [Col2]  Int NULL,
     CONSTRAINT [Sample] PRIMARY KEY CLUSTERED
     [ID] ASC
    Insert Statement:
    insert into Sample(ID, cnt,Col1, col2) values (1 ,   22  ,  17   ,   5 )  
    insert into Sample(ID, cnt,Col1, col2) values (2 ,  20  ,  15    ,  5   )
    insert into Sample(ID, cnt,Col1, col2) values (3 ,   12  ,  5    ,   7 )
    insert into Sample(ID, cnt,Col1, col2) values (4 ,   10  ,  null ,   10 )
    insert into Sample(ID, cnt,Col1, col2) values (5 ,   25 ,   25   ,   null)
    Right now I am using below SQL but % fields are not coming correct.
    Select (COUNT(CASE WHEN (col1-col2)) < 1) THEN -1  END)  /COUNT(*) * 100) AS Col1%
    ,(COUNT(CASE WHEN (col1-col2) >=1) THEN  1  END)  /COUNT(*) * 100) AS Col2%
    I need SQL to get correct values in col1% and col2%
    Thanks,
    RH
    sql

    Is it what you need:
    SELECT Id
    ,cnt
    ,col1
    ,col2
    ,CASE
    WHEN Col1 IS NULL
    OR Col1 = 0
    THEN 0
    ELSE CAST((col1 * 100.0) / cnt AS DECIMAL(10, 2))
    END AS [Col1%]
    ,CASE
    WHEN Col2 IS NULL
    OR Col2 = 0
    THEN 0
    ELSE CAST((col2 * 100.0) / cnt AS DECIMAL(10, 2))
    END AS [Col2%]
    FROM Sample
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to split rows based on two columns..

    Hi all...
    I have a requirement.
    I have product column, sell, purchace prices..(total of three columns) in a data set.
    my data set is such a way that..if sale price exists...there is no purchase price and vice versa..
    I need too present in a report ,two tables:
    table 1 consists of only Sale price items
    table 2 should contain only Pruchase Items.
    Please see the below picture for clear understanding..
    Is that doable? Where do we need to impose a condition?I tried to impose a condition but,it didnt seem to work
    http://i51.tinypic.com/29xfdc6.jpg
    Please help.

    Can you send me the template and xml file to [email protected]? I can try to help.
    Did you try to filter out the records by the sale price or purchase price column not equal to null?
    Thanks,
    Bipuser

Maybe you are looking for

  • Windows Vista update has disabled full screen minimize feature when watching videos

    After recent Vista update I can no longer connect to hyperlinks in emails and fullscreen video function disables functionality and I can no longer stop or minimize videos until a system reboot.  Hoe do I restore to before the update?

  • Problem with updating my iPhotos.

    Ever since updating to the Maverick I have this issue. It keeps telling me that 'this update is for an app downloaded with a different Apple ID'. I don't have any other Apple ID except for the one I use and no one else has one in my household since I

  • Out look to SharePoint synchronization

    We need synchronize outlook default calender to SharePoint calendar list. We tried SharePoint calender to outlook synchronization, but after synchronize in separate calendar created in Outlook. We have already many appointments in our Outlook default

  • AppMod pooling with Servlets and JSPs

    Issue: I have a servlet that I need to do some work on a BC4J View Object (myVO), like set the where clause, execute, etc. I want to perform these actions in the servlet, and then forward on to a .jsp page (mypage.jsp). Then I want to use the BC4J Da

  • ERROR in setPayload: ORABPEL-10171

    Hi , One of our Customer is getting the following error in in the PRODUCTION ENV . This error has occured due to failure of update payload. OraBPEL~OC4J_BPEL~default_island~1:_ 07/01/26 08:38:57 ERROR in setPayload: ORABPEL-10171 Worklist Service Tas