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
1 answer

Can Changing a SQL Table Column From VARCHAR2 to CLOB Negatively impact systems that use cron scripts or PHP web pages?

I'm working in a complex system that utilizes multiple SQL queries called by several cron.sh script files, printing the data onto php pages. I will be changing a column from type VARCHAR2(4000) to CLOB, so that the field can expand past 4000 in…
Alan Nelson
  • 1,129
  • 2
  • 11
  • 27
0
votes
3 answers

Oracle: Find sum of a VARCHAR2(50 byte) column

I have to calculate the sum of VARCHAR2(50 byte) column in my Oracle database. The SQL query is: SELECT city, sum(forests) as sum_forests FROM BurnedAreas GROUP BY city The column forests has datatype VARCHAR2(50 byte) I've tried already some…
ktsigkounis
  • 103
  • 1
  • 11
0
votes
1 answer

How to increase column size of netezza table

i have to insert a very long string ~ 65KB into two column in the table each. But in netezza, table size is limited to ~ 65KB. Is there any way like CLOB or dynamic datatype or anything that can store such long string in NZ table. Thanks.
VivekT
  • 81
  • 2
  • 13
0
votes
1 answer

ORA-06502: PL/SQL: numeric or value error while using CLOB

For Oracle 11g doesn't support json as you know, i am creating json data using CLOB due to varchar2 (32767) size but in this time i am getting ORA-06502: PL/SQL: numeric or value error. Meanwhile, the data size is 68075. Why i am getting the error…
Goran Zooferic
  • 371
  • 8
  • 23
0
votes
1 answer

Oracle Database Link + Inner Join + To_Number Query

DatabaseA - TableA - FieldA VARCHAR2 DatabaseB - TableB - FieldB NUMBER [dblink created] SELECT * FROM TableB@dblink b INNER JOIN TableA a ON b.FieldB = a.FieldA There are 2 complications. 1. FieldA is VARCHAR2 but FieldB is NUMBER. 2.…
wervdon
  • 557
  • 2
  • 13
  • 24
0
votes
0 answers

Oracle 8i SQL - concatenate long varchar2 strings (to CLOB ?)

I need to concatenate two columns which are VARCHAR2(4000). The result strings do not fit into a VARCHAR2(4000) column, as they are too long. Since the concatenate operator can accept CLOBs, I figured I would convert each column on the fly to CLOB…
mach128x
  • 320
  • 3
  • 13
0
votes
0 answers

TSQL procedure call to PLSQL procedure : ORA-06502: PL/SQL: numeric or value error

I have a T-SQL procedure calling an Oracle procedure passing in some parameters. My oracle procedure works fine and returns the output parameters as expected. However when calling the oracle procedure from the T-SQL procedure, I have the following…
TropicalViking
  • 407
  • 2
  • 9
  • 25
0
votes
0 answers

PL-00215: varchar2 length error

I'm trying to do a very simple thing: extract a date and do some controls on it. Everything's fine but when I try to compile this error pops out and I really don't have a clue about how to solve it... This is the code: function…
Leon
  • 665
  • 4
  • 10
  • 32
0
votes
1 answer

OracleCommand Parameter Varchar2 paradoxon ;-)

i have an OracleDB with entries: 1, test, test 2, test, test Id NUMBER(8,0) Firstname (CHAR(30 BYTE)) Secondname CHAR(30 BYTE) And now i have this lines of code to select this entries: string query = @"SELECT ID,FIRSTNAME,LASTNAME FROM persdata …
Felix Arnold
  • 839
  • 7
  • 35
0
votes
0 answers

JDBC CallableStatement.execute() Hangs

I am encrypting a java.lang.String using javax.crypto.Cipher and returning a java.lang.String via return new String(Base64.encodeBase64(encryptedValue));. I previously tested the CallableStatement.execute() as working correctly with just…
Mushy
  • 2,535
  • 10
  • 33
  • 54
0
votes
1 answer

Using CLOB instead of VARCHAR2

We want to create an XML. The current code does it by appending one XML tag at a time to a VARCHAR2 variable. xmlString VARCHAR2(32767); .... .... xmlString := xmlString || '<' || elementName || '>' || elementValue || '
0
votes
1 answer

Cannot SUM(TO_NUMBER(varchar2 field)) :ORA 01722 [ORACLE]

I have myfield as varchar2 type and I try to sum this field by using sum(to_number(myfield)) but the result is ORA-01722 invalid number. before this error occured I used SUM(TO_NUMBER(REGEXP_REPLACE(BIKOU,'[[:alpha:]]', ''))) and it works but last…
Worrawan285
  • 21
  • 1
  • 2
0
votes
4 answers

Converting dates stored as VARCHAR2 to a date

I have seen similar posts to this, but I am not able to resolve my query. I am trying to query a table that has a column ("VALUE") of VARCHAR2 datatype. The rows in this column are mixed with both numerical and date values (I do not know why the…
jrh11570
  • 1
  • 3
0
votes
0 answers

Is there a command to convert varchar2 fields to text fields within SQL?

I have a set of data in varchar2 format. Some of the data has trailing zeroes (the field is a concatenation of 3 separate varchar2 fields, with a . [dot] separating them). When I try to export the data to Excel 2016, it will drop any trailing zero.…
0
votes
2 answers

how to convert long raw data type to readable format(oracle version :11.2.0.3.0) in oracle?

how to convert long raw data type to readable format(oracle version :11.2.0.3.0) in oracle? Please help me oracle version :11.2.0.3.0 i want to convert long raw data type to readable format
Amrit Dhaskat
  • 21
  • 1
  • 1