‎2021 Jan 18 5:56 PM
Hello,
I am getting a short dump -> Err.tmpo.ejec. DBSQL_STMNT_TOO_LARGE Excep. CX_SY_OPEN_SQL_DB
in the following code:
SELECT * FROM pcl2
INTO TABLE lt_pcl2
WHERE relid EQ 'B2'
AND srtfd IN rl_srtfd <------cause of the error
AND srtf2 EQ '00'.
The error occurs because the range table rl_srtfd has 32664 rows, which are too many to be processed in the SELECT statement.
I'm not sure what is the limit because I've tried the program with only 10000 rows in rl_srtfd and it didn't give a dump.
How should I proceed to solve this? How do I know the limit of the size of rl_srtfd?
Thank you all in advance.
‎2021 Jan 18 6:33 PM
If your range contains so much values, the generated SQL statement is too long (snote 2317211).
Easiest solution would be splitting your range in several ranges and run a SQL statement for each of those ranges (containing 1000-1500 values or so).
Depending on the how, where, why and when you could also try and find another solution and don't use ranges at all.
‎2021 Jan 19 9:59 AM
Thank you Patrick,
Another, less efficient, option would be to remove that condition and afterwards delete all undesired entries
‎2021 Jan 19 7:56 AM
If it works for 10.000 then keep that number and you should never have the issue again.
‎2021 Jan 19 9:02 AM
The maximal size of a SQL statement depends on your database. Perform some test if database manager cannot answer.