Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Thursday, April 26, 2007

Oracle sucks, part 2 of 1000: setting variables

you don't use SET to set variables values
SET variable_name = value;

this will give you a "ORA-00922: missing or invalid option"

you set variables Delphi style

variable_name := value;

Oracle sucks, part 1 of 1000:executing queries vs scripts

I just have to blog this to remember in the future, and hopefully blog about other countless issues with Oracle

This applies to running multiple statements to create functions, views, etc

When running as a query:
when creating or replacing functions, include ";", at the end, then a "/" on the next line
when creating or replacing views, don't include the ";", but include "go"

otherwise you'll get things like
" Warnings: --->
W (1): Warning: execution completed with warning
<--- "

"[Error] Script lines: 639-664 ----------------------
ORA-06575: Package or function FUNCTION_NAME is in an invalid state"

and your functions/views won't be modified

when running as a script, everything needs ";" at the end