Questions tagged [varchar2]

The VARCHAR2 datatype stores variable-length character strings.

The VARCHAR2 datatype stores variable-length character strings. When you create a table with a VARCHAR2 column, you specify a maximum string length (in bytes or characters) between 1 and 4000 bytes for the VARCHAR2 column. For each row, Oracle Database stores each value in the column as a variable-length field unless a value exceeds the column's maximum length, in which case Oracle Database returns an error. Using VARCHAR2 and VARCHAR saves on space used by the table.

The VARCHAR datatype is synonymous with the VARCHAR2 datatype. To avoid possible changes in behavior, always use the VARCHAR2 datatype to store variable-length character strings.

http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT1822

192 questions
0
votes
0 answers

String char-set in Java and Oracle DB

Hi i am using Oracle DB to store string on Varchar2 column, with using eclipselink my code is here, pdescription = new String(this.description.getBytes("ISO-8859-9")); sometimes its ok but, somtimes it only question marks, like that it is taken…
Poyraz
  • 359
  • 1
  • 5
  • 12
0
votes
1 answer

Convert from VARCHAR2 to NCLOB (oracle)

I got a column message with data_type = VARCHAR2. It already has some data stored. I want this column to be of type NCLOB. Code-Set for this column should be UTF-8. I did the following: added a column tempmessage to my table of type NCLOB filled…
Chris311
  • 3,794
  • 9
  • 46
  • 80
0
votes
1 answer

Do I need to reclaim space in Oracle when updating a varchar2 column?

If I have an Oracle table with a VARCHAR2 column with length 4000, and I have inserted a 4000 character string into the table, and then update the row with a 1 character string, do I need to do anything to make the other 3999 characters of space…
Matt James
  • 275
  • 4
  • 13
0
votes
2 answers

Oracle - How to handle 32K+ string length in variables

I am using oracle 11g. Whenever I encountered strings larger than varchar2 size limit, In sql server I use to split the data into multiple variables as below and then join them while execution. However Oracle seems to be expecting 32K combined size…
Sanjay Kattimani
  • 899
  • 1
  • 8
  • 7
0
votes
1 answer

Append varchar2 length in Oracle

I have an oracle procedure which appends varchar2: var1 varchar2(32767); if nvl(length(var1),0) + length(var2||var3||var2||chr(10)||var4||chr(10)||chr(10)) < 32767 then var1:= var1||var2||var3||var2||chr(10)||var4||chr(10)||chr(10); end if; While…
user1051434
  • 167
  • 1
  • 5
  • 17
0
votes
1 answer

ORA-06502 with varchar2 conversion from clob

I experimented a little bit with clobs and varchar2. The thing is that we have a lot of XML in a database table and I wanted to download the XML as fast as possible. As I need to use the C# DevArt components I tried it various ways and found out…
patrickuhlmlann
  • 342
  • 2
  • 4
  • 14
0
votes
1 answer

Impact on changing the data type from char to varchar2

Can anyone tell me will there be any impact on changing the datatype of a column from char to varchar2. Because the issue i am facing is when i fire a select query i.e select * from table_name where column_name in ('X','Y','Z'); The above query is…
0
votes
1 answer

Max value of VARCHAR field oracle

I have a field that I would like to get the max value of but it is a varchar2(6) field, all numerals. I am unable to change the type of field The field is a date listed like this 201307 for July 2013. Just using MAX does not work. Using oracle.
user1466935
  • 7
  • 1
  • 4
0
votes
1 answer

How to convert yyyy-mm-dd hh:mi:ss into mm-dd-yyyy hh:mi:ss in Oracle?

I have a varchar column and I want to convert yyyy-mm-dd hh:mi:ss into mm-dd-yyyy hh:mi:ss and cast it into a date. How can it be done?
MontyPython
  • 2,906
  • 11
  • 37
  • 58
0
votes
0 answers

Data being truncated when inserted into DB from UI web application

My code behind on the .net application uses System.Data.OracleClient, which I realize is deprecated. What I'm wondering is if I have a 2000 CHARACTER entry in my asp:text box, about how many bytes do I need in my database to handle the entry? I…
0
votes
2 answers

Parse varchar2 to table (Oracle)

Is there built-in function in Oracle DB 11g r2 that could parse varchar2 variable to table? Opposite of listagg or wm_concat. I found only Tom Kyte's method dated 2006: with data as ( select trim(substr (txt, instr(txt, ',', 1, level) + 1 ,…
sergdenisov
  • 8,327
  • 9
  • 48
  • 63
0
votes
1 answer

Need help to get a file as a whole in a single mail which is of the size 4 mb in oracle PL/SQL

The below code in a PL/SQL procedure checks for the byte size and if it is above 30000 bytes it iterates the data and sends mail attachments(txt file through multiple mails) for every 30000 bytes(30 kb). I need to get a file as a whole in a…
0
votes
1 answer

How to use lead() and lag() on varchar2 fields?

Oracle 11g My work so far on SQL Fiddle I'm using lead() and lag() functions on varchar2 columns. Using the following rules, I'd like to generate the desired results. If lag_val is null then '(' If lag_val is same as set_a then 'and' If lag_val…
zundarz
  • 1,540
  • 3
  • 24
  • 40
0
votes
1 answer

Oracle varchar2 to timestamp with time zone

I'm trying to convert a VARCHAR2 variable which contains a timestamp w/ time zone into a DATE variable. I can convert the timestamp without the time zone but when I add logic for timezone I get "ORA-01821: date format not recognized". Please see…
0
votes
1 answer

How can I store bytes in Oracle Varchar2, and have ASCII treated as text

How can I have bytes stored in a Varchar2, and have it treated "normally" as text when it is ASCII for example? (Like in queries). If not possible, where is the limitation? I know the column is defined with a character sets, so if it is ANSI for…
Olav
  • 1,758
  • 4
  • 27
  • 49
1 2 3
12
13