Skip to content

Tag: oracle

ora-00900 invalid sql statement execute immediate

I am trying to solve a task with a dynamic SQL, but facing an issue ora-00900 invalid sql statement. However, it works in the anonymous block treating the statement to be executed as a string. So where is the issue in the first case? It looks like with escape quotes, but can’t catch this. Answer As the error …

identifier ‘NEW.CITY_POPULATION’ must be declared

I am trying to declare a oracle trigger that will update the city name when the city population reaches 0 but I am getting this error. Answer If you’re going to reference the :new pseudo-record in a trigger body, it needs to be prefixed with a colon. A trigger on cities generally cannot query the cities…

How to convert decimal values to time values in oracle?

I have a table that is formatted like this: I want the output to be like this: Basically transform the values in the dec_time field into time values like the example above in new_dec_time. This is my SQL so far: This simply changes replaces the decimal point with the semicolon but doesnt add the 0s where need…