user3876965
user3876965

Reputation: 11

Varchar2 column versus variable memory allocation in pl/sql

In pl/sql, if you create a variable as varchar2(256) and then assign a 10 character string to the variable then the total memory used is 256 characters but if you declare it (4000 or more it will use only the 10 characters. Is that also true for varchar columns on a table? Or does a varchar column always allocate only what you have assigned? Thanks.

Upvotes: 1

Views: 187

Answers (1)

bowlturner
bowlturner

Reputation: 2016

The varchar column is meant to be 'variable character' so it stores just one more character (the terminal) than the string you are storing. char, stores exactly the number of characters it is set to.

Upvotes: 1

Related Questions