Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 17th, 2004, 08:28 AM
chiticco chiticco is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 chiticco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Generating big numbers

Hi, please give me some clues abot my problem please:
how can I generate big-unique numbers for a field through a procedure or a trigger ? I want to insert automatically in a field big and unique numbers(8-10 numbers long) when I do an INSERT action. Maybe if I can code the number like:
DDMM(day and month)0000XY (it must be 10 numbers long, not less so I fill to the right with 0-es). As you can see the field is VARCHAR(10) but it can be an INTEGER as well, only that I don't know how to do it(setting a generator in advance with value = 1000000000 is ok ? Isn't it too big for a generator ?).
Can I do that in a Firebird action ?!

Reply With Quote
  #2  
Old March 17th, 2004, 01:38 PM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 28 sec
Reputation Power: 10
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Quote:
Originally Posted by chiticco
Hi, please give me some clues abot my problem please:
how can I generate big-unique numbers for a field through a procedure or a trigger ? I want to insert automatically in a field big and unique numbers(8-10 numbers long) when I do an INSERT action. Maybe if I can code the number like:
DDMM(day and month)0000XY (it must be 10 numbers long, not less so I fill to the right with 0-es). As you can see the field is VARCHAR(10) but it can be an INTEGER as well, only that I don't know how to do it(setting a generator in advance with value = 1000000000 is ok ? Isn't it too big for a generator ?).
Can I do that in a Firebird action ?!


in FB1.5 use BIGINT
__________________
Romania it's a beautiful country ... too bad that it's populated with ... peoples!

Reply With Quote
  #3  
Old March 18th, 2004, 02:33 AM
chiticco chiticco is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 chiticco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok..thanks..But still, is there a way to create formated fields from different types ? I know that is CAST word, but what about the format I've described up ?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Generating big numbers

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap