Back to the month index |
Back to the list index
|
Anthony Harris (tony@ntech.com)
Thu, 16 Jan 1997 11:29:30 -0600 (CST)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Silvio Ciccarone: "[mSQL] mSQL's ODBC for Solaris"
- Previous message: igor@digex.net: "Re: [mSQL] Finding an empty "slot""
- In reply to: Jonas Oberg: "[mSQL] Finding an empty "slot""
- Next in thread: Scott MacKay: "Re: [mSQL] Finding an empty "slot""
- Reply: Scott MacKay: "Re: [mSQL] Finding an empty "slot""
From: Anthony Harris <tony@ntech.com> Message-Id: <199701161729.LAA01391@reliant.ntech.com> Subject: Re: [mSQL] Finding an empty "slot" Date: Thu, 16 Jan 1997 11:29:30 -0600 (CST)>
> I've got a table that has an element "memberid" which is a char(12). Each
> element memberid has the form "NDF-M-xxxx", where xxxx is a number (0000
> to 9999). Let's say we have these elements;
> NDF-M-0000
> NDF-M-0001
> NDF-M-0003
>
> how can I make my program determin which memberid it should use for new
> members? In the example above, it would use NDF-M-0002 since it's not in
> use.
eek. As far as I know, in msql you are going to have to use a slightly
painful method:
1) Select every row in order 0000 - 9999
2) strncpy the last four characters into a new string
3) atoi that new string.
4) compare it to a "side by side" counter you have running while cycling
through the rows
5) once you hit a counter number > current row, you have a free slot.
If someone knows of an easier way to do this in msql, please let this
person know, the way I have stated could potentially be painfully slow if
you have to cycle through this every time. . .
-Tony
>
> /Jonas
>
> --------------------------------------------------------------------------
> To remove yourself from the Mini SQL mailing list send a message containing
> "unsubscribe" to > "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
> "info msql-list" to majordomo@bunyip.com for info on monthly archives of
> the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!
>
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!
- Next message: Silvio Ciccarone: "[mSQL] mSQL's ODBC for Solaris"
- Previous message: igor@digex.net: "Re: [mSQL] Finding an empty "slot""
- In reply to: Jonas Oberg: "[mSQL] Finding an empty "slot""
- Next in thread: Scott MacKay: "Re: [mSQL] Finding an empty "slot""
- Reply: Scott MacKay: "Re: [mSQL] Finding an empty "slot""