473,383 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

equivalent of varchar2?

Hi all,

What is the equivalent of VARCHAR2 in access?

thanks
hilz
Nov 13 '05 #1
14 10823
VARCHAR-2 ????

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"hilz" <no**@y.com> wrote in message
news:0L********************@comcast.com...
Hi all,

What is the equivalent of VARCHAR2 in access?

thanks
hilz

Nov 13 '05 #2
> VARCHAR-2 ????

Is there such a thing as VARCHAR-2 ????
Incase my question was not clear, here are some more details:

In Oracle, there is a datatype called VARCHAR2. It can hold more than the
length of the field.
for example ;
create table test (name VARCHAR(10));
Now if you insert into this table a row with name='a string that is longer
than 10 characters'
it will accept it and store it. I beleive the length (10) is just for
optimizing, and should be close to what you expect most of the values in
that field to be.

And if you insert into the table a row with name='abc' it will not pad the
string with spaces, and thus saving storage space.

Now in Access, declaring a filed as CHAR will have a fixed length that
cannot be exceeded, and if the value was shorter than the length, it is
padded with spaces to fill the whole length of the field, and that is not
really very desirable.

If i create my access table using an SQL statement, rather than the table
designer, i can set the field as VARCHAR, but not VARCHAR2.
and VARCHAR in this case does not pad the short string with spaces, which is
good, but it does not allow a string that is longer than the column width.
so my question is: is there such a datatype in Access that is similar to
VARCHAR2?

I remember there was a memo filed, but I also remember that it is not
recommended to use that for just any string field.

thanks
hilz
Nov 13 '05 #3

"hilz" <no**@y.com> wrote in message
news:0L********************@comcast.com...
Hi all,

What is the equivalent of VARCHAR2 in access?

thanks
hilz


Text.
Nov 13 '05 #4
Such a beast doesn't exist in Access.

"hilz" <no**@y.com> wrote in message
news:K9********************@comcast.com...
VARCHAR-2 ????


Is there such a thing as VARCHAR-2 ????
Incase my question was not clear, here are some more details:

In Oracle, there is a datatype called VARCHAR2. It can hold more than the
length of the field.
for example ;
create table test (name VARCHAR(10));
Now if you insert into this table a row with name='a string that is longer
than 10 characters'
it will accept it and store it. I beleive the length (10) is just for
optimizing, and should be close to what you expect most of the values in
that field to be.

And if you insert into the table a row with name='abc' it will not pad the
string with spaces, and thus saving storage space.

Now in Access, declaring a filed as CHAR will have a fixed length that
cannot be exceeded, and if the value was shorter than the length, it is
padded with spaces to fill the whole length of the field, and that is not
really very desirable.

If i create my access table using an SQL statement, rather than the table
designer, i can set the field as VARCHAR, but not VARCHAR2.
and VARCHAR in this case does not pad the short string with spaces, which
is
good, but it does not allow a string that is longer than the column width.
so my question is: is there such a datatype in Access that is similar to
VARCHAR2?

I remember there was a memo filed, but I also remember that it is not
recommended to use that for just any string field.

thanks
hilz

Nov 13 '05 #5
On Tue, 18 Jan 2005 20:29:44 -0500, "hilz" <no**@y.com> wrote:
Hi all,

What is the equivalent of VARCHAR2 in access?


I don't think there is one. You'll have to roll your own.

mike
Nov 13 '05 #6
"hilz" <no**@y.com> wrote
Now in Access, declaring a filed as
CHAR will have a fixed length that
cannot be exceeded, and if the value
was shorter than the length, it is
padded with spaces to fill the whole
length of the field, and that is not
really very desirable.


If you are talking about a Text field in a Jet database, this is absolutely
incorrect. Text and Memo fields are all variable-length, requiring no more
storage than the contents plus necessary controlling information. If you
specify a length on a Text field, that will be used as a maximum length, but
the field will NOT be padded with blanks or null characters to that length.

If you are defining fields other than by using the Table design UI, then you
are (1) wasting effort and (2) perhaps limiting yourself by using things
that work better in some other database than in Access.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #7
"hilz" <no**@y.com> wrote in message
news:K9********************@comcast.com...
VARCHAR-2 ????
Is there such a thing as VARCHAR-2 ????
Incase my question was not clear, here are some more details:

In Oracle, there is a datatype called VARCHAR2. It can hold more than the
length of the field.
for example ;
create table test (name VARCHAR(10));
Now if you insert into this table a row with name='a string that is longer
than 10 characters'
it will accept it and store it. I beleive the length (10) is just for
optimizing, and should be close to what you expect most of the values in
that field to be.

And if you insert into the table a row with name='abc' it will not pad the
string with spaces, and thus saving storage space.

Now in Access, declaring a filed as CHAR will have a fixed length that
cannot be exceeded, and if the value was shorter than the length, it is
padded with spaces to fill the whole length of the field, and that is not
really very desirable.

If i create my access table using an SQL statement, rather than the table
designer, i can set the field as VARCHAR, but not VARCHAR2.
and VARCHAR in this case does not pad the short string with spaces, which

is good, but it does not allow a string that is longer than the column width.
so my question is: is there such a datatype in Access that is similar to
VARCHAR2?

I remember there was a memo filed, but I also remember that it is not
recommended to use that for just any string field.

thanks
hilz


hilz,

I think you are a bit confused. Both about how VARCHAR2 behaves in Oracle
and how Text behaves in Jet. Neither permits insertion of data greater in
length than the field width, nor does either pad fields as you have
described. Jet does not have a data type equivalent to CHAR.

Regards
Nov 13 '05 #8

"Larry Linson" <bo*****@localhost.not> wrote in message
news:ZHkHd.6235$ef6.1630@trnddc07...
"hilz" <no**@y.com> wrote
> Now in Access, declaring a filed as
> CHAR will have a fixed length that
> cannot be exceeded, and if the value
> was shorter than the length, it is
> padded with spaces to fill the whole
> length of the field, and that is not
> really very desirable.
If you are talking about a Text field in a Jet database, this is

absolutely incorrect. Text and Memo fields are all variable-length, requiring no more
storage than the contents plus necessary controlling information. If you
specify a length on a Text field, that will be used as a maximum length, but the field will NOT be padded with blanks or null characters to that length.
If you are defining fields other than by using the Table design UI, then you are (1) wasting effort and (2) perhaps limiting yourself by using things
that work better in some other database than in Access.

Larry Linson
Microsoft Access MVP


You were right. I was confused, and now i have a little better understanding
about this matter, but what is wrong with creating the schema in Access
using an SQL script that is executed throught an ado connection?

thanks.

Nov 13 '05 #9
hilz wrote:
Hi all,

What is the equivalent of VARCHAR2 in access?


Text. Unfortunately, it has a character limit of 255 versus 2000 for
Oracle's varchar2.

However, for fields greater than 255 characters you can use a memo data
type. Unsure of max characters, but it's effectively unlimited for my
usages, at least. The nice things about memo type fields as compared to
the equivalentlong data type in Oracle are:

1) You can enter where criteria

2) It can be sorted

3) You can have MORE THAN ONE per table!

8)

If you get around to using Access as a FE to an oracle DB, results
displayed from Oracle long data types cn be searched and filtered in a
data sheet/form.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #10
>
1) You can enter where criteria

2) It can be sorted

You can't sort or index on a memo field.

Neil

3) You can have MORE THAN ONE per table!

8)

If you get around to using Access as a FE to an oracle DB, results
displayed from Oracle long data types cn be searched and filtered in a
data sheet/form.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #11
Memo = up to 64,000 characters

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cs**********@coranto.ucs.mun.ca...
hilz wrote:
Hi all,

What is the equivalent of VARCHAR2 in access?


Text. Unfortunately, it has a character limit of 255 versus 2000 for
Oracle's varchar2.

However, for fields greater than 255 characters you can use a memo data
type. Unsure of max characters, but it's effectively unlimited for my
usages, at least. The nice things about memo type fields as compared to
the equivalentlong data type in Oracle are:

1) You can enter where criteria

2) It can be sorted

3) You can have MORE THAN ONE per table!

8)

If you get around to using Access as a FE to an oracle DB, results
displayed from Oracle long data types cn be searched and filtered in a
data sheet/form.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #12
Neil Ginsberg wrote:
You can't sort or index on a memo field.


Quite right, I was thinking of standard menu filters. It's still miles
better than the Oracle Long data type, though. 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #13

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cs**********@coranto.ucs.mun.ca...
hilz wrote:
Hi all,

What is the equivalent of VARCHAR2 in access?


Text. Unfortunately, it has a character limit of 255 versus 2000 for
Oracle's varchar2.


VARCHAR2 can be up to 4000 characters.
Nov 13 '05 #14
PC Datasheet wrote:
Memo = up to 64,000 characters


1,535 short :-)

--
This sig left intentionally blank
Nov 13 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tillu | last post by:
One of the column in a new table can be ename - varchar2(20) or hase_code_ename - number(11) – Hash Code generated by JAVA. We are going to create non-unique index on this column as one frequent...
1
by: Mat Hess | last post by:
We are currently developing a new application. In this application, we have a table which will hold a large number of rows, where many text fields (one text field per row) will be stored. The users...
0
by: Sven Mayer | last post by:
Assume a database (e.g. Oracle) field is declared as a) NUMBER (length=10) b) NUMBER (length=26) c) VARCHAR2 (length=1) d) VARCHAR2 (length=50) e) DATE How do I retrieve the contents from...
5
by: DTB | last post by:
I am trying to convert a complex function from Oracle to SQL Server and have come across Oracle's Instr() function. I see SQL Server has CHARINDEX() which is similar, however it does not provide...
20
by: Praveen | last post by:
Hi All, I have an application for that we used oracle 8i as the db and we have written procedures using VARRAYs. Now, the requirement came to migrate it on DB2 UDB. Can anyone pls tell me is...
5
by: Mitchell Thomas | last post by:
I am using Oracle as a backend and have a field set as Varchar2(2000). The problem i have is access interprets this as a memo field and allows the user to type more than 2000 characters but does...
1
by: Mullin Yu | last post by:
hi, i'm using System.Data.OracleClient; but it seems not having Varchar2 and i use Varchar instead. Then when i call a Oracle Procedure update a table with varchar2, i got the following error: ...
5
by: moorthyvisu | last post by:
Hi, I have a below scenario: Table name : ClientCode. Fields are : startcode varchar2(20) & endcode varchar2(20); The values in these two fields should not overlap. For Ex:
2
by: ghe | last post by:
Good day to all, Does anyone here know how to convert the specified Oracle code below into PHP? Oracle Code: TYPE myTable IS TABLE OF varchar2(1) INDEX BY BINARY_INTEGER; If the Oracle code i...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.