Select expert: selecting sibling data based on one record's ID

Hi All,
Let's presume that I have two tables, company and contact. Contact carries the company ID.
On my report, I have all contacts grouped by comapnies. (simple, huh!?)
What I need to do is add a parameter that will allow a user to select an employee (id/name/ whatever, the condition is irrelevant to the question), and the report will display THAT employee, the company the employee works for, as well as all other employees who work for the same company.
To rephrase, Given the ID of a child, I need to return all siblings.
The obvious solution is to create a sub report that traverses the relationship up one level, and just pass that value as the linked value to the sub report filtered by parent records.
Anyone have any clever ideas that preclude the use of a sub report? (or SQL command, or stored procedure)
In the mean time, I'm using a sub report.
Thanks,
-R

I've come up with a not-so-great work around, that seems to solve my problem.
The additional part of my question is that I need to be able to do it from two sides of a bizzarely complecated three table relationship. A single sub report solution doesn't work. I was hoping for a more broadly applicable solution that didn't involve a sub report.
What I've done is created a sub report to pre-process my parameters. In my situation, the detail records that I am interested in actually have two different unrelated parent records.
So, if someone passes in a child record (other params would be null) then I get his parent record, and supress the rest.
If someone passes in either parent, the report uses a shared string variable to create a list of records NOT to supress. ie: a list of all records that the parent IS related to.
because my dataset is relatively small, and not likely to grow significantly, it doesn't present an issue to pull the whole data-set, and supress rather than filter, and because it's being presented in the HTML viewer, I don't have to worry about passing a bunch of data I don't need into the client cache. (not to mention that savvy hacker types can't get into the cached data that's present, but supressed)
Yet another ugly Crystal workaround by Ryan! Hoorah!

Similar Messages

  • Three select statement data in to One Internal table

    HI All,
          By using 3 select statement, data is displying by using work area (classical report). Now i want define three internal table for three select statements, and finally get the data in one final itab, and pass this to function module (ALV Report).
    looking for response

    hi,
    just go through this simple example. no need of declaring 3 itabs.
    data: begin of st1,
            a1 type c,
            a11 type i,
          end of st1.
    data: begin of st2,
            a2 type i,
            a22 type c,
          end of st2.
    data: begin of st3,
            a3 type i,
            a33 type i,
          end of st3.
    data: begin of fin_struct.
              include structure st1.
              include structure st2.
              include structure st3.
    data: end of fin_struct.
    data: fin_itab like table of fin_struct with header line.
    *1st structure  values
    move 'a' to fin_itab-a1.
    move 1 to fin_itab-a11.
    *2nd structure values
    move 11 to fin_itab-a2.
    move 'b' to fin_itab-a22.
    *3rd structure values
    move 15 to fin_itab-a3.
    move 12 to fin_itab-a33.
    *appending 1st record.
    append fin_itab.
    *1st strcuct values
    move 'b' to fin_itab-a1.
    move 3 to fin_itab-a11.
    *2nd structure values
    move 22 to fin_itab-a2.
    move 'c' to fin_itab-a22.
    *3rd structure values
    move 20 to fin_itab-a3.
    move 30 to fin_itab-a33.
    *appending 2nd record.
    append fin_itab.
    loop at fin_itab.
    write:/ fin_itab-a1, fin_itab-a11, fin_itab-a2, fin_itab-a22, fin_itab-a3, fin_itab-a33.
    endloop.
    here structre1,2,3...
    i used move statement.
    here u write select statement.. into struct1,2,3....
    using move u move all the values ...
    finally append it to final itab...
    rest of and all common for ALV...
    Regards,
    Shankar.

  • How to split the data based on one column

    Dear All,
    I have the table data like this.
    type quantity revenue_mny count country
    a 10           10          2 India
    a 20          12          3 India
    b 30          15          1 India
    a 35          20          2 US
    b 20          10          1 US
    b 60          15          1 US
    I woulkd like to split the date based on type column.
    For each country, for Type "a" get the sum of revenue count quanity ans same for b
    and all shuld come in on row for each country.
    output should be like
    country revenue_mny(For a) quantity(for a) count(For a) revenue_mny(for b) quantity(for b) count(For b)
    India 22 30 5 15 30 1
    US 20 35 2 25 80 2
    I tried the below query . its not splittng the date for each country in one row.
    select country,
    sum(case when type='a') then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='b' then quantity else 0 end) quantity_b from
    test
    group by country
    Please need your helo

    Like this?
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(case when type='a' then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='a' then cnt else 0 end) cnt_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b,
    sum(case when type='b' then quantity else 0 end) quantity_b ,
    sum(case when type='b' then cnt else 0 end) cnt_b
    from t
    group by country;result:
    COUNTRY  REVENUE_MNY_A QUANTITY_A CNT_A REVENUE_MNY_B QUANTITY_B CNT_B
    India    22            30         5     15            30         1
    US       20            35         2     25            80         2Or you can do it with a decode instead of case. The result will be the same:
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(decode(type,'a',revenue_mny,0)) revenue_mny_a,
    sum(decode(type,'a',quantity,0)) quantity_a,
    sum(decode(type,'a',cnt,0)) cnt_a,
    sum(decode(type,'b',revenue_mny,0)) revenue_mny_b,
    sum(decode(type,'b',quantity,0)) quantity_b,
    sum(decode(type,'b',cnt,0)) cnt_b
    from t
    group by country;(I changed tablename from TEST to T and columnname from COUNT to CNT, because you should not use reserved words as tablename or columnname.)
    Edited by: hm on 09.10.2012 06:17

  • Similar to VA01 Item Data ,based on one field selection,other fields get populated in Table control for Custom table. How Do I do that. Plz suggest

    I\
    Moderator message : Search for available information, discussion locked.
    Message was edited by: Vinod Kumar

    Hi,
    You need to create table events to do so.
    Refer blog
    http://wiki.sdn.sap.com/wiki/display/ABAP/TABLE+MAINTENANCE+GENERATOR+and+ITS+EVENTS

  • ALV - selecting the data based on layout set in selection screen

    Hi,
    I have an ALV report (Custom). I want to give layout selection at selection screen, so the user can create/select/manage layout at the time of selection screen and only these columns will be displayed in the final output. Instead user execute the report for all column and at the end user select the layout. I want this layout at the selection screen level like the standard reports.
    Thanks,

    You can do the following
    When the user clicks on download
    1.Use FM REUSE_ALV_LIST_LAYOUT_INFO_GET / REUSE_ALV_GRID_LAYOUT_INFO_GET to get the Fieldcat (since due to selection of layout on sel screen some columns are disabled. For the columns which have been disabled the resultant Fieldcat from the above FMs would have NO_OUT = 'X'. Delete columns from Fieldcat itab where no_out = 'X'
    2.create a dynamic itab using cl_alv_table_create=>create_dynamic_table( )  passing the above Fieldcat itab, get a handle of new itab
    3.loop over the original itab and fill the new dynamic itab
    hope this helps...

  • Selection of data based on condition

    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    Nothing remains, so locked.
    Rob
    Edited by: Rob Burbank on Mar 12, 2010 10:56 AM

    please pass teh specified portion of the code explaining in detail of the query ..
    please use teh code option to look it better
    this way
    Br,
    Vijay

  • Selecting missing date range with previous records value

    Hello,
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SET DEFINE OFF;
    create table t(NBR_OF_S number, NBR_OF_C number, S_DATE date);
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (34, 40, TO_DATE('05/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (27, 29, TO_DATE('03/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (21, 23, TO_DATE('12/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (19, 20, TO_DATE('10/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (18, 19, TO_DATE('09/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (17, 17, TO_DATE('08/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (16, 16, TO_DATE('06/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (9, 9, TO_DATE('12/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (5, 5, TO_DATE('11/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (2, 2, TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    SQL> select * from t order by 3 desc;
      NBR_OF_S   NBR_OF_C S_DATE
            34         40 01-MAY-12
            27         29 01-MAR-12
            21         23 01-DEC-11
            19         20 01-OCT-11
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-JAN-10
    10 rows selected.I want the output like as follows, all those missing date i need to carry on the last one's number
      NBR_OF_S   NBR_OF_C S_DATE
            34         40 01-MAY-12
            27         29 01-APR-12
            27         29 01-MAR-12
            21         23 01-FEB-12
            21         23 01-JAN-12
            21         23 01-DEC-11
            19         20 01-NOV-11
            19         20 01-OCT-11
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUL-11
            16         16 01-JUN-11
             9          9 01-MAY-11
             9          9 01-APR-11
             9          9 01-MAR-11
             9          9 01-FEB-11
             9          9 01-JAN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-OCT-10
             2          2 01-SEP-10
             2          2 01-AUG-10
             2          2 01-JUL-10
             2          2 01-JUN-10
             2          2 01-MAY-10
             2          2 01-APR-10
             2          2 01-MAR-10
             2          2 01-FEB-10
             2          2 01-JAN-10Any help would be greatly appreciate.
    Note: The date value I have created for this sample is monthly, based on the condition the data value I may need to generate weekly also. That's Monthly or weekly either one
    Thanks,

    And what is AMT? You didn't provide such column in your original post. Anyway, MODEL solution based on original post:
    select  nbr_of_s,
            nbr_of_c,
            s_date
      from  t
      model
        partition by(rowid)
        dimension by(1 d)
        measures(
                 nbr_of_s,
                 nbr_of_c,
                 s_date,
                 months_between(lag(s_date) over(order by s_date desc),s_date) cnt
        rules(
              nbr_of_s[for d from 1 to cnt[1] increment 1] = nbr_of_s[1],
              nbr_of_c[for d from 1 to cnt[1] increment 1] = nbr_of_c[1],
                s_date[for d from 1 to cnt[1] increment 1] = add_months(s_date[1],cv(d) - 1)
      order by s_date desc
      NBR_OF_S   NBR_OF_C S_DATE   
            34         40 01-MAY-12
            27         29 01-APR-12
            27         29 01-MAR-12
            21         23 01-FEB-12
            21         23 01-JAN-12
            21         23 01-DEC-11
            19         20 01-NOV-11
            19         20 01-OCT-11
      NBR_OF_S   NBR_OF_C S_DATE   
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUL-11
            16         16 01-JUN-11
             9          9 01-MAY-11
             9          9 01-APR-11
             9          9 01-MAR-11
             9          9 01-FEB-11
      NBR_OF_S   NBR_OF_C S_DATE   
             9          9 01-JAN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-OCT-10
             2          2 01-SEP-10
             2          2 01-AUG-10
             2          2 01-JUL-10
             2          2 01-JUN-10
      NBR_OF_S   NBR_OF_C S_DATE   
             2          2 01-MAY-10
             2          2 01-APR-10
             2          2 01-MAR-10
             2          2 01-FEB-10
             2          2 01-JAN-10
    29 rows selected.
    SQL> SY.
    Edited by: Solomon Yakobson on Jun 11, 2012 1:34 PM

  • Select in (select ...) (select main report based on child records)

    I have a Crystal Report XI rel 2 report but I need to narrow the search of the main report based on records in the child table.<br /><br />I have 3-tables and one report w/ a subreport.<br />The tables are locations, crashes, and vehicles.  The main report has the tables locations and crashes and the subreport has vehicles (one crash has 1 to n vehicles)<br /><br />How do I select records in the main report based on the child (see below SQL stmt.)<br />SELECT locations.county, locations.state, crashes.numpeople, crashes.time FROM locations,crashes<br />WHERE crashes.cid IN (SELECT cid FROM vehicles WHERE vehicles.vehicletype = &#39;Trailer&#39;);<br />

    Hi,
    Â You can use common shared variables to share data between a sub report and the main report.
    What Kathryn has suggested is correct but you must make sure that the sub report is run first and then the main report is executed.
    Â Hope this helps
    Â Cheers
    Â Sam

  • How to optimize query that returns data based on one matching and one missing field joining two tables

    Hi all,
    Here is what I am trying to do. I have 2 tables A and B. Both have a fiscal year and a school ID column. I want to return all data from table B where all school IDs match but fiscal year from A is not in B. I wrote 2 queries below but this took
    2 minutes each to process through 30,000 records in table B. Need to optmize this query.
    1) select 1 from table A inner join table B
    on A.SchoolID=B.SchoolID where A.Year not in (select distinct Year from table B)
    2) select distinct Year from Table A where School ID in (select distinct School ID from table B
    and Year not in (select distinct Year from table B)

    Faraz81,
    query execution time will depend not only on your data volume and structure but also on your system resources.
    You should post your execution plans and DDL to generate data structures so we can take a better look, but one think you could try right away is to store the results of the subquery in a table variable and use it instead.
    You'll also benefit from the creation of:
    1. An index for the B.SchoolID column.
    2. Statistics for the Year column in table B.
    You can also try to change the physical algorithm used to join A to B by using query hints (HASH, MERGE, LOOP) and see how they perform. For example:
    select 1 from table A inner HASH join table B
    on A.SchoolID=B.SchoolID where A.Year not in (select distinct Year from table B)
    As the query optimizer generally chooses the best plan, this might not be a good idea though, but then again, without further information its going to be hard to help you.

  • How to achieve grouping of data based on one column

    Hello PL/SQL Gurus/experts,
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
    I have following table -
    DROP TABLE T2;
    create table T2(Manager,Employee) as select
    'Nikki','Ram' from dual union all select
    'Nina', 'Rita' from DUAL union all select
    'Mike', 'Radha' from dual union all select
    'Michael', 'Ratnam' from DUAL union all select
    'Hendi', 'Ratna' from dual union all select
    'Robert', 'Raman' from dual union all select
    'Maria', 'Rolly' from dual union all select
    'Kistrien', 'Rachna' from dual union all select
    'Andrew', 'Ritvik' from dual union all select
    'Emma', 'Ramesh' from dual union all select
    'Andy', 'Ranpal' from dual union all select
    'Brandy', 'Raunak' from dual union all select
    'Nikki','Shyam' from dual union all select
    'Nina', 'Sita' from DUAL union all select
    'Mike', 'Sadhna' from dual union all select
    'Michael', 'Satnam' from DUAL union all select
    'Hendi', 'Satna' from dual union all select
    'Robert', 'Samar' from dual union all select
    'Maria', 'Sameer' from dual union all select
    'Kistrien', 'Samrachna' from dual union all select
    'Andrew', 'Satvik' from dual union all select
    'Emma', 'Somesh' from dual union all select
    'Andy', 'Sonpal' from dual union all select
    'Brandy', 'Samar' from dual union all select
    'Emma', 'Piyush' from dual union all select
    'Andy', 'Pavan' from dual union all select
    'Brandy', 'Paramjeet' from dual;Expected output -
    Manager          Employee
    Nikki
              Ram
              Shyam
    Nina           Rita
              Sita
    Mike           Radha
              Sadhna
    Michael      Ratnam
              Satnam
    Hendi           Ratna
              Satna
    Robert          Raman
              Samar
    Maria          Rolly
              Sameer
    Kistrien     Rachna
              Samrachna
    Andrew          Ritvik
              Satvik
    Emma          Ramesh
              Somesh
              Piyush
    Andy          Ranpal
              Sonpal
              Pavan
    Brandy          Raunak
              Samar
              ParamjeetI thank to all of you in advance for your valuable time and inputs

    In SQL, something like this...
    SQL> ed
    Wrote file afiedt.buf
      1  select case when row_number() over (partition by emp.manager order by employee) = 1 then
      2           mgr.manager
      3         else
      4           null
      5         end as manager
      6        ,emp.employee
      7  from (select distinct manager from t2) mgr
      8       join t2 emp on (mgr.manager = emp.manager)
      9* order by mgr.manager, emp.employee
    SQL> /
    MANAGER  EMPLOYEE
    Andrew   Ritvik
             Satvik
    Andy     Pavan
             Ranpal
             Sonpal
    Brandy   Paramjeet
             Raunak
             Samar
    Emma     Piyush
             Ramesh
             Somesh
    Hendi    Ratna
             Satna
    Kistrien Rachna
             Samrachna
    Maria    Rolly
             Sameer
    Michael  Ratnam
             Satnam
    Mike     Radha
             Sadhna
    Nikki    Ram
             Shyam
    Nina     Rita
             Sita
    Robert   Raman
             Samar
    27 rows selected.If you want the managers on their own row with the employees underneath then you'll have to fudge it.
    SQL> ed
    Wrote file afiedt.buf
      1  select case when row_number() over (partition by emp.manager order by employee nulls first) = 1 then
      2           mgr.manager
      3         else
      4           null
      5         end as manager
      6        ,emp.employee
      7  from (select distinct manager from t2) mgr
      8       join
      9       (select distinct manager, null as employee from t2
    10        union all
    11        select manager, employee from t2
    12       ) emp on (mgr.manager = emp.manager)
    13* order by mgr.manager, emp.employee nulls first
    SQL> /
    MANAGER  EMPLOYEE
    Andrew
             Ritvik
             Satvik
    Andy
             Pavan
             Ranpal
             Sonpal
    Brandy
             Paramjeet
             Raunak
             Samar
    Emma
             Piyush
             Ramesh
             Somesh
    Hendi
             Ratna
             Satna
    Kistrien
             Rachna
             Samrachna
    Maria
             Rolly
             Sameer
    Michael
             Ratnam
             Satnam
    Mike
             Radha
             Sadhna
    Nikki
             Ram
             Shyam
    Nina
             Rita
             Sita
    Robert
             Raman
             Samar
    39 rows selected.

  • Slow Loading data from DB, one record at a time, HOW?

    I am currently doing a project....
    I need to display a record of data on a "form"(JFrame)
    the way i handle it is
    1. Load first record
    2. pass to the display object
    3. display object -> on click next, call manager object to process the request
    4. manager, get next record with the help of DBManager
    5. manager, set the record into the display object
    6. manager, command object to refresh screen...
    manager contains DBManager and disply instance....
    it work perfectly fine for the first 20 or so record, but after some time, every click is slowed down about 20 over times...
    i.e. first record take .5 sec, 50th take 30 sec
    I traced the memory usage it is ok... but what could the problem be???
    Memory usage list...
    Before total:2031616 Free:810728
    Before total:2031616 Free:1055016
    Before total:2031616 Free:784272
    Before total:2031616 Free:1049648
    Before total:2031616 Free:821464
    Before total:2031616 Free:1091312
    Before total:2031616 Free:832568
    Before total:2031616 Free:1057192
    Before total:2031616 Free:793864
    Before total:2031616 Free:1009872
    Before total:2031616 Free:736552
    Before total:2031616 Free:1000048
    Before total:2031616 Free:776496
    Before total:2031616 Free:563400
    Before total:2031616 Free:834264
    Before total:2031616 Free:600392
    Before total:2031616 Free:883232
    Before total:2031616 Free:637144
    Before total:2031616 Free:877344
    Before total:2031616 Free:625808
    Before total:2031616 Free:876032
    Before total:2031616 Free:603856
    Before total:2031616 Free:440688
    Before total:2031616 Free:681816
    Before total:2031616 Free:431080
    Before total:2031616 Free:714832
    Before total:2031616 Free:465848
    Before total:2031616 Free:790152
    Before total:2031616 Free:613168
    Before total:2031616 Free:364024
    Before total:2031616 Free:677752
    Before total:2031616 Free:421064
    Before total:2031616 Free:716144
    Before total:2031616 Free:541320
    Before total:2031616 Free:372024
    Before total:2031616 Free:595424
    Before total:2031616 Free:425288
    Before total:2031616 Free:250016
    Before total:2031616 Free:576584
    Before total:2031616 Free:405744
    Before total:2031616 Free:225440
    Before total:2031616 Free:546728
    Before total:2031616 Free:370240
    Before total:2031616 Free:204136
    Before total:2031616 Free:540816
    Before total:2031616 Free:367384
    Before total:2031616 Free:196400

    Hey,
    I was wondering about a compelling reason, why you want to go back to the database on every click. I would fetch "X" rows at a time from the Database and cache them as Value Objects. X could be 10 or even 100. It depends on your requirements.
    As far as the performance going down there could be lot of reasons. Do you open and close the connection on every click. How many connections are open at a time? do you close the connection? or the connection is alive?
    Chidda

  • JNDI : connection problem while storing data more than one records

    I am persisting data into the MSSQL Server 2005 database using the JNDI lookup. I can insert the single record at a time, but when I ran the test program for 10 or 20 records i am getting the following exception on Jboss
    Configuration details : JBoss, Spring, MSSQL server 2005, Jdk 5
    JNDI mapping from JBOSS
    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
    <local-tx-datasource>
    <jndi-name>jdbc/myjndi</jndi-name>
    <!-- allows DS to be accessed remotely -->
    <use-java-context>false</use-java-context>
         <connection-url>jdbc:inetdae7:localhost:1434?database=myDB&secureLevel=0</connection-url>
         <driver-class>com.inet.tds.TdsDriver</driver-class>
         <user-name>sa</user-name>
         <password>admin123</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>50</max-pool-size>
    <metadata>
         <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    </local-tx-datasource>
    </datasources>
    Exception :
    14:07:06,812 INFO [myMDB] Exception while Storing Event in Database : Could not get JDBC Connection; nested exception is org.jboss.util.Neste
    dSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset); - neste
    d throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.S
    ocketException: Connection reset))
    14:07:06,812 INFO [STDOUT] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava
    .net.SocketException: Connection reset); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (co
    m.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset))
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
    14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
    14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:177)
    14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:356)
    14:07:06,812 INFO [STDOUT] at com.org.project.gen.MyDAOImpl.insert(MyDAOImpl.java:25)
    14:07:06,812 INFO [STDOUT] at com.org.project.geo.MyTabletDAO.addEvent(MyTabletDAO.java:137)
    14:07:06,812 INFO [STDOUT] at com.org.project.mdb.myMDB.onMessage(myMDB.java:72)
    14:07:06,812 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
    14:07:06,812 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    14:07:06,812 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
    14:07:06,812 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
    14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
    14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._run(TibjmsSession.java:3054)
    14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession.run(TibjmsSession.java:4204)
    14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
    14:07:06,812 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
    14:07:06,812 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
    14:07:06,812 INFO [STDOUT] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.
    SocketExceptionjava.net.SocketException: Connection reset)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
    java:161)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnection
    Pool.java:508)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManage
    r2.java:874)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
    14:07:06,812 INFO [STDOUT] ... 33 more
    14:07:06,812 INFO [STDOUT] Caused by: com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset
    14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createSQLException(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.<init>(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.q.<init>(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createConnection(Unknown Source)
    14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsDriver.connect(Unknown Source)
    14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
    java:151)
    14:07:06,812 INFO [STDOUT] ... 41 more

    Hi Subin,
    You can try couple of things.
    If your data is less than 32767, you can pass it to stored procedure and change it to clob type like
    PROCEDURE CLOBQUERY
         Param     IN     CLOB,
    and you can call Procedure
    EXECUTE CLOBQUERY '[Param.1]'
    If your data is around than 1000000(32767*32), you can break the data in length of 32767 and pass it to param 1 to 32 like
    EXECUTE CLOBQUERY '[Param.1][Param.2][Param.3]..[Param.32]'
    Finally you can try to update jdbc drive.
    check the link Link: [JDBC Limitation|http://confluence.atlassian.com/display/JIRA/UsingOracle10gdriverstosolvethe4000character+limitation]

  • Formula to pull data out of one record

    Post Author: ralph.devlin
    CA Forum: Formula
    I am looking at writing a formula that would read one numeric field and then look for that number in a different field in the database and when it finds it, it would then read another field and return that back to the report, IE WO_NUM is read and it is looking for that number in PARENTWOID once it finds it, it returns the RESPONS field of that record. Also there may be multiple records with the same number in the PARENTWOID field. I will need to retrieve all of them that exist, so I was thinking a loop may need to be entered as well to keep doing it until it has found all of them, etc and then return them to the report, I may also need some formating added so they are spaced out evenly, etc.
    thanks
    Ralph

    Post Author: ralph.devlin
    CA Forum: Formula
    Thanks, since we may multiple matches, does a "loop" statement need to be added?
    I just tried that statement but it says I need to enter a number range with my second field after the IN statement

  • Select Functional Location based on Class

    Hi,
    In a query, I need to select the functional locations (TPLNR) based on class (KLASSE_D) and Functional Location Category(FLTYP) which are defaulted on the selection screen. FLTYP = 'G' and LKASSE_D = 'GT_RETOB'  are the values always defaulted on the selection screen.
    I was hoping to select the data from table IFLOT based on FLTYP and filter it by class later. In PROD system, we have about  7 million records in IFLOT where FLTYP = 'G'.
    Can anybody know a better way to select the data based on these 2 conditions?
    Thanks.

    Hi,
    Normally the way I check for tables is as below,
    Go to the screen or transaction to know the tables then on top menu System select option status
    2. You will get pop-up, select Program screen double click, it will open ABAP editor,
    3. Here on Menu utlities select Display Object List or (CtrlShiftF5) will take you to another screen where on left you can see menu for all the Function modules, Dictionary structures etc. Normally we can find related tables from Dictionary structures.
    For getting exact tables it is always trial and error method. Pass some available data and check what are the required fields how to get dependent entries etc.
    Hope it help's.
    Regards,
    N.Nagaraju
    Edited by: NAGARAJU NANDIPATI on Jan 28, 2011 10:35 AM

  • How to pick the data based on customer number

    Hi All ,
    greets....
    i have a requirement to select  the data based on customer number and then do furthur processing .
    example:
    this is some 10 dcouments in customer nr:v1000
    and 20 documents in customer v2000 in a internal table how to select that,
    thank s in advance.

    thier is an internal table which is having some 1000records.
    and their is 6 customers.
    in which i should pick the data based on customer number.
    how to write a code for that?

Maybe you are looking for

  • Using security-constraint in web.xml; not recognizing url-pattern tag

    I am creating a very simple jsp application within JDeveloper 10.1.3.1. I have 2 jsp files...a readData.jsp and a maintainData.jsp. I would like to deploy this application to Oracle Application Server 10.1.2.2. I would like to use Oracle Internet Dir

  • Data socket port

    I want to serve data sockets over the internet. I can get them to work over our local network (all the computers are 192.168.1.100, etc), but they're not working beyond our local network. Do I need to forward port requests on our router to enable thi

  • [SOLVED] Can't connect to internet after installation

    Hello, I just installed Arch, and during the installation I connected to wifi (obviously, since I had to download the packages) with iwconfig and all the other tools on the installer, but after the installation I wasn't connected any more. I have no

  • Th3800 download program to file

    The drivers for the th3800 has a function called TH3800 Load Program From File.vi. Is there a way to download one of these files from a program already in the memory of one of these chambers? If not, would anyone have any example files. The help sect

  • Cannot read new disk

    I recently bought software from the Apple store. When I insert the installation disc, my disc drive immediately ejects it. I thought maybe it was the disc itself, so I tried it on my Macbook Pro. It worked perfectly fine. How can I correct this probl