I have 3 users (schemas) in my database. User A holds table X I created a view Y for user B and a view Z for user C. The views are identical: The first view works fine; for the second one I have the following error when trying to see data (from SQL developer): ORA-04063: view “User_C.Z” has errors…
google bigquery select from a timestamp column between now and n days ago
I have a dataset in bigquery with a TIMESTAMP column “register_date” (sample value “2017-11-19 22:45:05.000 UTC” ). I need to filter records based on x days or weeks before today criteria. Example query select all records which are 2 weeks old. Currently I have this query (which I feel…
Initcap of word
I’m having a table x it contain the column resource_name in this column I’m having data like NASRI(SRI). I’m applying initcap on this column it’s giving output Nasri(sri). But my expected output is Nasri(Sri). How I can achieve the desired result? Thank you Answer One possible solution…
Java JDBC – PreparedStatement executeUpdate() always returns 1
Currently I’m working on a code in java that retrieves data from XML files located in various folders and then uploads the file itself and the data retrieved to a SQL-server Database. I don’t want to upload any repeated XML file to database but since the files can have random names I’m check…
Android Room Persistence Library – How to find entities with ids contained in list of ids?
I am trying to do the following query in my DAO. @Query(“SELECT * FROM objects WHERE obj_id IN :ids”) List queryObjects(List ids); It gives me this compile-time …
SQL – return each column and it’s sum as rows
I have a table like this: date | employee_id | field1 | field2 | field3 | … | fieldN I need a select which will return something like: field1 | SUM(field1) field2 | SUM(field2) field3 | SUM(…
how does ‘ ‘ i.e single quote space single quote work in sql?
I observed that this query returns all values from the database. Why is that? Answer This query: Would not be valid in most databases. Some interfaces concatenate adjacent strings, so this is interpreted as: The two wildcards are the same as one. This will match every non-NULL value. If you want to find email…
tlogcatcher component not catching error for tMSSqlRow read error
I develop some jobs with Talend, and use Tlogcatcher to record errors on a database. It seems working for all jobs except one. Here is how it work: The first SQL connection read SQL statement from a database table, and for each of them, the tMSSqlRow read and execute it. But when SQL failed (i.e delete not po…
Release of a SELECT… FOR UPDATE lock
My question is very simple: what is the inverse SQL statement for SELECT ID FROM TABLE FOR UPDATE NOWAIT? How do I release a lock during the same transaction that acquired it before committing? Expanding: I am writing portable API code that leverages Hibernate to apply row-level locks to entities. The followi…
PostgreSQL json_array_elements with array indexes (keys)
Simple query works fine: But I also want to retrieve array keys somehow so the output would be like: UPD Seems like row_number() is a p̶r̶o̶p̶e̶r̶ solution, but I cannot figure out how to use it further. Lets say i have ‘posts’ table, each post contains an array of related comments in JSON format:…