Beau,
I hate it when I hallucinate ... I made some minor tweaks. If all
looks OK after I try it for a few days, I'll move it into the reactor
code.
Thanks for posting your rewrite.
Beth
SELECT col.column_name AS NAME,
CASE
WHEN colcon.constraint_name IS NOT NULL THEN 'true'
ELSE 'false'
END AS primarykey,
/* Oracle has no equivalent to autoincrement or identity */
'false' AS "IDENTITY",
CASE
WHEN col.nullable = 'Y' THEN 'true'
ELSE 'false'
END AS nullable,
col.data_type AS dbdatatype,
CASE
/* 26 is the length of now() in ColdFusion (i.e. {ts
'2006-06-26 13:10:14'})*/
WHEN col.data_type = 'DATE' THEN 26
/* oracle returns 4000 for clobs which is the length of
what Oracle stores inline in the record. However, oracle can store
several gb out of line. */
WHEN col.data_type IN ('CLOB', 'BLOB') THEN 20000000
/* Oracle can compress a number in a smaller field so use
precision if available */
ELSE NVL (col.data_precision, col.data_length)
END AS LENGTH,
col.data_scale AS scale,
col.data_default AS "DEFAULT",
CASE
WHEN updatecol.UPDATABLE = 'YES' THEN 'false'
ELSE 'true'
END AS readonly
FROM all_tab_columns col
LEFT JOIN all_constraints tabcon
ON tabcon.table_name = col.table_name
AND tabcon.owner = col.owner
AND tabcon.constraint_type =
'P'
LEFT JOIN all_cons_columns colcon
ON col.column_name =
colcon.column_name
AND col.table_name
= colcon.table_name
AND colcon.constraint_name =
tabcon.constraint_name
AND colcon.owner
= col.owner
LEFT OUTER JOIN all_updatable_columns updatecol
ON updatecol.table_name = col.table_name
AND
updatecol.column_name = col.column_name
AND
updatecol.owner = col.owner
WHERE col.table_name = 'xxxx' AND col.owner = 'yyyy'
ORDER BY col.column_id
On 10/8/07, Holton, Beau <[EMAIL PROTECTED]> wrote:
> Beth,
>
> I think you are thinking of the readObject() function that which had a second
> query that was run in case a match was not found. I left that function
> unchanged for exactly the reason you said.
>
> The query in the readFields()function contains no correction for case. What
> it does contain is what appears to be an unnecessary sub query which
> increases the time of the query by a factor of ten or more in my tests. If I
> am missing something, please let me know as I have not yet pushed this code
> to production :-) . Thanks.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --