I have a oracle table called MYTABLE , with a prog_model column.
I am trying the CASE (if oracle) to insert some spaces into my prog_model depending of the string length.
My issue is that I'm getting ORA-00936 error missing expression ligne 3 c18 I have no idea where it comes from being a super noob in SQL, any ideas?
Here is my .sql :
SELECT prog_model,
CASE Length(prog_model)
WHEN 11 THEN Insert(' ',2,3,prog_model)
WHEN 12 THEN Insert(' ',2,3,prog_model)
WHEN 13 THEN Insert(' ',2,3,prog_model)
END
FROM MYTABLE;
EDIT:
Basically in prog_model I always have a string from 11 to 14 characters :
if 11 chars , "ABCEFGHIJKL" --> "ABC_ _ _EFGHIKL"
if 12 chars , "ABCEFGHIJKLM" --> "ABC_ _EFGHIJKLM"
insert()function in Oracle. Oracle doesn't have this. From looking at the MySQL docs, it seemsprog_modelshould be the first argument - however I don't know exactly what you need it to do.