If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > About Signed/Unsigned Types

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-10, 12:27
dr_pompeii dr_pompeii is offline
Registered User
 
Join Date: Jan 2008
Posts: 22
About Signed/Unsigned Types

Dear Members

I have read this Numeric Types


about BIGINT

Code:
Signed -9223372036854775808 to 9223372036854775807 
Unsigned 0 to 18446744073709551615
Well I am very interesting with Unsigned since I want only positive number for my PK auto_increment

I have the doubt about how create explicitly like Unsigned when I define my table creation.

Because when I do the backup, I can see

Code:
DROP TABLE IF EXISTS `articulo`; 
CREATE TABLE `articulo` ( 
`idArticulo` bigint(20) NOT NULL auto_increment, 
`codigoArticulo` varchar(70) NOT NULL, 
...
but How I can know that bigint is Signed/Unsigned explicitly ???

In MySQL query browser if I execute the describe articulo query
I get

Code:
'idArticulo', 'bigint(20)', 'NO', 'PRI', '', 'auto_increment' 
'codigoArticulo', 'varchar(70)', 'NO', '', '', ''
but not appear if is Signed/Unsigned

The only way that I can see is doing right click in the table and select
Edit Table where I can see the column flags with the values for such field (PK) UNSIGNED and ZEROFILL

Some guidance going to be appreciate

Thanks in advanced
Reply With Quote
  #2 (permalink)  
Old 04-18-10, 14:41
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
Try creating it as follows:

DROP TABLE IF EXISTS `articulo`;
CREATE TABLE `articulo` (
`idArticulo` bigint(20) unsigned NOT NULL auto_increment,
`codigoArticulo` varchar(70) NOT NULL,
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #3 (permalink)  
Old 04-18-10, 15:03
dr_pompeii dr_pompeii is offline
Registered User
 
Join Date: Jan 2008
Posts: 22
Hello it-iss.com

Thank you!, work
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On