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 > Create table with partition key

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-10, 02:26
bh_hensem bh_hensem is offline
Registered User
 
Join Date: Jun 2009
Posts: 18
Create table with partition key

Hi..

Below is my query to create table with partition, but once i execute it its failed.

Code:
CREATE TABLE packextra_trans3 (
  ID bigint(20),
  JobTicketID bigint(20),
  FieldID1 varchar(12),
  FieldID2 varchar(50),
  FieldID3 int(8),
  FieldID4 int(5),
  FieldID5 int(6),
  FieldID6 int(8),
  FieldID7 varchar(50),
  FieldID8 int(1),
  FieldID9 varchar(30),
  FieldID10 varchar(15),
  FieldID11 varchar(15),
  FieldID12 varchar(5),
  FieldID13 decimal(13,2),
  FieldID14 varchar(50),
  FieldID15 varchar(3),
  FieldID16 varchar(27)
)
partition by key (JobTicketID,FieldID1,FieldID2,FieldID5,FieldID9)
partitions 5
(
partition p0_jobid,
partition p0_fid1,
partition p0_fid2,
partition p0_fid5,
partition p0_fid9
);
The error is :-
Code:
MySQL Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'partition by key (JobTicketID,FieldID1,FieldID2,FieldID5,FieldID9)
partitions 5' at line 21
Could somebody help me ?

Thank you,
Baharin
Reply With Quote
  #2 (permalink)  
Old 04-15-10, 03:51
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
What version of MySQL are you using? This only is available from version 5.1 of the server onwards.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
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