| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: db question / JDBC question
I (and everybody I guess) agrees with Paul.
Be aware though if you are used to the comparison rules of CHAR where
trailing spaces are irrelevant: in case of VARCHAR2 trailing spaces
matter. If two VARCHAR2 fields are the same except for their number of
trailing spaces they are considered different.
Jaap.
On Fri, 15 Feb 2002 20:15:18 -0000, "Paul Brewer" <paul_at_paul.brewers.org.uk> wrote:
>Rayden,
>
>The rule of thumb is varchar2(1).
>It isn't always correct, as Thomas Kyte was kind enough to show me some
>years ago,
>but it's almost certainly a reasonable start point.
>
>For metadata, try:
>select... from all_tables;
>select ...from all_constraints
>where constraint_type = 'R' /* Foreign Keys*/;
>select ...from all_constraints
>where constraint_type = 'P' /* Primary Keys*/;
>select ...from all_indexes;
>select .. from all_ind_cols;
>
>HTH.
>
>Paul
>
>"Rayden" <durlecht_at_msu.edu> wrote in message
>news:a4j3sc$2h0u$1_at_msunews.cl.msu.edu...
>> what is the difference if any between char(1) or varchar2(1).......what is
>> the rule of thumb on this one?. also, i am using jdbc to get schemas for
>> databases....works fine under mssql and sybase but i am having a rough
>time
>> under oracle......trying to get the foreignkeys, index info, primary keys,
>> etc. does anyone have any snippet code of how to accomplish this using
>> oracle jdbc drivers using java code (obviusly)....i can get some of the
>> metadata per se....but just not the keys and indexes. any help would
>greatly
>> be appreciated.
>>
>>
>> thanks,
>>
>> timis
>>
>>
>
>
>
>
Received on Sat Feb 16 2002 - 04:45:40 CST
![]() |
![]() |