Skip to content
Advertisement

Tag: sql-function

Replace function in SQL Server

I have a string of data I am trying to use the replace function to replace double commas with NULL values Solution But I keep ending up with (The ,,, needs to become ,NULL,NULL, but only becomes ,NULL,,) Here is my sample code I’m using Answer If you do the same replacement twice, any number of sequential commas will get

Wrong number or types of arguments in call to ‘||’

We are supposed to read a text file, insert that data into a table while taking care of exceptions. This the code for my function: This is how i’ve called the function (but i think it’s wrong): And this is the error I’ve got: I tried to remove the results in the dbms_output and this is what happened: After running

ORACLE SQL How to use custom function iside insert cte

I am trying to use function inside insert SQL, but I am getting error ORA-32034. Looks like that I couldn’t access this function in the cte. Maybe someone can help? Answer If the query containing the PL/SQL declaration section is not the top level query, the top-level query must include the WITH_PLSQL hint. Without this hint, the statement will fail

Average of Sum minus Minimum

I have an SQL statement that grabs the grades of different activity types (Homework, Quiz, etc), and if there’s a drop lowest for that type, it drops, else, it remains. The errors are below as well as the SQL Code. Here are the errors I’m getting: Answer Look into analytical functions. (SO question, Oracle documentation). Something like this: and: Set

Advertisement