Auto_Increment

2001-04-15 Thread Jamie S Buchanan

Hello, I wonder if you can help me.

For a university project I've got a database with several tables using columns 
set up with 'auto_increment'. I've discovered that the value that the system 
creates for a new record is one greater than the largest one which has existed 
even if the records with the largest values have been deleted.  I've read the 
docs and read the part which says that this is the way myISAM tables handles 
auto_increment and that ISAM tables create a value which is one greater than the 
largest value currently existing.

>From this I've presumed that I'm using myISAM tables but is there any way I can 
make the auto_increment feature work the way it does with the ISAM tables?

And what exactly are myISAM and ISAM tables?
(a quick web search gave me: -the Information centre for South African Music
 -the Institute for the Study of American Music
 -International Swimwear and Active Market)
 
Thanks for any help you can give me,
Jamie.   


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Ships and Harbours

2001-03-10 Thread Jamie S Buchanan

Hello all,
I'm trying to write what should be a simple query but is turning out to
be a particularly difficult one and was wondering if I could ask your
advice.

The problem is to do with some harbour management software I'm writing for
a university software course. I have a table which gives the distances (in
metres) along a harbour of the front-end and back-end of where each ship
will dock, and the date and time of when each will arive and depart. What
I am trying to find is the areas of empty space along the harbour between
a given date and time range. So far I have managed to write a query which
returns the occupied spaces (i.e. the positions where ships will be
docked) for a given time range.

A graph of the harbour distance against time looks something like:


 0m Distance Along Harbour  1200m
TIME --
 0m->200m   350m->600m  900m->1100m
   500m->700
1XXX
2X X
3X XXXX 
4X XX X X  X
5???
6X XX X   aaX  X
7XXXX X   aaX  X
8   XXX   aaX  X
9     aaX  X
10     XXXaaX  X
11     X XaaX  X
12     X XaaX  X
13   ???
14 X X  X  X
15 X X  
16 XXX



'X' is for the outline of the ship's position over time.
'a' is the area of free space within a given time range that I would like
the query to return.
'?' represents the boundaries the time range I'm checking.
Any white space which doesn't stretch the whole time range is
irrelevant as I need the space for the entire time.

I'm using a table containing (amongst other things):
shipArrivalDate  (DATETIME)
shipDepartDate   (DATETIME)
startPosition  (given in metres from the 0m end of the harbour)
endPosition(given in metres from the 0m end of the harbour)
   (These distances are illustrated above)

I can get a table of the start and end positions of all ships in the time
range but converting this into the free space start and end positions has
become a bit of headache.

Any ideas you can give will be much appreciated,
Jamie.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Setting a specific default value on a field

2001-03-09 Thread Jamie S Buchanan

Hello all,
I'm a third year uni student in Scotland doing a year long project which
involves a fair amount of MySQL. I have the following problem and would be
appreciative if I could get some advice on solving it:

- in the script I run to create a table how do I code one DateTime field
to intially be set to a value of another DateTime field?

More specifically, I have two DateTime fields (A and B), in my creation
script I want to set the default value of B to the value of A so that
when I write a new record to the table the position of B can be left
NULL, or equivalent, but the value of A will be stored in it's place. I
later on want to change B independently to a different value than A so I
don't want a strict contraint that they must always be the same.

Thanks,
Jamie.



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php