oracle使用bug,字段名、表名 不应该用双引号 #265

Closed
opened 2015-07-02 09:02:46 +00:00 by zihuxinyu · 8 comments
zihuxinyu commented 2015-07-02 09:02:46 +00:00 (Migrated from github.com)

oracle使用时字段名、表名 不应该用双引号
github.com/go-xorm/xorm/oracle_dialect.go

SELECT user_code, user_name FROM ext_dpt_usr 直接这样就可以的。

func (db *oracle) Quote(name string) string {
return name
}

func (db *oracle) QuoteStr() string {
return ""
}

oracle使用时字段名、表名 不应该用双引号 github.com/go-xorm/xorm/oracle_dialect.go SELECT user_code, user_name FROM ext_dpt_usr 直接这样就可以的。 func (db *oracle) Quote(name string) string { return name } func (db *oracle) QuoteStr() string { return "" }

不应该吗?

不应该吗?
zihuxinyu commented 2015-07-07 09:21:22 +00:00 (Migrated from github.com)

不应该,加了没法运行。

不应该,加了没法运行。
zihuxinyu commented 2015-07-07 09:24:00 +00:00 (Migrated from github.com)

select user_name from EXT_DPT_USR t 可以执行
select "user_name" from EXT_DPT_USR t 不能执行,
如下所示
2015-07-07 17 22 15

select user_name from EXT_DPT_USR t 可以执行 select "user_name" from EXT_DPT_USR t 不能执行, 如下所示 <img width="614" alt="2015-07-07 17 22 15" src="https://cloud.githubusercontent.com/assets/3365229/8543076/e848a93e-24cc-11e5-80b7-5cb999198712.png">

是不是要所有的都加引号就可以?

是不是要所有的都加引号就可以?
zihuxinyu commented 2015-07-08 12:12:10 +00:00 (Migrated from github.com)

@lunny 不行的,不能加引号。我使用的pl/sql测试的。

@lunny 不行的,不能加引号。我使用的pl/sql测试的。
hoop33 commented 2017-03-16 19:42:33 +00:00 (Migrated from github.com)

我可以确认.

它不工作来运行查询

它的工作原理如果我改变代码如上所示

Oracle 版 "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production"

我可以打开拉请求

对不起,我不会说中文

我正在使用谷歌翻译

我可以确认. 它不工作来运行查询 它的工作原理如果我改变代码如上所示 Oracle 版 "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production" 我可以打开拉请求 对不起,我不会说中文 我正在使用谷歌翻译

Which quotes should oracle use? I think it's ready to resolve this issue since dialect's QuoteStr has been removed. @BetaCat0

Which quotes should oracle use? I think it's ready to resolve this issue since dialect's `QuoteStr` has been removed. @BetaCat0
slowaner commented 2019-08-22 06:42:45 +00:00 (Migrated from github.com)

Oracle uses double quote but if you use quotes you should capitalize identifiers. "USER_NAME" instead of "user_name". If you don't use quotes then oracle automatically capitalizes identifiers.
Please fix bug with quotes. Current version (with square brackets) don't work either.

P.S. Oracle keeps all objects names (and column names) in uppercase.

Oracle uses double quote but if you use quotes you should capitalize identifiers. "USER_NAME" instead of "user_name". If you don't use quotes then oracle automatically capitalizes identifiers. Please fix bug with quotes. Current version (with square brackets) don't work either. P.S. Oracle keeps all objects names (and column names) in uppercase.
lunny modified the milestone from (deleted) to 1.0.0 2020-03-03 12:49:56 +00:00
lunny closed this issue 2020-03-03 13:18:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#265
No description provided.