cannot create foreign key in mySql

Discussion in 'Perl Misc' started by Gaurav, May 3, 2005.

  1. Gaurav

    Gaurav Guest

    hi.
    I have got two tables with me namely "resources" and "instance"
    now structure of "resources" is :
    ------------------------------­------
    r_name varchar(50) primary key,
    ------------------------------­------


    the structure of "instance" is :
    ------------------------------­------
    instance_name varchar(50) primary key,
    qty int(5),
    no_allocated int(5),
    r_name varchar(50)
    ------------------------------­--------


    now when i want to make the "r_name" of instance table as the foreign
    key to the "resources table"


    i use the followin command :


    ALTER TABLE INSTANCE ADD FOREIGN KEY (R_NAME) REFERENCES
    RESOURCES(R_NAME);


    the error generated is :


    " ERROR 1005 (HY000) : Can't create table
    '.\brocade_lab\#sql-650-f7.frm­' (errno : 150)


    what should i do ?


    regards
    gaurav
     
    Gaurav, May 3, 2005
    #1
    1. Advertising

  2. "Gaurav" <> wrote in news:1115128708.887948.151540
    @g14g2000cwa.googlegroups.com:


    > Subject: cannot create foreign key in mySql


    > what should i do ?


    As you do not seem to have a Perl question, you should look for a forum
    appropriate to your question.

    Sinan
     
    A. Sinan Unur, May 3, 2005
    #2
    1. Advertising

  3. Gaurav <> wrote:


    > what should i do ?



    Ask Perl questions in a Perl newsgroup and ask database questions
    in a database newsgroup.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, May 3, 2005
    #3
  4. Gaurav

    Gaurav Guest

    Well, I am sorry , I posted this question here.
     
    Gaurav, May 3, 2005
    #4
  5. On 2005-05-03, Gaurav scribbled these
    curious markings:
    > what should i do ?


    Get a decent database, then post to a database newsgroup.

    Best Regards,
    Christopher Nehren
    --
    I abhor a system designed for the "user", if that word is a coded
    pejorative meaning "stupid and unsophisticated". -- Ken Thompson
    If you ask the wrong questions, you get answers like "42" and "God".
    Unix is user friendly. However, it isn't idiot friendly.
     
    Christopher Nehren, May 3, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajesh Tiwari

    Can Not Access Foreign Key Constraint

    Rajesh Tiwari, Jun 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    661
    Rajesh Tiwari
    Jun 30, 2003
  2. H5N1
    Replies:
    0
    Views:
    449
  3. Weasley
    Replies:
    0
    Views:
    402
    Weasley
    Feb 2, 2010
  4. Lionel
    Replies:
    9
    Views:
    3,456
  5. M P
    Replies:
    1
    Views:
    500
Loading...

Share This Page