Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01427: single-row subquery returns more than one row

Quanwen ZhaoJun 16 2019 — edited Jun 21 2019

Hello, guys and friends

I run this SQL on my Oracle Database Server 11.2.0.4.0 on SQL*Plus utility,

SET ECHO      ON

SET HEADING   ON

SET FEEDBACK  ON

SET VERIFY    ON

SET LINESIZE 250

SET PAGESIZE 250

SELECT

      (SELECT host_name FROM v$instance)

      || ', ' ||

      (SELECT value FROM v$parameter WHERE name = 'db_unique_name')

      || ', ' ||

      (SELECT

              start_time || ', ' ||

              end_time || ', ' ||

              output_device_type || ', ' ||

              status || ', ' ||

              input_type || ', ' ||

              ltrim(input_bytes_display) || ', ' ||

              ltrim(output_bytes_display) || ', ' ||

              ltrim(input_bytes_per_sec_display) || ', ' ||

              ltrim(output_bytes_per_sec_display) || ', ' ||

              time_taken_display

       FROM  v$rman_backup_job_details

       WHERE output_device_type = 'DISK'

       -- AND To_Char(start_time,'dd-mm-yy') = To_Char(sysdate - 1,'dd-mm-yy')

      )

FROM dual

/

ERROR at line 6:

ORA-01427: single-row subquery returns more than one row

This error ORA-01247 indicates that the 3rd SELECT statement for v$rman_backup_job_details should return the value of more than one row.

If I use PL/SQL how to implement this function/requirement? Thanks in advance.

Best Regards

Quanwen Zhao

This post has been answered by Cookiemonster76 on Jun 17 2019
Jump to Answer
Comments
Post Details
Added on Jun 16 2019
12 comments
13,331 views