Getting the following error with the following line of code:
RAISE NOTICE '*** Rolling back job run id ' || CONVERT(varchar, v_job_run_id)
|| ' for table ' || v_table_name || '***';
Error:
ERROR: syntax error at or near "|" LINE 43: RAISE NOTICE '*
Rolling back job run id ' || CONVERT(var...
Description. The PostgreSQL || operator allows you to concatenate 2 or more strings together.
RAISE EXCEPTION in PostgreSQL is basically used to raise the warning and error message. It is very useful and important. There are six levels of raise exception is available in PostgreSQL, i.e. notice, log, debug, warning info and exception. It is used in various parameters.
In PostgreSQL, the dollar-quoted string constants ($$) is used in user-defined functions and stored procedures. In PostgreSQL, you use single quotes for a string constant like this: select 'String constant'; When a string constant contains a single quote ('), you need to escape it by doubling up the single quote.
A message string in RAISE XXXX statement should be literal constant - expression is not allowed there. It is similar to format string in printf like functions.
RAISE NOTICE 'my table has name %', tablename;
Second issue should be "CONVERT", that is not supported in Pg - use CAST instead or nothing, any parameter of RAISE statement is converted to text automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With