Short answer: this won’t compile as written.
Why:
- DBMS_PIPE.RECEIVE_MESSAGE is a procedure (it fills OUT parameters with the received message). Procedures don’t return a value that you can multiply.
- Therefore 555*DBMS_PIPE.RECEIVE_MESSAGE(...) is not valid syntax.
What you probably intend:
- Use a pipe named 'ccc' (CHR(99)||CHR(99)||CHR(99) = 'ccc'), receive the message into a variable, then, if it’s numeric, multiply by 555.
Example (two common forms; pick the one that matches your Oracle version):
If the signature is (pipe_name, message_out, timeout): DECLARE v_pipe VARCHAR2(30) := CHR(99)||CHR(99)||CHR(99); -- 'ccc' v_msg VARCHAR2(32767); v_num NUMBER; v_result NUMBER; BEGIN DBMS_PIPE.RECEIVE_MESSAGE(v_pipe, v_msg, 15); -- or: v_pipe, v_msg, 15 depending on your version v_num := TO_NUMBER(v_msg); v_result := 555 * v_num; DBMS_OUTPUT.PUT_LINE(v_result); END;
If the signature is (message_out, timeout) (less common for named pipes): DECLARE v_msg VARCHAR2(32767); v_num NUMBER; v_result NUMBER; BEGIN DBMS_PIPE.RECEIVE_MESSAGE(v_msg, 15); v_num := TO_NUMBER(v_msg); v_result := 555 * v_num; DBMS_OUTPUT.PUT_LINE(v_result); END;
Notes:
- CHR(99)||CHR(99)||CHR(99) yields 'ccc'.
- TO_NUMBER will raise an exception if the message isn’t a valid number.
- If you only want to receive and inspect the message, don’t multiply by 555 until after you’ve parsed it as a number.
