Board index » off-topic » problem with field type and field size

problem with field type and field size


2006-01-09 09:57:54 PM
off-topic2
Hello,
Happy new year.
I'm using Oracle 9 with BDE, Delphi 7.
Try this :
select lpad(dummy,255,'x') from dual
returns a varchar2 datatype with 254 x and one X.
then with one of your table :
SELECT (select lpad(dummy,255,'x') from dual) myfield FROM myTable T1
Run the query : good
Verify the Size and the field type : 255 / ftString
Now
select lpad(dummy,256,'x') from dual
returns a varchar2 datatype with 255 x and one X.
then with one of your table :
SELECT (select lpad(dummy,256,'x') from dual) myfield FROM myTable T1
Run the query : good
Verify the Size and the field type : 256 / ftMemo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
In QuickReport, if you have on expression with this field, then it hangs
with an error message : unknown datatype.
General Case :
if you concat 2 or more varchar datatypes with oracle, the BDE will consider
the size of the result field as the sum of all the field size in the concat
and not the max size.
Toad will not consider that.
Have you already experiment ?
Regards
Jean-Michel
 
 

Re:problem with field type and field size

Jean-Michel,
LPAD fills a string with the char provided to the routine...
DUMMY, in DUAL table, is initialized with 'X', so LPAD(DUMMY, 4, 'x') will
fill the remaining 3 positions with 'x'...
I couldn't reproduce the behavior you suggested in the second SELECT....
for any table I got 'xxxX' in the field MyField....
SELECT (SELECT LPAD(DUMMY, 4, 'x') MYFIELD FROM XPTO
XPTO havind 3 rows I got:
MYFIELD
---------------------------
xxxX
xxxX
xxxX
[]s
Fred
"Jean-Michel GRANIER" < XXXX@XXXXX.COM >escreveu na mensagem
Quote
Hello,

Happy new year.

I'm using Oracle 9 with BDE, Delphi 7.

Try this :
select lpad(dummy,255,'x') from dual

returns a varchar2 datatype with 254 x and one X.

then with one of your table :

SELECT (select lpad(dummy,255,'x') from dual) myfield FROM myTable T1

Run the query : good
Verify the Size and the field type : 255 / ftString

Now

select lpad(dummy,256,'x') from dual
returns a varchar2 datatype with 255 x and one X.

then with one of your table :

SELECT (select lpad(dummy,256,'x') from dual) myfield FROM myTable T1

Run the query : good
Verify the Size and the field type : 256 / ftMemo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

In QuickReport, if you have on expression with this field, then it hangs
with an error message : unknown datatype.

General Case :

if you concat 2 or more varchar datatypes with oracle, the BDE will
consider
the size of the result field as the sum of all the field size in the
concat
and not the max size.

Toad will not consider that.


Have you already experiment ?

Regards

Jean-Michel