Skip to content

ORA-04063: view has errors

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…

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…

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…

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:…