Skip to content

Conversation

jmjgemini
Copy link

Basically all Oracle databases I have seen automatically convert object names to uppercase, which makes us have to write ugly c# code like

public class Foo
{
    public string BAR{ get; set;}
}

or

public class Foo
{
    [Column("BAR")]
    public string Bar{ get; set;}
}

I think this option is necessary.

@ahmad-moussawi
Copy link
Contributor

Could you please point to some official docs for this?

@jmjgemini
Copy link
Author

jmjgemini commented Dec 17, 2021

Could you please point to some official docs for this?

Please read this Database Object Names and Qualifiers

This is the issue about quoted identifier and nonquoted identifier.

When we are using a GUI tool to create a table, such as PL/SQL Developer, it generates SQL like this:

create table BOOKS
(
	id raw(16) default sys_guid(),
	name varchar2(128)
)

In this case we can write SQL like

SELECT id, name FROM books;
-- or
SELECT iD,nAme from bOokS;
-- or
SELECT "ID","NAME" FROM "BOOKS";

and this is not worked

SELECT "Id", "Name" from "Books"

I found that DataGrip does better,it will automatic add quotes if your input is case sensitive.

create table "Books"
(
	"Id" raw(16) default sys_guid(),
	"Name" varchar2(128)
)

But we can not write SQL like this any more

SELECT id,name FROM books

So for all the Oracle users who is using nonquoted identifier, we have to override the Compiler to make the column names uppercase or remove the quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants