[U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Boydell, Stuart
Just wondering if anyone has a neat trick for picking up the highest ID from a file. Where the file ID is an integer. With UVSQL I would SELECT MAX(@ID) FROM TABLE; - however, the program I need to do this within has the file (table) open and if I try to execute it returns the error 'Non-SQL

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Brian Leach
Stuart You're stuck with something like that, unless you know that all the possible ids are present in the file. If so, you could use a form of binary search pattern could find it quickly. i.e. start with a likely number and see if the id is there. (filesize / recordsize) If it is, double it.

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Hona, David
Hi Stuart, Probably too late now... but... If you defined your SQL table with the DEFAULT NEXT AVAILABLE it will automatically increment the primary key value by 1 when you insert a new row... CREATE TABLE MYTABLE (CLIENT_NUMBER INT PRIMARY DEFAULT 'NEXT AVAILABLE', CLIENT_NAME VARCHAR FMT 30T

Re: [U2] 2

2011-05-27 Thread Ron Hutchings
..I can give you a good advice: visit this drugstore and your problem will be solved. http://ecole2jauche.be/page.php?oyahoo=76eb3 ___ U2-Users mailing list U2-Users@listserver.u2ug.org

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Wols Lists
On 27/05/11 07:03, Boydell, Stuart wrote: Just wondering if anyone has a neat trick for picking up the highest ID from a file. Where the file ID is an integer. With UVSQL I would SELECT MAX(@ID) FROM TABLE; - however, the program I need to do this within has the file (table) open and if I

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Rex Gozar
You could try: SELECT FILE READLIST IDS ELSE ABORT MAX.ID = MAXIMUM(IDS) rex On Fri, May 27, 2011 at 6:40 AM, Wols Lists antli...@youngman.org.uk wrote: On 27/05/11 07:03, Boydell, Stuart wrote: Just wondering if anyone has a neat trick for picking up the highest ID from a file. Where the

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Charles Stevenson
I am going to assume we are talking about a HUGE file, otherwise efficiency wouldn't much matter. I don't know a GOOD way outside basic or sql to prevent a sort-selected list from being created. For humongous files, that may be painful. Here is a way, not a GOOD way, just a way. I just

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Israel, John R.
How about this: Keep a control record that has the last value so you know where it was last time. READ REC FROM F.CONTROL, LAST.TEST ELSE REC = 0 REC2 = 1000 END LAST.TEST = REC1 ;* last hit INCREMENT = REC2 ;* how much to jump w/ each test TEST.ID = LAST.TEST

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread David A. Green
What comes to mind are these: 1. Have a the system write the Max key somewhere. 2. Create a Trigger that keeps a max key updated. 3. Create an Index then use a SUBR to access the Max Key. 4. If this statement is used a lot then every time you run it update your own Max Key and start looking from

Re: [U2] 2

2011-05-27 Thread Larry Hiscock
Your computer appears to be compromised. I have temporarily unsubscribed you from the U2 Users list. Once you have corrected your infection, you can resubscribe at http://listserver.u2ug.org. Larry Hiscock Moderator -Original Message- From: u2-users-boun...@listserver.u2ug.org

Re: [U2] 2

2011-05-27 Thread Bob Woodward
Who are you directing this to, Larry? -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Larry Hiscock Sent: Friday, May 27, 2011 7:16 AM To: 'U2 Users List' Subject: Re: [U2] 2 Your computer appears to be compromised.

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Wols Lists
On 27/05/11 14:33, Charles Stevenson wrote: I am going to assume we are talking about a HUGE file, otherwise efficiency wouldn't much matter. I don't know a GOOD way outside basic or sql to prevent a sort-selected list from being created. For humongous files, that may be painful. Hmmm...

Re: [U2] 2

2011-05-27 Thread Wols Lists
On 27/05/11 15:15, Larry Hiscock wrote: Your computer appears to be compromised. I have temporarily unsubscribed you from the U2 Users list. Once you have corrected your infection, you can resubscribe at http://listserver.u2ug.org. Larry Hiscock Moderator I'm always wary that these

Re: [U2] 2

2011-05-27 Thread Larry Hiscock
Mea culpa. I hit reply and didn't change TO: address. I have sent a separate email privately to Ron. Larry Hiscock Moderator -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bob Woodward Sent: Friday, May 27, 2011

[U2] uv 2 ud

2011-05-27 Thread Symeon Breen
Here is a strange one - i have a friend with a uv system that he cannot maintain - so he has asked me to do this. It needs transferring to a new machine and some changes making and maintained over the coming years. However my team has worked exclusively in ud for 10 years, so uv is rather rusty to

Re: [U2] uv 2 ud

2011-05-27 Thread Israel, John R.
As long as the customer has no preference, and there are not a bunch of funky things that only work with UV, I would go with what you know. Completing the project SHOULD be quicker and thus cheaper. Maintenance would also be quicker and cheaper. But that is just the 10,000 foot view/opinion.

Re: [U2] uv 2 ud

2011-05-27 Thread John Thompson
You better check to see if the customer has any Pick type dictionaries or correlatives (ala A,F's etc.). Universe DOES support these. I thought Unidata did NOT. That will probably be one of your biggest obstacles in converting them. On 5/27/11, Israel, John R. johnisr...@daytonsuperior.com

Re: [U2] uv 2 ud

2011-05-27 Thread Wols Lists
On 27/05/11 16:53, Israel, John R. wrote: As long as the customer has no preference, and there are not a bunch of funky things that only work with UV, I would go with what you know. Completing the project SHOULD be quicker and thus cheaper. Maintenance would also be quicker and cheaper.

Re: [U2] uv 2 ud

2011-05-27 Thread fft2001
+1 Convert. Here is a strange one - i have a friend with a uv system that he cannot maintain - so he has asked me to do this. It needs transferring to a new machine and some changes making and maintained over the coming years. However my team has worked exclusively in ud for 10 years, so uv is

Re: [U2] Uniquery

2011-05-27 Thread Greg Coelho
U2 Users! I am trying to pass in arguments into a UniQuery form using JSPARAMS. This works fine when I working with a SELECT LIST: V.JS.VAR1 = Smith PROCEDURE LINE SELECT PERSON WITH LAST.NAME EQ :V.JS.VAR1 But when I try to pass this into a literal statement such as a HEADER - things go

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Charles Stevenson
That's the best answer yet, Wol. Assuming there's no Next-Sequential-Id counter to poll. assuming a large file, and an ongoing need. (If not, who cares?) assuming normal writes to the file aren't so frequent that maintaining the extra index -- albeit ever so evenly distributed -- isn't too

Re: [U2] [UV] Emulate SQL MAX() function at TCL

2011-05-27 Thread Boydell, Stuart
:) Thanks all -Original Message- From: Wols Lists Sent: Saturday, 28 May 2011 1:34 To: u2-users@listserver.u2ug.org Subject: Re: [U2] [UV] Emulate SQL MAX() function at TCL On 27/05/11 14:33, Charles Stevenson wrote: I am going to assume we are talking about a HUGE file, otherwise