tested on 11.2.0.4 and 12.1.0.1 on Linux x64:
#!/bin/bash SQLFILE=/var/tmp/subqueries.sql echo "select * from ( " > ${SQLFILE} for x in {1..100000} do if [ $x == "100000" ]; then echo "select * from dual )" >> ${SQLFILE} else echo " select * from ( " >> ${SQLFILE} fi done for x in {1..99999} do echo ")" >> ${SQLFILE} done
execute the generated /var/tmp/subqueries.sql script:
@/var/tmp/subqueries.sql 200001 ; select * from ( * ERROR at line 1: ORA-03113: end-of-file on communication channel Process ID: 21287 Session ID: 34 Serial number: 2369
I do not say, that using 100000 subqueries is in any way useful :)
maybe this is not related to the amount of subqueries but rather to the number of lines or the number of characters in the statement. did not test this.