Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: varchar

Re: varchar

From: Bastiaan Schaap <bschaap_at_desyde.nl>
Date: Tue, 3 Apr 2001 08:15:48 +0200
Message-ID: <SPdy6.10$D96.305@psinet-eu-nl>

Are you using an Oracle database? Why use integers for date/time? A 'standard' guestbook table would look something like:

- id number(38,0)
- name varchar2(100)
- email varchar2(255)
- entry_date date
- ip varchar2(15)
- message CLOB

The entry_date field is of the date datatype, which holds the date and time at the same time. In plsql you can get out date/time like O_CHAR( entry_date, 'DD-MM-YYYY HH24:MI:SS' ); Which is nothing but applying a format mask on your date field. If you want to output the content of the message, you'll have to write some plsql code, because you cannot select a CLOB out of a table and send it towards your webserver at once... If you use ASP you probably are connected to Oracle through ODBC. I would advice you to look up the Oracle documentation for converting Oracle datatypes to C/C++, Java or OLE DB datatypes. All the documentation you need can be found on Oracle Technet: http://technet.oracle.com . You can register for free...

Good luck,

--
Bastiaan Schaap
Desyde BV
bschaap_at_desyde.nl
Tel 06 - 51998277
Fax 035 - 5430547
http://www.desyde.nl
________________________________

"The first rule of politics is Never Believe Anything Until It's Been
 Officially Denied."

"las" <laasunde_at_online.no> wrote in message
news:XnZx6.3017$R6.62910_at_news1.oke.nextra.no...

> Using asp.
> Would this work then, Table name "Guestbook" with the following fields :
> Name(varchar 30), email(varchar30), time(int), date(int), ip(int),
> message(varchar2 1000) ?
> Is there a web page where I can some more info about the different
> datatypes, i.e. data size.
>
> Thanks a bunch.
>
> las
>
> "Bastiaan Schaap" <bschaap_at_desyde.nl> skrev i melding
> news:Y9Zx6.12$t14.752_at_psinet-eu-nl...
> > oops... forgot: You want to use this field for a guestbook. I'm an
Oracle
> > Webdeveloper, and we always use CLOB datatype for this kind of
information.
> > The CLOB can theoretically hold up to 2GB of data, so that should be
more
> > than enough to fit you needs... In order to display this field, you kan
> > parse through the column by using dbms_lob functionality. A simple loop
with
> > dbms_lob.read should suffice... I don't know if you're using an OAS or
PHP.
> > If you work with PHP I should stick with the varchar2, or make a simple
> > stored procedure that you execute in your script at the place where the
data
> > has to be...
> >
> > Hope this helps,
> >
> > --
> > Bastiaan Schaap
> > Desyde BV
> > bschaap_at_desyde.nl
> > Tel 06 - 51998277
> > Fax 035 - 5430547
> > http://www.desyde.nl
> > ________________________________
> >
> > "Ever stop to think, and forget to start again?"
> >
> > "Bastiaan Schaap" <bschaap_at_desyde.nl> wrote in message
> > news:O4Zx6.10$t14.783_at_psinet-eu-nl...
> > > You can use a varchar2... A varchar2 can contain 32767 characters if
you
> > > define it within PL/SQL, or 4000 characters if it is a column-type
(for
> > > Oracle 8!). I'm not sure about Oracle 7, but I think it's the same
> > > numbers...
> > >
> > >
> > > Hope this helps,
> > >
> > > --
> > > Bastiaan Schaap
> > > Desyde BV
> > > bschaap_at_desyde.nl
> > > Tel 06 - 51998277
> > > Fax 035 - 5430547
> > > http://www.desyde.nl
> > > ________________________________
> > >
> > > "The first rule of politics is Never Believe Anything Until It's Been
> > > Officially Denied."
> > >
> > > "las" <laasunde_at_online.no> wrote in message
> > > news:00Zx6.3011$R6.62751_at_news1.oke.nextra.no...
> > > > varchar can contain 255 characters, right ? I need something thats
bigger,
> > > > what are my options ? Looking to make a guestbook for my a web site
and 255
> > > > is to few letters I reckon...
> > > >
> > > > las
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Received on Tue Apr 03 2001 - 01:15:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US