Posted By: CraigJ Migrating to Oracle 8.1.5 (8i) - 09/08/99 11:18 PM
We are in the process of migrating our database to 8.1.5 from 7.3.4. We have a DOA app that has problems when run against our test 8.1.5 database. Some calculated columns suddenly have the wrong width and an exception occurs. The SQL is usually something like this:

SELECT *, 'ID:'| |To_Char(ID) Desc
from sometable

The calculated column DESC above might have a field width of 35 under 7.3.4 but under 8.1.5 it will be 30. So far we've only seen this on fields defined with the field editor. Dynamic fields don't have a problem.


------------------
Craig Jensen
PowerQuest Corporation
Posted By: ChrisF Re: Migrating to Oracle 8.1.5 (8i) - 09/08/99 11:53 PM
Just curios why this is a problem?

Whay do you care the length returned? You could so a RTRIM or LTRIM to get rid of spaces...

Again I do not know what you are doing so thier may be a reason I do not know of this will not work.

------------------
Chris
Posted By: CraigJ Re: Migrating to Oracle 8.1.5 (8i) - 09/09/99 12:49 AM
I don't realy care about the length returned but DOA does and throws an exception and the application won't run under 8.1.5. I'm wondering why the length is different between Oracle 7 and 8. I also want to know if there is an option in DOA that will let the app run under both Oracle 7 and 8. I can fix the problem for Oracle 8 but then the app will not run under Oracle 7.


------------------
Craig Jensen
PowerQuest Corporation
Posted By: Pedro Viegas Re: Migrating to Oracle 8.1.5 (8i) - 09/09/99 07:06 PM
Hello Chris,

There is no way (at least no way I know of) to create a TField in the Field Editor for the DataSet component without indicating its size, so in order to solve this you have two solutions possible (and I had this problem myself):

1. Do not create the fields at design-time (this is the obvious solution and the easy one and I have used it providing I didn't needed to indicate some properties for the fields at design time)

2. The previous solution failed if we had to create non-data fields (Calculated or Lookups fields) because the TOracleDataSet only creates the fields at runtime if there are none allready defined, so, in this case you have to do that creation yourself. In case you don't know how the FieldDefs property has allways (after you calls its update method) the list of all the fields returned by the query and it has a method witch creates the corresponding TField component (Ex: FieldDefs[2].CreateField)

Hope that helped...
Posted By: Alex Smirnoff Re: Migrating to Oracle 8.1.5 (8i) - 09/10/99 11:22 AM
Your must use function SUBSTR :
TO_CHAR(CS_DATE, 'HH24:MI') Oracle7 - 35
TO_CHAR(CS_DATE, 'HH24:MI') Oracle8 - 5
SUBSTR(TO_CHAR(CS_DATE, 'HH24:MI'), 1, 5) -
always 5
Posted By: CraigJ Re: Migrating to Oracle 8.1.5 (8i) - 09/17/99 02:32 AM
Thanks for all the replies. Alex had the best suggestion. Use a SUBSTR around the concatenated columns. I've tested this and it works great. One thing I did find out is that connecting to Oracle 8i DOA computes a much more realistic length for the column. Connecting to Oracle 7 DOA would compute a size much bigger than all the concatenated columns could ever be.
© Allround Automations forums