Questions tagged [quoted-identifier]

Use this tag for questions involving SQL delimited identifiers (quoted identifiers.)

In SQL, a delimited identifier (also referred to as "quoted identifier") is an identifier (name) enclosed in double quotes.

Delimited identifiers are special in two aspects:

• They can contain characters normally not supported in SQL identifiers. (E.g. "!# odd column name".)

• They can be identical to a reserved word. (E.g. "YEAR".)

Two consecutive double quotation marks within a delimited identifier are interpreted as one double quotation mark. (E.g. "12"" vinyl".)

SQL is by default case insensitive. To make an identifier (name) case sensitive it needs to be quoted. "Some_Table", "SOME_TABLE" and "some_table" are different names because they are quoted. The names some_table, SOME_TABLE and Some_Table are identical names because they are not quoted.

The SQL standard defines the double quote " as the quoting character (single quotes: ' are for string literals.) Some DBMS products deviate from the standard and allow alternative quoting characters. Microsoft SQL Server uses square brackets: [Some_Table] and MySQL uses backticks `Some_Table`.

148 questions
4
votes
1 answer

QUOTED IDENTIFIER error in SQL Server 2008 on SP execution

I have this error on executing stored procedure: INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or…
makambi
  • 1,100
  • 3
  • 13
  • 30
4
votes
1 answer

Error: Column does not exist

I have been able to link PostgreSQL to java. I have been able to display all the records in the table, however I unable to perform delete operation. Here is my code: con = DriverManager.getConnection(url, user, password); String stm = "DELETE FROM…
user2128318
  • 47
  • 1
  • 5
4
votes
1 answer

Implementing QUOTED_IDENTIFIER globally

I've implemented a mechanism with the help of SqlDependency that alerts me of any changes in a particular database table. But this breaks my existing functionality where I'm updating the database table on which I've implemented SqlDependency. I'm…
3
votes
0 answers

Make Postgres identifiers case sensitive without quoting

I'm trying to migrate a legacy MySQL database into Postgres using Pgloader. I'm trying to think of a relatively robust way to find a way to convert the existing SQL queries to work with the new database with the least amount of manual…
Janne Annala
  • 25,928
  • 8
  • 31
  • 41
3
votes
1 answer

Raw SQL in Postgres with EntityFramework Core

Say I have a customer table and would like to make a query with raw SQL. The below code does not work: List customers = _db.Customer.FromSql("SELECT * FROM Customer").ToList(); It fails with the error code '42P01: relation "customer"…
Thorkil Værge
  • 2,727
  • 5
  • 32
  • 48
3
votes
0 answers

Google Data Studio: Column Does Not Exist error on using date field from PostgreSQL data source

Hoping for some help with an issue in Google Data Studio. I'm trying to create a time graph that contains cumulative and monthly account creations using data from my Postgres database. I am connecting to a data source that uses custom SQL to pull…
DTuffy
  • 71
  • 2
  • 4
3
votes
2 answers

how to insert the value having double quotes in the database?

insert into sent_message (user_id,subject,message,background_url,total_recipients,created_at) values ('115','Greeting','Hx z'xi','/images/default/1.jpg',2,'2015-07-23 10:48:41') For the message column i have used the value with single quotes hence…
Mani Kandan
  • 699
  • 1
  • 10
  • 30
3
votes
2 answers

How do I use quoted identifier for user + table name combination in Oracle?

In my Oracle DB setup all the tables are created under dedicated user account SYS0MYUSER. When executing following query on my system I got SQL Error: ORA-00903: invalid table name SELECT COUNT(*) FROM SYS0MYUSER.USER; I tried to escape the…
tommyk
  • 3,187
  • 7
  • 39
  • 61
3
votes
4 answers

"syntax error at or near 'order'"" in PostgreSQL

I'm trying to add a column named order to my table. I realize that order is a reserved word in SQL. So, how do I do it? My command: alter table mytable add column order integer; I've also tried: alter table mytable add column 'order'…
ed_is_my_name
  • 601
  • 3
  • 9
  • 24
3
votes
1 answer

EXEC and Set Quoted_Identifier

I've got a Stored proc [A] that creates another stored proc [B] [A] Will never be run by end users and has no parameters or other untrusted data. Instead it is used by me simply to automate the create of the complex SP [B]. [A] Will always have the…
DJL
  • 2,060
  • 3
  • 20
  • 39
3
votes
3 answers

Changing Quoted_Identifier on existing Constraints / Rules / Procedures

I am currently working with an old-ish database on a 2008-r2 Server which uses a lot of objects that were created with Quoted Identifier set to off. I am mainly looking at these…
3
votes
3 answers

Postgres with Java I can't insert data

I tried to make an insert to my postgres database with Java. I have default configuration for my local database. I want to put some data in a table and I have some issues. Here is the code : import java.sql.Connection; import…
Thanassis
  • 857
  • 1
  • 8
  • 25
2
votes
1 answer

Selecting numeric named columns in PostgreSQL returns ?column?

I am using PostgreSQL 13.7 (Debian 13.7-0+deb11u1) and have the following table: CREATE TABLE public.meterdata ( "0.0.0" numeric(8,0) NOT NULL, "0.9.1" numeric(7,0) NOT NULL, "0.9.2" numeric(7,0) NOT NULL, "1.2.0" real, "1.6.0" real NOT…
Christoph Lösch
  • 645
  • 7
  • 22
2
votes
2 answers

ERROR: syntax error at or near "." LINE 4: ON like.takerId = frame.likeId;

i have a table whose name is like. But whenever i have to select data from like, i was getting this error, i figured it out public.like..but when i try to join two tables SELECT * FROM frame INNER JOIN public.like ON like.takerId = frame.likeId; i…
Tanay Pingalkar
  • 300
  • 4
  • 9
2
votes
1 answer

Postgres solving a syntax error caused by a dash (-)

I am trying to query from a database called physionet-data.mimiciii_clinical.diagnoses_icd PostgresSQL returns the following error message: quan.sql:273: ERROR: syntax error at or near "`" LINE 132: from…
1
2
3
9 10