Automatic Record Numbering in Sybase ? 
Author Message
 Automatic Record Numbering in Sybase ?

Informix has a data type called "serial", which gives increasing
numbers to newly created records.  It's useful for tasks like creating
a unique record number so you can use that in your joins instead of
comparing four or five long alphabetic strings which are the real key,
and for saving lots of space.

How can I do this in Sybase?  Our local person with Sybase experience says
"You can do messy things with triggers, but it's really an ugly kluge".
Is there a better way, or has somebody at least done this as a nice
clean simple kluge?

My raw data lives in a Sybase database, and I'd prefer to process it
there rather than dump it into flat files, move it to my machine, and
either grind it back into Informix, or use traditional Unix tools like
look and join, but it's too slow to do the joins in real time given my
luck with Sybase's key mechanisms, and I don't have the space to keep
the results of pre-processing the whole thing unless I can use record numbers.

Also, are there any good books on Sybase out there?  I'm finding the
reference manuals less than transparent, unlike Informix's verbose but
well-written collection of manuals.
--
                                Pray for peace;      Bill
#Bill Stewart +1-908-949-0705 erebus.att.com!wcs AT&T Bell Labs 4M312 Holmdel NJ
# My *other* computer is a Sun 2/50!  
#    (New dinosaur owner looking for software, advice, etc.)



Sat, 15 Oct 1994 10:20:29 GMT
 Automatic Record Numbering in Sybase ?


Quote:
Stewart 908-949-0705 erebus.att.com!wcs) writes:
> Informix has a data type called "serial", which gives increasing
> numbers to newly created records.  It's useful for tasks like creating
> a unique record number so you can use that in your joins instead of
> comparing four or five long alphabetic strings which are the real key,
> and for saving lots of space.

> How can I do this in Sybase?  Our local person with Sybase experience  
says
> "You can do messy things with triggers, but it's really an ugly kluge".
> Is there a better way, or has somebody at least done this as a nice
> clean simple kluge?

> My raw data lives in a Sybase database, and I'd prefer to process it
> there rather than dump it into flat files, move it to my machine, and
> either grind it back into Informix, or use traditional Unix tools like
> look and join, but it's too slow to do the joins in real time given my
> luck with Sybase's key mechanisms, and I don't have the space to keep
> the results of pre-processing the whole thing unless I can use record  
numbers.

> Also, are there any good books on Sybase out there?  I'm finding the
> reference manuals less than transparent, unlike Informix's verbose but
> well-written collection of manuals.
> --
>                            Pray for peace;      Bill
> #Bill Stewart +1-908-949-0705 erebus.att.com!wcs AT&T Bell Labs 4M312  
Holmdel NJ
> # My *other* computer is a Sun 2/50!  
> #    (New dinosaur owner looking for software, advice, etc.)

if you find a way, i would love to know about it.  my friend over at  
another company has the same needs.  they wrote a c program that goes in  
and compresses the serial numbers they run every night.

--
Joe Alotta
First Chicago Corp.

(312)732-3439

"Wisdom is better than gold and understanding more valuable than silver."



Mon, 17 Oct 1994 22:06:20 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Automatic Record Numbering in Sybase ?

2. Get the automatic identity number when creating a new record

3. Get the automatic identity number when creating a new record

4. Automatic sequential record numbering?

5. Find certain Number of Records / Print only certain number of records

6. select the top number records where the qty would sum to a given number

7. SELECT with automatic row number

8. add record with identity number before any existing number

9. Automatic Numbering in SQL Server 7.0

10. automatic increasing number

11. reseting automatic sequence numbers

12. automatic unique number


 
Powered by phpBB® Forum Software