Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the size limit for a varchar2 PL/SQL subprogram argument in Oracle?

Tags:

oracle

plsql

When you create a procedure (or a function) in Oracle PL/SQL, you cannot specify the maximum length of the varchar2 arguments, only the datatype. For example

create or replace procedure testproc(arg1 in varchar2) is
begin
  null;
end;

Do you know the maximum length of a string that you can pass as the arg1 argument to this procedure in Oracle ?

like image 813
Aurelio Martin Massoni Avatar asked Oct 09 '08 08:10

Aurelio Martin Massoni


People also ask

What is the maximum VARCHAR2 size in Oracle?

The VARCHAR2 datatype represents variable-length character strings. On most platforms, the maximum length of a VARCHAR2 value is 65535 bytes.

What is the limit on the size of a PL SQL block?

There is no limitation on the size of a plsql block.

What characters are allowed in VARCHAR2 Oracle?

The VARCHAR2 datatype stores variable-length character strings. When you create a table with a VARCHAR2 column, you specify a maximum column length (in bytes, not characters) between 1 and 2000 for the VARCHAR2 column.

What is the maximum size of trigger in Oracle?

Maximum Trigger Size The size of a trigger cannot be more than 32K.


2 Answers

In PL/SQL procedure it may be up to 32KB

Futher information here: http://it.toolbox.com/blogs/oracle-guide/learn-oracle-sql-and-plsql-datatypes-strings-10804

like image 141
Gravstar Avatar answered Sep 20 '22 20:09

Gravstar


I tried with testproc( lpad( ' ', 32767, ' ' ) ) and it works.

With 32768 bytes it fails, so it's 32K - 1 bytes

like image 38
Aurelio Martin Massoni Avatar answered Sep 21 '22 20:09

Aurelio Martin Massoni