Question

I am querying a Oracle Database (version 9 or 10) from C# using the OracleCommand class.

String query = GetQuery(); //may produce quite lenghty queries...
OracleCommand command = connection.CreateCommand();
command.CommandText = query;
command.CommandType = CommandType.Text;

This class is in the Oracle.DataAccess.Client namespace in Oracle.DataAccess.dll (version "10.2.0.100"), which is from Oracle, not Microsoft. It's quite old, as I learned, but I do not like to change, if there is no need.

My concern is, is there a maximum length for this query string? Is there a limit either by that class or by the underlying Oracle Database?

Note: I am familiar with Microsoft SQL server, but very new to Oracle. Also I did look for docs but Google was not much of a help for this detail this time.

Was it helpful?

Solution

Oracle9i Database Reference states a limit on sql statement length:

64 K maximum; particular tools may impose lower limits

Similar page on 11g doesn't declare precise limitation, though:

The limit on how long a SQL statement can be depends on many factors, including database configuration, disk space, and memory

I believe we can be sure that 10 and 11 versions of oracle database support 64k queries.

Docs for OracleCommand class do not introduce any exceptions or constraints on CommandText length.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top