Sorry, that was my hard coded example query.  Here is the real one.

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
                  when col.data_type = 'DATE'   then 26
                  when col.data_type in ('CLOB','BLOB')   then 20000000
                  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 col.TABLE_NAME          = 
tabCon.TABLE_NAME
                                                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
            LEFT OUTER JOIN all_updatable_columns updateCol
                ON updateCol.table_name = col.table_name and 
updateCol.column_name = col.column_name
                                    WHERE col.TABLE_NAME =  <cfqueryparam 
cfsqltype="cf_sql_varchar" maxlength="128" value="#arguments.Object.getName()#" 
/>
            <cfif getOwner() neq "">
                                                and col.owner = <cfqueryparam 
cfsqltype="cf_sql_varchar" maxlength="64" value="#getOwner()#" />
                                    </cfif>

Beau Holton
Enterprise Application Architect
Bright House Networks




________________________________
CONFIDENTIALITY NOTICE: This e-mail may contain information that is privileged, 
confidential or otherwise protected from disclosure. If you are not the 
intended recipient of this e-mail, please notify the sender immediately by 
return e-mail, purge it and do not disseminate or copy it.


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to