giorashc
giorashc

Reputation: 13713

Oracle VARCHAR limit as a procedure out parameter

I have a stored procedure written under Oracle 11g and one of my out parameters is a string (i.e. of type VARCHAR).

I use this parameter to return a concatenated list of numbers separated by ;. This list can be of any size and I do not know the size in advance.

My question is does VARCHAR will be enough or does it have a size limit (which will cause me troubles of course). If not what should I use for this case ?

Thanks

Upvotes: 2

Views: 5473

Answers (2)

jarnbjo
jarnbjo

Reputation: 34313

Why don't you use a suitable datatype like array of number instead of trying to encode a complex structure in a string?

Upvotes: 6

cagcowboy
cagcowboy

Reputation: 30848

A VARCHAR2 in PL/SQL may contain 32,767 characters. (Note that this is different to a VARCHAR2 column on the database, which has a maximum length of 4,000 characters)

Also, you say above that you're using VARCHAR. Oracle recommends that you use VARCHAR2, not VARCHAR.

Upvotes: 7

Related Questions