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
0
votes
1 answer

cannot drop database in postgres using terminal

I created a database with the name "femme-myp " in postgres. There was no problem while creation or while using tables in python Django. but when i try to drop the database in terminal it says there is an error in the name and it points at the "-"…
Pulath Yaseen
  • 395
  • 1
  • 3
  • 14
0
votes
1 answer

What's the problem with deleting a row from database?

I want to delete a row from my database, but it doesn't work. I've got 2 exception: - NumberFormatException: null (it's for the parseInt part in the Servlet) - PSQLException: ERROR: relation "patients" does not exist... but it does exist! Can u…
vv_wow
  • 23
  • 4
0
votes
1 answer

Function to return SETOF Table in Postgres

I'm trying to build a simple function that meets the following criteria (needed to work with Hasura API fwiw link) Function behaviour: ONLY STABLE or IMMUTABLE Return type: MUST be SETOF Argument modes: ONLY IN This is the…
Adam12344
  • 1,043
  • 16
  • 33
0
votes
1 answer

Postgres: why do I need to quote column name in max()?

So I encountered the following behaviour which surprised me. I first thought DateTime might be a postgres data type but what about BidOpen? Then there is the funny thing with the case of the column name in the error message. I almost feel this has…
s5s
  • 11,159
  • 21
  • 74
  • 121
0
votes
1 answer

Create view in ORACLE

Is there any different between below two statements Statement one: CREATE OR REPLACE VIEW ABC AS SELECT "ORDER_NO","OBJKEY" FROM TEST_TABLE; Statement two: CREATE OR REPLACE VIEW ABC AS SELECT ORDER_NO,OBJKEY FROM TEST_TABLE; Second statement…
Bear
  • 3
  • 1
0
votes
0 answers

Is there a way to insert a camelcase table name in pgadmin?

I have a DB with table names written in underscore format. I want to edit their names and also to be able to name every new table in a camelcase format Still, whenever I use a query to call a camelcase table name I have to do it using double quotes.…
Prometheus
  • 999
  • 2
  • 15
  • 28
0
votes
0 answers

SybaseIQ: Drop Table with special character

I'm trying to delete a table named DBA.[ in Sybase IQ database. This is a wrong table which is not desired so we need to delete it. I've tried several options but not successful. Please share any workaround to drop the table, if anyone knows. iqisql…
0
votes
3 answers

Why am I getting syntax error at or near "@"

When trying to join two tables and update one of them, I'm receiving an unexpected error from this function right here: CREATE OR REPLACE FUNCTION tsi.update_data(_creation_time int) RETURNS VOID AS $$ BEGIN EXECUTE format($sql$ UPDATE…
Jesper
  • 2,044
  • 3
  • 21
  • 50
0
votes
0 answers

set ansi_nulls and quoted_identifier on dynamically

I have a lot of scripts to run on a new database for creating all the stored procedures we need. Problem: none of those scripts are setting ANSI_NULLS ON or QUOTED_IDENTIFIER ON and I need to set them on for every stored procedure Is there a way to…
DJPB
  • 5,429
  • 8
  • 30
  • 44
0
votes
0 answers

postgres table does not exist, but actually it does

I am facing problem similar to this question, I have restored this database from a dump. Here is my problem, test_api=# \d+ List of relations Schema | Name | Type | Owner | …
Luv33preet
  • 1,686
  • 7
  • 33
  • 66
0
votes
1 answer

Periods in table names causing errors

I am trying to update a table in pgadmin 3 (postgres 9.4) called: assay.Luminex.Luminex_GT_shared.Analyte I kept getting the error: ERROR: improper qualified name (too many dotted names): assay.luminex.luminex_gt_shared.analyte I have tested…
r3vdev
  • 315
  • 3
  • 10
0
votes
0 answers

ERROR: relation "foo" does not exist

I have a relation called 'serviceID', exist in PostgreSQL DB. when I run this code select * from serviceID ; I got this error: ERROR: relation "serviceID" does not exist why?
Hussein Saad
  • 151
  • 2
  • 15
0
votes
0 answers

PostgreSQL: accessing relation with "public" schema name

Using PostgreSQL 9.6, I created new table using pgAdmin under public schema. But to access the table, I can't use just the table name. If I use public."Book" then only the table is accessible. thrillio=# show search_path; search_path ------------- …
Pradeep
  • 1,057
  • 2
  • 9
  • 17
0
votes
1 answer

Strange case conversion in PostgreSQL 9.5.4

SELECT AVG(MY_AE_Actual) FROM MY_Data_Details results in an error: ERROR: column "my_ae_actual" does not exist LINE 1: SELECT AVG(MY_AE_Actual) FROM MY_Data_Details ^ HINT: Perhaps you meant to reference the column…
Paul
  • 25,812
  • 38
  • 124
  • 247
0
votes
1 answer

Double Quotes are being ignored by SQL Server when passed to a string variable

I wrote a Stored Procedure in SQL Server 2016 that generates XML File When creating XML file I need to specify encoding explicitly. That is why I added that explicit encoding to the result of the XML content. SELECT @SQLStr = 'SELECT N''
Data Engineer
  • 795
  • 16
  • 41
1 2 3
9
10