Search notes:

SP2-0027: Input is too long (> 4999 characters) - line ignored

This is the year 2023, Oracle has released 23c and Oracle's SQL*Plus does still not allow to read lines that are longer than 4999 characters.
After variable substitution (if any), a line must not be longer than 3000 characters, otherwise a SP2-0341: line overflow during variable substitution error is thrown.

Demonstration

Creating SQL scripts

Four SQL scripts are created: /tmp/3001.sql, /tmp/3002.sql, /tmp/4999.sql and /tmp/5000.sql.
The number in the filename corresponds to the number of characters in the first line (including new line):
printf "%-2999s;\nexit\n" "select '3001' len from dual" > /tmp/3001.sql
printf "%-3000s;\nexit\n" "select '3002' len from dual" > /tmp/3002.sql
printf "%-4997s;\nexit\n" "select '4999' len from dual" > /tmp/4999.sql
printf "%-4998s;\nexit\n" "select '5000' len from dual" > /tmp/5000.sql
Using wc to verify the length of the first lines:
head -1 /tmp/3001.sql | wc -c
head -1 /tmp/3002.sql | wc -c
head -1 /tmp/4999.sql | wc -c
head -1 /tmp/5000.sql | wc -c

Executing the scripts

The scripts are now executed in SQL*Plus.
SQL*Plus can execute files whose maximum line length is 3000 characters (without new line):
$ sqlplus -S rene/rene@localhost/freepdb1 @/tmp/3001.sql

LEN
----
3001
However, adding one character does not permit to execute the script anymore:
$ sqlplus -S rene/rene@localhost/freepdb1 @/tmp/3002.sql
SP2-0341:
line overflow during variable substitution (>3000 characters at line 1)
Still the same error with 4999 characters:
$ sqlplus -S rene/rene@localhost/freepdb1 @/tmp/4999.sql
SP2-0341:
line overflow during variable substitution (>3000 characters at line 1)
As soon as the input length reaches 5000 characters, a different error is thrown:
$ sqlplus -S rene/rene@localhost/freepdb1 @/tmp/5000.sql
SP2-0027: Input is too long (> 4999 characters) - line ignored

See also

The start command
In SQLcl, there is no such line length limit.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741088007, '3.142.132.253', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL-Plus/_errors/SP2-0027_Input-is-too-long_4999-characters_line-ignored/index(94): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78