Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql Oracle数据库中的Ascii字符问题_Sql_Oracle_Oracle11g - Fatal编程技术网

Sql Oracle数据库中的Ascii字符问题

Sql Oracle数据库中的Ascii字符问题,sql,oracle,oracle11g,Sql,Oracle,Oracle11g,我在Oracle sql Developer中运行sql脚本时遇到问题 有一个关于无效字符的问题 我怎样才能修好它 CREATE TABLE `users_roles` ( `user_id` int(11) NOT NULL, `role_id` int(11) NOT NULL, PRIMARY KEY (`user_id`,`role_id`), KEY `FK_ROLE_idx` (`role_id`), CONSTRAINT `FK_USER_05` FORE

我在Oracle sql Developer中运行sql脚本时遇到问题

有一个关于无效字符的问题

我怎样才能修好它

CREATE TABLE `users_roles` (
  `user_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,

  PRIMARY KEY (`user_id`,`role_id`),

  KEY `FK_ROLE_idx` (`role_id`),

  CONSTRAINT `FK_USER_05` FOREIGN KEY (`user_id`) 
  REFERENCES `user` (`id`) 
  ON DELETE NO ACTION ON UPDATE NO ACTION,

  CONSTRAINT `FK_ROLE` FOREIGN KEY (`role_id`) 
  REFERENCES `role` (`id`) 
  ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Error report -
ORA-00911: invalid character
00911. 00000 -  "invalid character"
*Cause:    identifiers may not start with any ASCII character other than
           letters and numbers.  $#_ are also allowed after the first
           character.  Identifiers enclosed by doublequotes may contain
           any character other than a doublequote.  Alternative quotes
           (q'#...#') cannot use spaces, tabs, or carriage returns as
           delimiters.  For all other contexts, consult the SQL Language
           Reference Manual.

您的语句使用了MySQL语法。在Oracle中,这看起来更像:

CREATE TABLE users_roles (
  user_id int not null,
  role_id int not null,

  PRIMARY KEY (user_id, role_id),

  CONSTRAINT FK_USER_05 FOREIGN KEY (user_id) REFERENCES users (id),

  CONSTRAINT FK_ROLE FOREIGN KEY (role_id) REFERENCES roles (id)
);

CREATE INDEX idx_users_roles_role_id ON users_roles(role_id) ;

是一个数据小提琴。

删除数据线