Toad World® Forums

Three rows inserted in a field

The topic is the field receives 3 rows from other tables

I want to insert a row from a first table and two rows from a second table, and are inserted into a third table but in a single field.

The field receives the three complete rows.

The status field receives the 3 rows

I have the following error:

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

Do I insert the 3 rows into a single field?

INSERT INTO tablac3

(historico, iduno, codigouno, numero, clave, nombreEjecutivo, fecha, modo, status )

VALUES

(lasecuencia.nextval, 22, ‘TEST’, ‘qaz123’, ‘edc456’, ‘paquita’, ‘11/06/2017’, ‘rfv’,

(select C.Nombre from tablita c, tablota p WHERE c.identificador = 5 AND p.identificador = 5) );

thank you

I have copied your script.

Check the part I ** highlighted in yellow****,** run that script by itself and see what it returns. It is perhaps returning duplicates which you have to do something to the query to stop that. (i.e. more criteria, find max, etc)

If possible run this as well as a test

select lasecuencia.nextval, ‘22’ xx, ‘TEST’ xxxx, ‘qaz123’ xxx123 , ‘edc456’ v456, ‘paquita’ v_quita, ‘11/06/2017’ v_date, ‘rfv’ v_rfv,

**
(select C.Nombre from tablita c, tablota p WHERE c.identificador = 5 AND p.identificador = 5)**

**from dual; **

INSERT INTO tablac3

(historico, iduno, codigouno, numero, clave, nombreEjecutivo, fecha, modo, status )

VALUES

(lasecuencia.nextval, 22, ‘TEST’, ‘qaz123’, ‘edc456’, ‘paquita’, ‘11/06/2017’, ‘rfv’,

**(select C.Nombre from tablita c, tablota p WHERE c.identificador = 5 AND p.identificador = 5) ); **

On Fri, Aug 11, 2017 at 12:03 PM, antoine_mc1 bounce-antoine_mc1@toadworld.com wrote:

Three rows inserted in a field

Thread created by antoine_mc1
The topic is the field receives 3 rows from other tables

I want to insert a row from a first table and two rows from a second table, and are inserted into a third table but in a single field.

The field receives the three complete rows.

The status field receives the 3 rows

I have the following error:

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

Do I insert the 3 rows into a single field?

INSERT INTO tablac3

(historico, iduno, codigouno, numero, clave, nombreEjecutivo, fecha, modo, status )

VALUES

(lasecuencia.nextval, 22, ‘TEST’, ‘qaz123’, ‘edc456’, ‘paquita’, ‘11/06/2017’, ‘rfv’,

(select C.Nombre from tablita c, tablota p WHERE c.identificador = 5 AND p.identificador = 5) );

thank you

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for Oracle Forum notifications altogether.

Toad for Oracle - Discussion Forum

Flag this post as spam/abuse.


Gene L. Bradley Jr.

Systems Analyst

Office of Information Technology

Jackson State University

1400 J R Lynch Street

P.O. Box 17750

Jackson, MS 39217

ph 601.979.1042

fax 601.371.9146

email gbradley@jsums.edu

*In God we trust; all others bring data. * ~W.E. Deming

CONFIDENTIALITY STATEMENT

This electronic transmission is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone (601) 979-1042. Thank you.