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

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

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    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)
    http://www.it-iss.com
    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
  •