Dayakar,
----- Original Message ----- From: ""Dayakar"" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Sunday, November 21, 2004 7:39 AM
Subject: Help needed in creating primary key ,foreign key on a varchar datatype colum
------=_NextPart_000_000B_01C4CFBA.91C9BA80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
I am converting my database from oracle to mysql4.1 and i want the same = structure as it is oracle like primary key and foreign key references = etc..=20
In oracle i have created my primary key and foreign key references on a = varchar datatype column, so can any one help me in doing the same in = mysql. I have tried doing the same by seeing the examples given in mysql = manual but not successfull.
If any one can help me by giving a example then it would be great help = for me.
[EMAIL PROTECTED]:~/mysql-4.1/client> ./mysql test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.8-debug-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE TABLE t(a VARCHAR(100) NOT NULL PRIMARY KEY, b INT) TYPE = INNODB;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> CREATE TABLE t1(a1 INT NOT NULL PRIMARY KEY, b1 VARCHAR(50), FOREIGN KEY
(b1) REFERENCES t(a)) TYPE=INNODB;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>
regards dayakar
Best regards,
Heikki Tuuri
Innobase Oy
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables
http://www.innodb.com/order.php
Order MySQL technical support from https://order.mysql.com/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]