migrating from mysql to oracle9i.Equivalent create table syntax

Posted by Android_Crazy on Stack Overflow See other posts from Stack Overflow or by Android_Crazy
Published on 2012-03-27T11:24:40Z Indexed on 2012/03/27 11:29 UTC
Read the original article Hit count: 356

Filed under:
|

Hi Following is the syntax for creating table in mysql. I want to create table with same properties in oracle9i. Can anyone provide me the equivalent syntax for oracle?

 CREATE TABLE IF NOT EXISTS "tbl_audit_trail" (
      "id" int(11) unsigned NOT NULL,
      "old_value" text NOT NULL,
      "new_value" text NOT NULL,
      "action" varchar(20) CHARACTER SET latin1 NOT NULL,
      "model" varchar(255) CHARACTER SET latin1 NOT NULL,
      "field" varchar(64) CHARACTER SET latin1 NOT NULL,
      "stamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "user_id" int(11) NOT NULL,
      "model_id" varchar(65) CHARACTER SET latin1 NOT NULL,
      PRIMARY KEY ("id"),
      KEY "idx_user_id" ("user_id"),
      KEY "idx_model_id" ("model_id"),
      KEY "idx_model" ("model"),
      KEY "idx_field" ("field"),
      KEY "idx_old_value" ("old_value"(16)),
      KEY "idx_new_value" ("new_value"(16)),
      KEY "idx_action" ("action")
    ) AUTO_INCREMENT=168 ;

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about oracle9i