How to use select dbms_output.put_line('first_line'); in anonymous block?

46 views
Skip to first unread message

Shaburov Alexander

unread,
Apr 7, 2021, 6:22:09 AM4/7/21
to orafce-...@googlegroups.com

Hi!
This code has error. How to use dbms_output.put_line in here? Thank you!

do
$do$
declare
ch varchar(200);
BEGIN
ch:='hello, world!';
select dbms_output.serveroutput('t');
select dbms_output.put_line(ch);
END
$do$;

Pavel Stehule

unread,
Apr 7, 2021, 6:23:28 AM4/7/21
to orafce-...@googlegroups.com


st 7. 4. 2021 v 12:22 odesílatel Shaburov Alexander <alex...@gmail.com> napsal:
you should to use PERFORM instead SELECT


Regards

Pavel

--
You received this message because you are subscribed to the Google Groups "Better Oracle functions support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orafce-genera...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orafce-general/e2573fb4-6f11-74e3-58bf-cc13d685b88b%40gmail.com.

Shaburov Alexander

unread,
Apr 7, 2021, 6:30:35 AM4/7/21
to orafce-...@googlegroups.com, Pavel Stehule

Thank you!

Next question if possible: How to suppress in output phrase DO?

do
$do$
declare
 ch varchar(200);
BEGIN
  ch:='hello, world!';

  perform dbms_output.serveroutput('t');
  perform dbms_output.put_line(ch);
END
$do$;

OUTPUT:

hello, world!
DO

07.04.2021 13:22, Pavel Stehule пишет:

Pavel Stehule

unread,
Apr 7, 2021, 6:43:16 AM4/7/21
to Shaburov Alexander, orafce-...@googlegroups.com


st 7. 4. 2021 v 12:30 odesílatel Shaburov Alexander <alex...@gmail.com> napsal:

Thank you!

Next question if possible: How to suppress in output phrase DO?

do
$do$
declare
 ch varchar(200);
BEGIN
  ch:='hello, world!';
  perform dbms_output.serveroutput('t');
  perform dbms_output.put_line(ch);
END
$do$;

OUTPUT:

hello, world!
DO



\set QUIET 1
DO $$
...
$$

Pavel

Shaburov Alexander

unread,
Apr 7, 2021, 6:45:08 AM4/7/21
to Pavel Stehule, orafce-...@googlegroups.com
Thank you very much!   :)

07.04.2021 13:42, Pavel Stehule пишет:
> \set QUIET 1

Pavel Stehule

unread,
Apr 7, 2021, 6:46:53 AM4/7/21
to Shaburov Alexander, orafce-...@googlegroups.com
:)

Pavel

st 7. 4. 2021 v 12:45 odesílatel Shaburov Alexander <alex...@gmail.com> napsal:
Reply all
Reply to author
Forward
0 new messages