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

Similar Messages

  • Best Practices for pulling data out of Documentum (w/Crystal and Universe)

    I was curious to see if we had any best practices to see if we can pull data out of Documentum.
    Thanks
    Ian S

    None, use what works.

  • Trouble pulling data out of a table

    Ok having problem pulling infromation from a table
    We are trying to add the amount of discount to our line items on our quote (which is a smartform)
    I tried using both sets of code but I can't seem to pull any data from table KONV
    first i tried this
    SELECT SINGLE KNUMV FROM VBAK INTO L_KNUMV WHERE VBELN = is_vbdka-vbeln.
    SELECT * FROM KONV INTO TABLE IT_KONV WHERE KNUMV  =  L_KNUMV AND KPOSN  =  wa_vbdpa-posnr.
    LOOP AT IT_KONV INTO WA_KONV WHERE KWERT NE 0.
    IF WA_KONV-KSCHL = 'ZK04'.
      m_disc =  ( WA_KONV-KWERT * -1 ).
    ENDIF.
    IF WA_KONV-KSCHL = 'ZK07'.
      c_disc = WA_KONV-KWERT.
    ENDIF.
    ENDLOOP.
    item_discount = m_disc + c_disc.
    I get a value for L_KNUMV and KPOSN but it never enters the loop so I thought I'd try to pull it directly with
    SELECT SINGLE KNUMV FROM VBAK INTO L_KNUMV WHERE VBELN = is_vbdka-vbeln.
    select single * from konv into wa_mkonv where knumv = l_knumv and kposn = wa_vbdpa-posnr and kschl = 'zk04'.
    m_disc =  ( wa_mkonv-kwert * -1 ).
    select single * from konv into wa_ckonv where knumv = l_knumv and kposn = wa_vbdpa-posnr and kschl = 'zk07'.
    c_disc = ( wa_ckonv-kwert * -1 ).
    item_disc = m_disc + c_disc.
    But still didn't get any data from KONV
    Is my code wrong or am I trying to pull data from the wrong area.  If i go into table se16  and I place the values in for KNUMV and the KPOSN and can see the information for KONV-KWERT but my smartform isn't pulling it in.

    Israel Edmiston wrote:
    Ok having problem pulling infromation from a table
    >
    > We are trying to add the amount of discount to our line items on our quote (which is a smartform)
    >
    > I tried using both sets of code but I can't seem to pull any data from table KONV
    >
    > first i tried this
    >
    > SELECT SINGLE KNUMV FROM VBAK INTO L_KNUMV WHERE VBELN = is_vbdka-vbeln.
    >
    > SELECT * FROM KONV INTO TABLE IT_KONV WHERE KNUMV  =  L_KNUMV AND KPOSN  =  wa_vbdpa-posnr.
    >
    In Debug Mode check if IT_KONV tab is filled.....
    > LOOP AT IT_KONV INTO WA_KONV WHERE KWERT NE 0.
    >
    > IF WA_KONV-KSCHL = 'ZK04'.
    >   m_disc =  ( WA_KONV-KWERT * -1 ).
    > ENDIF.
    >
    > IF WA_KONV-KSCHL = 'ZK07'.
    >   c_disc = WA_KONV-KWERT.
    > ENDIF.
    >
    > ENDLOOP.
    >
    > item_discount = m_disc + c_disc.
    >
    > I get a value for L_KNUMV and KPOSN but it never enters the loop so I thought I'd try to pull it directly with
    >
    > SELECT SINGLE KNUMV FROM VBAK INTO L_KNUMV WHERE VBELN = is_vbdka-vbeln.
    >
    > select single * from konv into wa_mkonv where knumv = l_knumv and kposn = wa_vbdpa-posnr and kschl = 'zk04'.->
    'ZK04'
    >
    > m_disc =  ( wa_mkonv-kwert * -1 ).
    >
    > select single * from konv into wa_ckonv where knumv = l_knumv and kposn = wa_vbdpa-posnr and kschl = 'zk07' ->
    *'ZK07'*
    >
    > c_disc = ( wa_ckonv-kwert * -1 ).
    >
    > item_disc = m_disc + c_disc.
    >
    >
    > But still didn't get any data from KONV
    >
    > Is my code wrong or am I trying to pull data from the wrong area.  If i go into table se16  and I place the values in for KNUMV and the KPOSN and can see the information for KONV-KWERT but my smartform isn't pulling it in.

  • 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!

  • How to pull data out of a text field?

    How could I accomplish the following.?
    Current data in the column.
    PREOPERATIVE DIAGNOSES:   1.  Right shoulder rotator cuff tear.   2.  Right shoulder biceps tendon disease with superior labral tearing.      POSTOPERATIVE DIAGNOSES:   1.  Right shoulder rotator cuff tear.   2.  Right shoulder biceps tendon disease with superior labral tearing.      SURGEON:  Jane, Doe, MD      ASSISTANT:  Jane, Doe, PA-C and Bob, Doe MD, orthopedic resident.  The assistance of a physician's assistant was required for limb positioning and placement of anchors.      ANESTHETIC: Interscalene block plus general.      DRAINS:  None.      COUNTS: Sponge and needle count were correct.      MATERIAL FORWARDED TO THE LABORATORY:  None.      OPERATION PERFORMED:   1.  Right shoulder arthroscopic rotator cuff tear.   2.  Right shoulder open subpectoral biceps tenodesis.   3.  Right shoulder subacromial decompression with acromioplasty.   4.  Right shoulder extensive glenohumeral debridement.   
    I would like the following in MS Excel.  I would like to pull the header out into a separate column.
    Header
    NOTE_TEXT
    PREOPERATIVE DIAGNOSES: 
    1.  Right shoulder rotator cuff tear.  2.  Right shoulder biceps tendon disease with superior labral tearing. 
    POSTOPERATIVE DIAGNOSES:
    1.  Right shoulder rotator cuff tear.  2.  Right shoulder biceps tendon disease with superior labral tearing. 

    The entire field of data is below.  I highlighted the header in Red where the data stopped being accurate.
    5/7/2014
    LINE
    Split_Text
    1
    PREOPERATIVE DIAGNOSES:   1.  Right shoulder rotator cuff tear.   2.  Right shoulder biceps tendon disease with superior labral tearing.      POSTOPERATIVE DIAGNOSES:   1.  Right shoulder rotator cuff tear.   2.  Right shoulder biceps tendon disease with superior labral tearing.      SURGEON:  Bob, Doe  MD      ASSISTANT:  Jane, Doe  PA‑C and Jane, Doe , MD, orthopedic resident.  The assistance of a physician's assistant was required for limb positioning and placement of anchors.      ANESTHETIC:  Interscalene block plus general.      DRAINS:  None.      COUNTS:  Sponge and needle count were correct.      MATERIAL FORWARDED TO THE LABORATORY:  None.      OPERATION PERFORMED:   1.  Right shoulder arthroscopic rotator cuff tear.   2.  Right shoulder open subpectoral biceps tenodesis.   3.  Right shoulder subacromial decompression with acromioplasty.   4.  Right shoulder extensive glenohumeral debridement.      INDICATIONS:  Mr.XXXXX is a 71‑year‑old male with symptomatic right shoulder rotator cuff tear and degenerative tearing of his labrum and biceps tendon symptoms.  His AC joint is asymptomatic.  I had a long conversation with Bob regarding options.  We discussed nonoperative and operative options.  He would like to proceed with surgical intervention.  I explained the risks and this is well documented in my Clinic note.  On the day of surgery, I met with Bob Doe and his wife.  I reviewed the procedure and answered their questions.  They understand and agree to proceed.      OPERATIVE FINDINGS:  Reveal symmetrical range of motion.  The diagnostic arthroscopy reveals degenerative tearing of the anterior superior and posterior superior labrum.  There was thickening of the biceps tendon.  Minimal fibrillation of the superior subscapularis.  The subscapularis is intact.  There was high grade partial‑thickness tearing of the entire
    2
    supraspinatus and anterior infraspinatus.  The more posterior rotator cuff was normal.  There is chondral thinning of the articular cartilage of the humeral head and glenoid, but no significant chondral loss.  Within the subacromial space was a significant anterior spur off the acromion.      IMPLANTS:  Arthrex 4.5 mm PEEK corkscrew anchor x2, Arthrex 4.75 mm BioComposite SwiveLock x2.      DESCRIPTION OF PROCEDURE:  After in ["V12.72","V13.89","V10.05"] was counseled and plans, alternatives and risks were discussed, consent was obtained.  The correct operative extremity was marked in the preoperative holding area and preoperative antibiotics were administered.  An interscalene block anesthetic was administered without difficulty.  The patient was brought back to the operating suite and administered a general anesthetic.  The examination under anesthesia was performed and the findings are noted above.  The patient was placed in the beach chair position with bony prominences well padded.  The right upper extremity was prepped and draped in the usual sterile fashion.  A timeout process was completed.  A standard posterior arthroscopy portal was created followed by an anterior portal for the working instruments.  A thorough diagnostic arthroscopy was undertaken and the findings are noted above.  Attention was now turned to the extensive glenohumeral debridement.  The motorized resector was used to debride the frayed labrum anteriorly, superiorly and posteriorly.  The biceps tendon was transected.  The stump of the biceps tendon was debrided back to a stable margin.  The arthroscopic instruments were removed.      A 3‑4 cm incision was made in the mid axillary fold.  Hemostasis was obtained with electrocautery.  Dissection was carried down to the pectoralis major fascia, which was opened bluntly, exposing the underlying bicipital groove.  The long head of the biceps tendon was retrieved.  A #2
    3
    FiberWire was placed in the tendon 2 cm away from the musculotendinous junction.  A Cobb was used to remove soft tissue from the bicipital groove.  A 7 mm unicortical socket was placed in the shaft of the humerus.  The long head of the biceps tendon was placed within this socket and held in position with a 6.25 mm BioComposite SwiveLock achieving excellent purchase.  The sutures from the tendon and implant were tied together.      The arthroscope was reinserted into the subacromial space.  A standard lateral portal was created.  A thorough bursectomy was undertaken.  Motorized resector was now used to debride and freshen the end of the torn rotator cuff.  A combination of a motorized resector and ring curet were used to abrade the greater tuberosity.  A second lateral portal was created.  A 4.5 mm PEEK corkscrew anchor was placed in the posterior aspect of the tear 5 mm away from the articular cartilage.  All 4 of these sutures were brought up through the rotator cuff in a mattress fashion.  A second anchor was now placed in the anterior aspect of the cuff tear.  One set of sutures was brought through the cuff in a mattress fashion and the far anterior set was brought to the far anterior aspect of the supraspinatus tear as a simple suture construct.  This knot was tied.  The remaining sutures were tied as mattress sutures.  One limb of suture from each set was then positioned into a 4.75 mm BioComposite SwiveLock and impacted 1 cm lateral to the greater tuberosity creating an excellent double‑row suture bridge equivalent repair.  This was repeated with a second BioComposite SwiveLock and the remaining 3 sutures more anteriorly.  The tear was then inspected.  Range of motion revealed no gapping.      Attention was now turned to the acromioplasty.  The CA ligament was recessed off the anterior acromion with the radiofrequency device.  A bur was then used to flatten the anterior acromion.  Bone was removed until
    1
    5/7/2014
    PAT_NAME
    LINE
    Split_Text
    DAMROW,NEIL ARTHUR
    4
    the acromion was flat from posterior to anterior.  Bony debris was then removed and the subacromial space was copiously lavaged.  The arthroscopic instruments were removed.  Portal sites were closed with nylon.  The anterior incision was closed with 2‑0 Vicryl and Monocryl.  Sterile dressing was applied followed by a shoulder immobilizer.  The patient was extubated on the operating table and taken to the recovery room in good condition.  He tolerated the procedure well and there were no complications.  Estimated blood loss was minimal.      DISPOSITION:  The patient will be discharged home through Same Day Surgery per protocol.  He may remove his dressing on postoperative day #3 and shower and redressing incisions with Band‑Aids and gauze.  He will wear a sling for 6 weeks.  He may start some very gentle closed chain range of motion exercises in the next 7‑10 days with physical therapy at the Clinic.  The patient will follow up with me on postoperative day #12 at  for suture removal.  He was given oxycodone, MS Contin and Vistaril for postoperative pain.  He may have a refill of oxycodone or Vicodin in the first month postoperatively.         Jane,Doe, MD             D: 08/09/2013 12:51   T: 08/09/2013 13:37   MT: ag      Name:     DAMROW, NEIL   MRN:      0000‑00‑00‑00        Account:        0   DOB:      07/01/1942           Procedure Date: 08/09/2013      Document: E4204056
    2

  • ListView Control - How Take Data Out of One ListView Control and Put It Into Another ListView Control Please Help

    Public Class Form1
    'Also Let Me Note - I will actually only want to move an item from lvOriginalList if the PersonAge is (lets say) '21
        'I have a ListView named
        ' lvOriginalList
        'It has the Following Columns
        ' IDNumber
        ' PersonName
        ' PersonAge
        'I have a Second ListView named
        ' lvRemovedList
        'It has the Following Columns
        ' IDNumber
        ' PersonName
        ' PersonAge
        'What I am attempting to do is read a row out of the first listview
        'Compare the IDNUmber, PersonName and PersonAge from out of it (lvOriginalList)
        'And If the Information is not present in the second ListView (lvRemoved) then Move it to it
        'And then Remove that Row from the First one (lvOriginalList)
        'What I have tried:
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'Populate lvOriginalList with Test Data
            Dim FileNum As Integer = FreeFile()
            Dim lvOriginalListCounter As Integer = 0
            FileOpen(FileNum, "d:\testdata\alphadata.txt", OpenMode.Input)
            lvOriginalList.Items.Clear()
            Do While Not EOF(FileNum)
                Dim OriginalIDNumber As String = ""
                Dim OriginalPersonName As String = ""
                Dim OriginalPersonAge As String = ""
                OriginalIDNumber = LineInput(FileNum)
                OriginalPersonName = LineInput(FileNum)
                OriginalPersonAge = LineInput(FileNum) 
                lvOriginalList.Items.Add(OriginalIDNumber, lvOriginalListCounter)
                lvOriginalList.Items(lvOriginalListCounter).SubItems.Add(OriginalPersonName)
                lvOriginalList.Items(lvOriginalListCounter).SubItems.Add(OriginalPersonAge) 
                lvOriginalListCounter = lvOriginalListCounter + 1
            Loop
            FileClose(FileNum)
        End Sub
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim OriginalIDNumber As String = ""
            Dim OriginalPersonName As String = ""
            Dim OriginalPersonAge As String = ""
            Dim CompareIDNumber As String = ""
            Dim ComparePersonName As String = ""
            Dim ComparePersonAge As String = ""
            Dim NumlvRemovedListItems As Integer = 0
            Dim CompareCounter As Integer = 0
            For Each item As ListViewItem In Me.lvOriginalList.Items
                '1  -   Get A Row Out of lvOriginalList
                OriginalIDNumber = item.Text
                OriginalPersonName = item.SubItems.Item(1).Text
                OriginalPersonAge = item.SubItems.Item(2).Text
                '2  -   Check To See If That Person Is Already  in lvRemovedList
                'Have to check to see if the lvRemovedList list Box is Empty
                NumlvRemovedListItems = lvRemovedList.Items.Count
                If NumlvRemovedListItems = 0 Then
                    'the lvRemovedList listbox is empty
                    'so add That Person as the first entry into the list box (lvRemovedList)
                    lvRemovedList.Items.Add(OriginalIDNumber, NumlvRemovedListItems)
                    lvRemovedList.Items(NumlvRemovedListItems).SubItems.Add(OriginalPersonName)
                    lvRemovedList.Items(NumlvRemovedListItems).SubItems.Add(OriginalPersonAge)
                    'then remove the player from the lvPlayerList listbox
                    item.Remove()
                Else
                    For Each itemb As ListViewItem In Me.lvRemovedList.Items
                        CompareIDNumber = item.Text
                        ComparePersonName = item.SubItems.Item(1).Text
                        ComparePersonAge = item.SubItems.Item(2).Text
                        If OriginalPersonName = ComparePersonName Then
                            'do nothing that persons name is already in the lvRemovedList list
                        Else
                            'do this because the player is not already in a matchin the lvRemovedList list
                            lvRemovedList.Items.Add(CompareIDNumber, CompareCounter)
                            lvRemovedList.Items(CompareCounter).SubItems.Add(ComparePersonName)
                            lvRemovedList.Items(CompareCounter).SubItems.Add(ComparePersonAge)
                        End If
                    Next
                End If
                CompareCounter = CompareCounter + 1
            Next
        End Sub
    End Class
    'So what Am I doing Wrong
    'It is only Removing the First entry out of lvOriginalList (but at least the remaining data is still there and the empty Row is removed)
    'And only That first Entry is Appearing in lvRemovedList
    'Please Help

    Hello,
    I have created a simple sample, you could focus on the button click event and edit it to fit your requirements by yourself.
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    With ListView1
    .View = View.Details
    With .Columns
    .Add("IDNumber")
    .Add("PersonName")
    .Add("PersonAge")
    End With
    With .Items
    For index = 20 To 33
    .Add("ID" & index, index - 19)
    With ListView1.Items(.Count - 1).SubItems
    .Add("Name" & index)
    .Add(index)
    End With
    Next
    End With
    End With
    With ListView2
    .View = View.Details
    With .Columns
    .Add("IDNumber")
    .Add("PersonName")
    .Add("PersonAge")
    End With
    With .Items
    For index = 21 To 22
    .Add("ID" & index, index - 19)
    With ListView2.Items(.Count - 1).SubItems
    .Add("Name" & index)
    .Add(index)
    End With
    Next
    End With
    End With
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    For Each item As ListViewItem In ListView1.Items
    If CInt(item.SubItems(2).Text) < 29 Then
    item.Remove()
    Dim blContain As Boolean = False
    For Each item2 In ListView2.Items
    If item2.Text.ToString().Equals(item.Text.ToString()) Then
    blContain = True
    'Exit For
    End If
    Next
    If Not blContain Then
    ListView2.Items.Add(item)
    End If
    End If
    Next
    End Sub
    End Class
    Result.
    Regards,
    Carl
    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.

  • 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

  • Pulling data out of an xml document

    i'm sure many of you have had this problem before but i haven't been able to come up with a solution yet. here is the problem:
    i am recieving
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one node
    ORA-06512: at line 35
    when attempting to use extractvalue because of multiple instances of the same element.
    i can build the extractvalue string dynamically but i first need the number of nodes that exist. the xml is in a queue. i tried using the following to get the count but it's not working properly:
    SELECT COUNT(*) into lCount
    FROM AQ$WS_Q_TABLE a
    WHERE existsNode(xmltype(a.USER_DATA.ECMPS_FILE),'/MonitoringPlan/MonitoringLocationData/UnitData/UnitFuelData/UnitFuelIDKey') = 1
    and a.MSG_ID = '0861C8ADB0CC018DE040A8C0492A37CB';
    it always returns 1.
    i'm obviously not constructing the sql properly.
    any ideas?
    thanks for any help.

    right but in order to get all the nodes loaded. i need to find out how many nodes there are.
    that's what i'm trying to do with the query i posted but it always returns 1 and i'm not sure why.

  • 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]

  • SQL query requested to pull one field out of multiple records

    Post Author: ralph.devlin
    CA Forum: Data Connectivity and SQL
    We use Track IT to manage our ticket base. We have parent work orders and child assignments that I am trying to report on. What I want to do is create a view, or even if this can be done in a formula, is pull data from the main work order, which in our scnerio and accorindg to the database diagrapm is WORKORDERTYPEID = 0, It will pull the TASKS.RESPONS field from that WO. Then it will compare the TASKS.PARETNWOID to WOID and if WORKORDERTYPEID = 1 then it needs to return the TASKS/RESPONS field of that record, and there may be three records or so. Then What I may need it to do is organize it maybe into seperate columns so I can add each one to Crystal keeping in mind that it will need to link those records to main WOID of the parent so it will display on one line. Any ideas
    Ralph

    Post Author: ralph.devlin
    CA Forum: Data Connectivity and SQL
    Ok I tried that and it seemed to work fine, here is an aexample of the data returned
    168458
    Lane, Carrie
    Ralph Devlin
    Ralph Devlin
    168458
    PHX - Training Room
    SM - 8th Fl Conf Room
    NULL
    NULL
    168458
    6/20/2008 3:30:00 PM
    Video Conference
    0
    168458
    Lane, Carrie
    Ralph Devlin
    Luis Estrada
    168458
    PHX - Training Room
    SM - 8th Fl Conf Room
    NULL
    NULL
    168458
    6/20/2008 3:30:00 PM
    Video Conference
    1
    Using the last column which is the workordertypeid, I was able to elimate the first row of data, which is the parent work order, but see how it is returning the technician name twice, where the second row returns me as the primary and then the technician on the assignment WO as well, which I want. In Crystal I have it only selecting the rows with the 1 is the last column, since those rows have the data arranged how I want them to be.
    Once issue that just arose, is what if we only had one work order that we wanted to report on in the subreport. since the WO will get a 0 in the last column, it will never be selected in the report. Is there a way to either us a statement that selects it if it is the only WO listed compared by the WOID field, or if there is a way in SQL, to get what is showing in row 2 to be the only row returned back so I can then show all work orders regardless if they are an assignment
    Here is my current SQL query
    SELECT     T1.WOID, T1.REQUEST, T1.RESPONS, T2.RESPONS AS Addtech, T2.PARENTWOID, T1.LOOKUP2, T1.TaskLookup3, T1.TaskLookup4, T1.TaskLookup5,                       T1.WO_NUM, T1.DUEDATE, T1.WOTYPE3, T2.WorkOrderTypeIdFROM         dbo.TASKS AS T1 LEFT OUTER JOIN                      dbo.TASKS AS T2 ON T2.PARENTWOID = T1.WOID

  • Unable to pull data from 2 tables of a database linked to a 2nd database

    I have a Crystal V7 Report I'm upgrading to Crystal 10 or 11.  It uses the following formula that works (data is in ONE MS Access database containing all three tables):
    If {PayrollCalc.qSource}=0  then {AuthorizedWithholding.qDesc
    else If {PayrollCalc.qSource}=1 or {PayrollCalc.qSource}= 2 then {UnionBenefitDetail.qUBDesc}
    else
    If {PayrollCalc.qSource}=4 then "Extra Tax" + {PayrollCalc.qID} else
    If {PayrollCalc.qSource}=5 then "Payroll Insurance" else
    If {PayrollCalc.qSource}=6 then {PayrollCalc.qID} else
    Mid ({PayrollCalc.qID},2 )
    The upgraded application software uses TWO SQL 2005 Express databases, replacing the one Access database.  PayrollCalc is a table in database A while UnionBenefitDetail & AuthorizedWithholding are tables in database B.  The links are left outer joined from PayrollCalc table to each of the others (I've tried all the enforcement options) but the formula no longer works.  If I remark out the part of the formula from one or the other of the "extra" tables, then the one still active works great but I can't get both to work in the same subreport.  There's no error, I just get a blank returned for the formula.  I'm not familiar with using the Add Command so I haven't tried that.  Can anyone help me?

    I confirmed that the join fields are identical:
    PRCalc Table - qConNo=int (32 bit), length 4
    PRCalc Table - qID=varchar (byte), length 10
    PRCalc Table - qSeg=int (32 bit), length 4
    UnionBenefit Table - qUBID=varchar (byte), length 10
    UnionBenefit Table - qUBSeg=int (32 bit), length 4
    Both of these UnionBenefit fields are left outer joined FROM the PRCalc Table's qID & qSeg fields
    Authorized Withholding - qConNo=int (32 bit), length 4
    Authorized Withholding - qSeg=int (32 bit), length 4
    These two fields are left outer joined FROM PRCalc's qConNo & qSeg fields.
    The qDesc & qUBDesc fields that I'm trying to print in the same subreport using the formula that's not working are both varchar (bye), length 50 fields.
    I have tried various other joins unsuccessfully.  I'm convinced that the left outer join is the correct one to use since neither of the tables from Database B will always have records that match up with those in Database A (PayrollCalc's database).  So yes, it appears that the left outer join does not work properly across two databases when more than one table in the 2nd database is used.  It works fine if I just use one table from database B & do a separate subreport for the other table.

  • I need to create a report using only one record

    I have all this records in my database but i would like to create a layout where it will automatically fill it up with the information of a record i would chose.
    example:
    i got a list of over 200 hundred products and i would like to see in a personalized layout the complete report and characteristics of only the record selected.

    Shaka,
    assuming each record has a unique identifier (like an item number) you can use the function vlookup() to "pull" data out of the database table.
    Beyond that it would be most efficient if you provided the firlds of your database and the layout of the report.

  • Using Microsoft SSIS to pull data from APEX

    Just curious...is it possible to pull data out of APEX using SSIS? Has anyone done it? How do I establish the connection?

    You would pull data out of an Oracle database, APEX is just the development tool like .nyet and Forms... What exactly are you looking to do?
    Thank you,
    Tony Miller
    Webster, TX
    You can get more with a kind word and a two-by-four than you can with just a kind word
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Extracting Data Out of BW

    Hi,
    I'm researching what other companies are doing with regards to extracting data out of your BW data warehouse.
    Do you allow data to be extracted out of BW?
    If so, do you push data out to them?  Or do the external systems pull the data out?
    There's no right answer here.  I'm just trying to get a feel for best practices as to whether external clients should pull data out or have it pushed to them.
    By PUSH, I mean that BW initates the data extraction.  And by PULL, I mean that external systems initiate the data extraction.
    THANKS!

    Hi,
    Does anybody know that is it possible created an infospoke on a multicube/multiprovider?
    When creating a infospoke you can only choose between
    Datasource types: Basicube, Infobject (x2) & ODS, if you choose Basicube option and then do the f4 dropdown  the drop down does not contain a list  of Multiprovisers.
    However if you type the name of the multiprovider straight into the field the system will accept it, and the spoke will activate.
    I have tried to execute the spoke and it does generate a few data packets before  erroring. I am unclear if the error is because the spoke is based on a Multiprovider or a different issue. Error message provided below:
    System error: RSDRC / FORM AUTHORITY_CHECK RSDRC / FORM AUTHORITY_CHECK R
    System error: RSDRC / FUNC RSDRC_BASIC_CUBE_DATA_GET RSDRC / FUNC RSDRC_B
    System error: RSDRC / FORM DATA_GET RSDRC / FORM DATA_GET RSDRC / FORM DA
    Thanks
    Tony

  • How can I display more than one record with result set meta data?

    Hi,
    My code:
        ArrayList<String> resultList = new ArrayList<String>();
        rs=ps.executeQuery();      
        ResultSetMetaData rsmd = rs.getMetaData();      
        while(rs.next()){      
         for(int k=1;k<=rsmd.getColumnCount();k++){            
            resultList.add(rs.getString(k)); 
        ps.close();       
        }catch(Exception e){                                 
        e.printStackTrace();      
        return resultList;
        public String test(ArrayList result)throws Exception{ 
        String data=         
            "<tr>"+ 
            "<td class=normalFont>"+result.get(0)+"</td>"+ 
            "<td class=normalFont>"+result.get(1)+"</td>"+ 
            "</tr>"; 
        return data; 
        }  All the things are wroking but the problem is that ArrayList is displaying just one record whereas I have more than 20 records to display. I tried with loop like: i<result.size(); and result.get(i) then its throwing exception
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 I stuck here for the last more than 2 days. Please help me
    Best regards

    Raakh wrote:
    Still waiting .....I would have answered much earlier, but when I saw this little bit of impatience, I decided to delay answering for a while.
    ArrayList<String> list = new ArrayList<String>();
    list.add("abc");
    list.add("def");
    list.add("ghi");
    System.out.println(list.get(0));
    abc
    System.out.println(list.get(1));
    def
    System.out.printnln(list);
    [abc, def, ghi]That list has 3 items. Each one is a String.
    But here is what you appear to be doing:
    select * from person
    +-----+-------------+-------------+--------+
    | id  |  first name |  last name  | height |
    +-----+-------------+-------------+--------+
    |   1 | Joe         | Smith       | 180    |
    +-----+-------------+-------------+--------+
    |   2 | Mary        | Jones       | 144    |
    +-----+-------------+-------------+--------+
    for each row in ResultSet {
      for each column in ResultSet {
        list.add(that element);
    // which becomes
    list.add(1);
    list.add("Joe");
    list.add("Smith");
    list.add(180);
    list.add(2);
    list.add("Mary");
    list.add("Jones");
    list.add(144);
    System.out.println(list.get(0));
    1
    System.out.println(list.get(1));
    Joe
    System.out.printlN(list);
    [1, Joe, Smith, 180, 2, Mary, Jones, 144]That list has 8 items. Some of them are Strings and some of them are Integers. I would assume that, for this sample case, you would want a list with 2 items, both of which are Person objects. However, it really isn't clear from your posts what you are trying to do or what difficulty you're having, so I'm just guessing.

Maybe you are looking for

  • Transferring "Pages" from iMac to iPad

    I downloaded Pages to my iMac, can I transfer and use it on my iPad or do I need to purchase it for the iPad too?

  • HT202157 My apple tv is unresponsive.

    My apple tv is unresponsive.  It is "stuck" on the screen saver of rotating pictures.  I have tried holding down the menu and down arrow for 6 seconds and unplugging as suggested.  Any suggestions?

  • Drag and drop into subject line

    I installed OS 10.4.5 and use Tiger mail. I noticed that unlike Panther mail, in Tiger mail draging text from the message to the subject box doesn't work. Sure you can copy and paste but in old mail, you drag and drop. It's absent in Tiger. You can d

  • Java is capable to render 3D applications!!!

    I often heard that java is slow, to slow to use it for bigger 3D applications. I don't think that's right! Well, now I tested it! Screen: http://www.pictureupload.de/originals/9417/030609172251_3d_screen01.jpg Realtime 3D Applications with shaders, l

  • After the new os x software update i cant watch cnet videos or cnn videos

    after the new os x software update i cant watch cnet videos or cnn videos