TeleFlow Forums
http://teleflow.org/phpbb/

Variable Changing
http://teleflow.org/phpbb/viewtopic.php?f=10&t=336
Page 1 of 1

Author:  Kimmel [ Wed Mar 01, 2006 4:00 pm ]
Post subject: 

I am connecting to a Progress DB which has sequences. I am assigning a global variable @SHLOGHID = pub.shloghid.nextval which is supposed to get me the next sequence value which is does. <br>However every place I use @SHLOGHID it dfoesn't use the orginal value I got it does a nextval again. Because of this 5 records which I expect all to have the value 10 are actual 10,11,12,13,14. <br>What do I need to do to make sure the Global Variable stays what I want it to be.

Author:  Chris [ Thu Mar 02, 2006 10:34 am ]
Post subject: 

Global variables only change when something in the application specifically changes them. <br> <br>How is that variable being set? (Through a SQL Statement step?) What type of routine is being done? (Something like this: SQL Statement to gather data, SQL Fetch, SQL Statement to update, SQL Fetch, SQL statement to update >> If it is something like this, each fetch will/may get the next sequence number, which could be the problem) <br> <br>One of the best things you can do to attempt to track this down would be to capture a log of a complete call in which this goes wrong (or copy a complete log from a TFSimulator call into a notepad), and then search for all the places where SHLOGHID shows up in the log. You should see where/when @SHLOGHID is being updated in the application, and as such, why it is being updated when you don't expect/desire it to.

Author:  Kimmel [ Thu Mar 02, 2006 10:47 am ]
Post subject: 

I am using a set global variable command and assigning @SHLOGHID the value pub.shloghid.nextvalue which is a SQL statment but not to a table so I don't need to do a fetch or anything like that. The problem appears to be that @SHLOGHID is acting like a pointer to the pub.shloghid.nextvalue command so everytime I reference @SHLOGHID it runs the pub.shloghid.nextvalue command again instead of giving me the value of @SHLOGHID.

Author:  Chris [ Fri Mar 03, 2006 10:09 am ]
Post subject: 

TeleFlow variables are all stored as strings. What you are suggesting shouldn't be possible. <br> <br>I would try what I suggested previously, and when searching the log, search for this string: <br>"Setting global variable '@SHLOGHID' to" <br> <br>This should show you every time the variable changes, so you can see what it is that is causing it to contain numbers other than what you expect.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/