Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: Create table with partition key


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

    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 :-
    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,

  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    What version of MySQL are you using? This only is available from version 5.1 of the server onwards.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts