SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    saving multiple rows of a query result in an array

    Hello friends,

    I have made a connection to Oracle Database. I have executed a query that returns multiple rows(returns the values selected from a weblist-saved in DB). I want to save these rows in an array. The returned row looks like this.

    SystemGroupID 'columnname
    sys_gri 'value1
    loc_system 'value2
    .
    .

    I have the following code.
    do until rsCugr_Systems.eof
    counter = counter+1
    reponse.write rsCugr_Systems ("systems”) // to display on the screen ‘This displays the systems
    Systemgroupid(counter) = rsCugr_Systems.getstring“systems”) ‘This gives error- says type mismatch –
    rsCugr_Systems.MoveNext
    loop
    Whay does it say type mismatch error. Please help.

    Vaishali

  2. #2
    Member
    Join Date
    Aug 2009
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: saving multiple rows of a query result in an array

    Hello,

    I think that SystemGroupID must be declared as a dynamic array :


    ReDim SystemGroupID (-1)
    sys_gri 'value1
    loc_system 'value2

    do until rsCugr_Systems.eof

    reponse.write rsCugr_Systems ("systems”)
    ReDim preserve SystemGroupID (Ubound(SystemGroupID ) + 1)
    SystemGroupId (Ubound(SystemGroupId)) = rsCugr_Systems.getstring“systems”)
    rsCugr_Systems.MoveNext

    loop

  3. #3
    Member
    Join Date
    Jul 2009
    Location
    Hyderabad, India
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: saving multiple rows of a query result in an a

    Hi,

    Use a simple technique.

    dbRecords=rsCugr_Systems.getrows

    This statement will return the complete rows to a two dimensional array.

    getrows method will return all rows based on the executed query.
    Sudhakar Kakunuri
    QtpSudhakar.Com

 

 

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.71%
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 08:00 AM.

Copyright BetaSoft Inc.