I've got a table which labeled a col...sigh... date.
Does presto have a setting similar to hive that allows for keywords to be escaped?
e.g. a presto variant of:
set hive.support.sql11.reserved.keywords=false;
Related
complete newbie in PrestoDb here. I'm following documentation and can create a table with several types, but when I come to create timestamps with timezones or intervals I cant create them from dbeaver on my presto 0.252, I get syntax errors. (using driver 0.273.3)
However i can create them on the underlying PostgreSQL that i use. However the timestamptz gets shown as timestamp in presto, and the interval doesnt shown as a column at all. I`m missing something here, isnt it listed as a supported type? Should i workaround it storing it as varchar and then cast it?
I have a RedShift COPY command which is executed as SQL:-
COPY some_schema.some_table FROM 's3://a-bucket/home/a_file.csv' CREDENTIALS 'aws_access_key_id=SOMEKEY;aws_secret_access_key=SOMESECRETKEY' IGNOREHEADER 1 CSV DATEFORMAT 'YYYY-MM-DD' NULL 'NOT-CAPTURED'
The data I need to import has a date column with occasional occurrences of 'NOT-CAPTURED'. The addition of the NULL option allows these to be treated as null and prevents a load error. This apparently worked.
Can this statement be extended to treat multiple types of occurrence as null? I have 'N.A' in a date column in a similar file and would like to use a common statement?
I have tried obvious variations to provide more than one value to replace as null such as NULL 'NOT-CAPTURED','N.A' and couldn't find any documentation covering it.
Thanks!
Is there any way I can create a mixed case table name in Oracle without using quotes?
The table names change to uppercase if I do not use quotes while creating the table.
Let me know if you need more information.
Eg:
create table testTable(testColumn varchar);
This creates a table named TESTTABLE with column name TESTCOLUMN.
I can use quotes, but it makes it more messy and difficult to write queries.
Can you please let me know how I can do this without using quotes? Thanks.
Regards,
Sawan
Please refer to the official Oracle Database documentation:
"Nonquoted identifiers are not case sensitive. Oracle interprets them as uppercase."
https://docs.oracle.com/en/database/oracle/oracle-database/20/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-3C59E44A-5140-4BCA-B9E1-3039C8050C49
All the data dictionary views will show the identifiers as Oracle interprets them. In other words, without quotes everything will be uppercase. I can testify that this is true even for accented characters.
You can't always get what you want...
I have a JSON which I am trying to parse in HIVE using get_json_object built-in function. In my JSON there is a key like "timestamp", where my parsing is failing because "timestamp" is identified as a keyword.
I am trying to use select get_json_object(col1,'$.timestamp') as ts from table1.
How can the keyword be handled while using get_json_object in HIVE?
Run this to have the keywords ignored.
SET hive.support.sql11.reserved.keywords=false;
I got a SQLITE database in android application. In order to increase application performance i want to do some refinement on DB before adding it to android app.
In order to do this:
I want to remove/replace special characters in Name field of Account table.
Unicode of those special characters are in range 8204-8207 (0x200C ~ 0x200F).
What is the correct SQL syntax to update Account Table?
SQLite supports the REPLACE function. See this documentation: http://sqlite.org/lang_corefunc.html
Therefore, you should be able to do something like this:
UPDATE Account
SET Name= REPLACE(Name,'char-to-replace','replacement');