Обсуждение: Display message to user
<div class="Section1"><p class="MsoNormal">Hi all,<p class="MsoNormal"> <p class="MsoNormal">I am a Postgres-newbie and workingon porting our code from Oracle to Postgres.<p class="MsoNormal">Oracle has a nice package procedure (dbms_output.put_line)to display a message in SQL*Plus, which can display a message to the user. I use this a lot, to notifyusers of the progress being made during the execution of a script. <p class="MsoNormal">Is there a way to do this withPostgres as well?<p class="MsoNormal"> <p class="MsoNormal">I have tried using ‘RAISE NOTICE’, but using this some extralines are printed on screen. Those extra lines mess up the screen and will confuse the users. The extra lines shownare:<p class="MsoNormal"> <p class="MsoNormal">CONTEXT: SQL statement "SELECT migration_pkg.time_migration( $1 , $2 )"<p class="MsoNormal">PL/pgSQL function "check_migration" line 34 at PERFORM<p class="MsoNormal"> <p class="MsoNormal">Anyhelp would be appreciated,<p class="MsoNormal"> <p class="MsoNormal"><b><span lang="NL" style="font-size:10.0pt;font-family:"Arial","sans-serif"; color:#1B5DA7">Bart van Houdt</span></b><p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial","sans-serif"; color:black">Syfact International B.V.</span><p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial","sans-serif"; color:black">Database developer</span><p class="MsoNormal"> </div>
De: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] En nombre de Bart van Houdt
Enviado el: Martes, 04 de Noviembre de 2008 10:32
Para: pgsql-sql@postgresql.org
Asunto: [SQL] Display message to userHi all,
I am a Postgres-newbie and working on porting our code from Oracle to Postgres.
Oracle has a nice package procedure (dbms_output.put_line) to display a message in SQL*Plus, which can display a message to the user. I use this a lot, to notify users of the progress being made during the execution of a script.
Is there a way to do this with Postgres as well?
I have tried using ‘RAISE NOTICE’, but using this some extra lines are printed on screen. Those extra lines mess up the screen and will confuse the users. The extra lines shown are:
CONTEXT: SQL statement "SELECT migration_pkg.time_migration( $1 , $2 )"
PL/pgSQL function "check_migration" line 34 at PERFORM
Any help would be appreciated,
Bart van Houdt
Syfact International B.V.
Database developer
Bart van Houdt wrote: > Oracle has a nice package procedure (dbms_output.put_line) to display a > message in SQL*Plus, which can display a message to the user. I use this > a lot, to notify users of the progress being made during the execution > of a script. > > Is there a way to do this with Postgres as well? If you use the orafce module from pgfoundry, you get that same function.