SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to script a process that requires max id?

    Here is the deal.
    I enter person info and hit submit. A record is created in person table with person id =1. Person id is generated by the system. Next submit will create a new record with next id generated value. When I replay the same I can't since already person id for 1 and say 2 are present in the table hence insert duplicate violation.
    How can I get my script working where during replay I should not get any duplicate violation error. I am new and sort of time crunch need your help.
    ------------------


    [This message has been edited by ssingh (edited 02-12-2002).]

  2. #2
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    Read up on correlation and parameterization. These are the keys to overcoming that obstacle.

    ------------------
    JP

  3. #3
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    Thanks JP. I know I am asking for more. But since I am in real time crunch can you please be more specific. I have to get this done in ASAP. Thanks

    ------------------

  4. #4
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ssingh:
    Thanks JP. I know I am asking for more. But since I am in real time crunch can you please be more specific. I have to get this done in ASAP. Thanks

    <HR></BLOCKQUOTE>

    You are asking for more... please use the books online. However, I will give you more clues. I am assuming that the app gets the next available index. You must capture that next index into a dynamic parameter and use that on the subsequent submit.

    ------------------
    JP

  5. #5
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    hi jpensyl,

    I did try doing to capture the max id value from the table. Can I have an SQL statement say 'select max(id) from table a' and store the value in my user defined variable. I am creating web vuser script. Can I use an LRD function in web vuser script. just a guess...




    ------------------

  6. #6
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ssingh:
    hi jpensyl,

    I did try doing to capture the max id value from the table. Can I have an SQL statement say 'select max(id) from table a' and store the value in my user defined variable. I am creating web vuser script. Can I use an LRD function in web vuser script. just a guess...

    <HR></BLOCKQUOTE>

    For the SQL-related question: Yes, regarding the query. For capture, check out the "lrd_save_col" statement. (This all goes back to correlation/parameterization).

    For mixing web, with db api calls in the same script: I've not tried it. Guessing that you might need to understand which #includes would apply - if in fact, it can be done. Of course you would need licenses for both for execution within a scenario.

    For mixing script types in a scenario - yes you can have db and web and any other.

    ------------------
    JP

    [This message has been edited by jpensyl (edited 02-15-2002).]

  7. #7
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    Hi JP,

    I have license for DCOM & Web Vuser. If I am creating a web vuser and say I include the appropriate include file in my wb vuser script. Is it correct to understand that I can use Db API calls. And also can I run a web vuser scenario.
    Thanks

    ------------------

  8. #8
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ssingh:
    Hi JP,

    I have license for DCOM & Web Vuser. If I am creating a web vuser and say I include the appropriate include file in my wb vuser script. Is it correct to understand that I can use Db API calls. And also can I run a web vuser scenario.
    Thanks

    <HR></BLOCKQUOTE>

    You should be able to run a web vuser scenario if you have the licenses for web user type. Without a DB license for DB users, you will have to be creative for db accesses. No doubt, there is a way and perhaps some forum subscriber has done this. Let us know what you come up with.


    ------------------
    JP

  9. #9
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    Hi JP,

    I did look at mercury support site and there was none I could find. I asked my issue from mercury and they replied that LRD function can be called from a web Vuser script. The only exception is that it will be complex sicne then one has to inclue proper include files.

    ------------------

  10. #10
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to script a process that requires max id?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ssingh:
    Hi JP,

    I did look at mercury support site and there was none I could find. I asked my issue from mercury and they replied that LRD function can be called from a web Vuser script. The only exception is that it will be complex sicne then one has to inclue proper include files.

    <HR></BLOCKQUOTE>

    Contact Mark Tomlinson (mtomlinson@merc-int.com) at Mercury. He did a white paper on this topic.


    ------------------
    JP

 

 
Page 1 of 2 12 LastLast

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 12.50%
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 04:08 PM.

Copyright BetaSoft Inc.