SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Apprentice
    Join Date
    Aug 2010
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Retreiving runtime datatable values

    I posted something similar to this in the past but for some reason I can not get a repeatable result and am getting frustrated. I am connecting to an Oracle database and returning data to the runtime datasheet named "output1". I had gotten a test run to work but when I updated the SQL statement to return some other rows I now get an error. The code below is what I am using to get the data now. I have tried every method I could google as an alternative.

    OracleFormWindow("Sales Orders").OracleTabbedRegion("Line Items").OracleTable("LINE").EnterField 1, "Ordered Item", DataTable.GetSheet("output1").GetParameter("Segmen t1").Value



    I get the following error:

    The Sheet.GetParameter operation failed. The <Segment1> column does not exist.

    Line (87): "OracleFormWindow("Sales Orders").OracleTabbedRegion("Line Items").OracleTable("LINE").EnterField 1, "Ordered Item", DataTable.GetSheet("output1").GetParameter("Segmen t1").Value".


    Can anyone give me a hint at what I am doing wrong?


    Thanks,

    Mack

  2. #2
    Super Member QAGanesh's Avatar
    Join Date
    Sep 2010
    Posts
    1,898
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    I think, the code
    DataTable.GetSheet("output1").GetParameter("Segmen t1").Value" would look for a sheet named "output1". So just check if your sheet has a column named "Segment1"
    Thanks,
    Ganesh Iyer
    Winds of Change

  3. #3
    Apprentice
    Join Date
    Aug 2010
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    Yes the runtime datatable has just 2 columns the first is "Segment1" the other is "Quantity".

    I guess the first question to answer is it possible to use the data from the runtime datatable at all in the same test without exporting it to an Excel sheet first.


    Mack

  4. #4
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    Jim,

    You could use the data from the runtime table in the same test itself.

    Please check if the Runtime Sheet(output1) and the column(Segment1) is created prior to performing this step.
    Rajkumar

  5. #5
    Apprentice
    Join Date
    Aug 2010
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    Yes the runtime sheet (output1) is the first thing created prior to all else in the script. I am executing a SQL script to return the 2 columns of data to the runtime sheet. After that the script is executed and the data used to fill in fields in an Oracle Form.



    Jim

  6. #6
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    Not sure what's happening. Check if this works in a new action. If it doesn't, may be something is corrupted.

    DataTable.AddSheet "output1"
    DataTable.GetSheet("output1").AddParameter "Segment1", "SQA"

    Msgbox DataTable.GetSheet("output1").GetParameter("Segmen t1")
    Msgbox DataTable("Segment1", "output1")
    Rajkumar

  7. #7
    Apprentice
    Join Date
    Aug 2010
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    That works perfectly. Here is the code I am using to create the runtime table. It takes the column headings from the SQL statement and makes them the columns in the runtime table.

    Dim adocon,adorecordset
    Set adocon=CreateObject("ADODB.Connection")
    constr="Provider=OraOLEDB.Oracle.1;Password=appsre ad;Persist Security Info=True;User ID=appsread;Data Source=Dev"
    adocon.Open constr
    Set adorecordset=CreateObject("ADODB.Recordset")
    Set adorecordset.ActiveConnection=adocon
    Strsql="SELECT Segment1, Quantity FROM (Select Description, Enabled_Flag, A.Inventory_Item_Id, B.Inventory_Item_Id, Inventory_Item_Status_Code, Organization_Id, Segment1, Primary_Uom_Code, Primary_Unit_Of_Measure,(Case When B.Conversion_Rate Is Null Then 1 Else B.Conversion_Rate End) Quantity, B.Uom_Code, B.Unit_Of_Measure From Mtl_System_Items_B A Left Outer Join Mtl_Uom_Conversions B On (A.Inventory_Item_Id = B.Inventory_Item_Id) Where -1= -1 And (Organization_Id = 356 Or Organization_Id = 359 Or Organization_Id = 591) And Enabled_Flag = 'Y' And Inventory_Item_Status_Code = 'Active' ORDER BY dbms_random.value ) WHERE rownum = 1"
    adorecordset.Source=Strsql
    adorecordset.Open
    set outsheet=Datatable.Addsheet("output1")
    For each fld in adoRecordset.Fields
    outsheet.AddParameter fld.name,""
    Next
    i=1
    Do while Not adorecordset.EOF
    DataTable.SetCurrentRow(i)
    For each fld in adorecordset.Fields
    outsheet.GetParameter(fld.name).value=fld.value
    Next
    adorecordset.MoveNext
    i=i+1
    Loop

  8. #8
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    Can you attach the excelsheet?
    Rajkumar

  9. #9
    Apprentice
    Join Date
    Aug 2010
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retreiving runtime datatable values

    I exported the datatable to excel. I am attaching it to this post.
    Attached Files Attached Files

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:56 PM.

Copyright BetaSoft Inc.