0

I can see tables and can write a SQL query via sql developer (23.1) connected to a postgresql database. I try to execute an anonymous block to display a variable in the output script :

DO $$
DECLARE
  c_200 CONSTANT INTEGER := 200;
BEGIN
   RAISE NOTICE 'Constante : %', c_200;
END;
$$;

After execution, more lines then the code iself... :

Erreur commençant à la ligne: 1 de la commande -
DO $$
Rapport d'erreur -
ERREUR: chaîne entre guillemets dollars non terminée sur ou près de « $$ »
  Position : 4

Erreur commençant à la ligne: 2 de la commande -
DECLARE
  c_200 CONSTANT INTEGER := 200;
BEGIN
   RAISE NOTICE 'Constante : %', c_200;
END;
$$;
Rapport d'erreur -
Unterminated dollar quote started at position 92 in SQL DECLARE
  c_200 CONSTANT INTEGER := 200;
BEGIN
   RAISE NOTICE 'Constante : %', c_200;
END;
$$;. Expected terminating $$
3
  • You are using a client that does not understand about PostgreSQL dollar quoting. Use something better. Commented Apr 15, 2024 at 12:10
  • or use single quotes instead of doule dollar. Double the quotes around ''Constante : %'' Commented Apr 15, 2024 at 12:17
  • Thanks but not working, and no correct response for SQL Developer client in stackoverflow.com/questions/27779235/…. Solution : do not use SQL dev for that... Commented Apr 15, 2024 at 13:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.