Bayo,

 

It’s best not to change the core tables.  I’d suggest reverting to the standard reactor.core.field.  The issue is with the Oracle-specific part.  For reactor to work with Oracle 8i, the statements using the SQL standard “LEFT JOIN” need to be changed to use Oracle’s “+” syntax.   The reason only the primary key is being returned is that the query I provided didn’t use the “+” syntax.  This should work:

 

                  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",

                        col.NULLABLE,

 

                        col.DATA_TYPE         as dbDataType,

                        col.DATA_LENGTH       as length,

                        col.DATA_DEFAULT      as "DEFAULT"

                  FROM  all_tab_columns    col,

                          all_cons_columns   colCon,

                            all_constraints  tabCon

                  where col.table_name = <cfqueryparam cfsqltype="cf_sql_varchar" scale="128" value="#arguments.Object.getName()#" />

and col.COLUMN_NAME        = colCon.COLUMN_NAME (+)

                        AND col.TABLE_NAME         = colCon.TABLE_NAME (+)

                        AND colCon.CONSTRAINT_NAME = tabCon.CONSTRAINT_NAME (+)

                        AND colCon.TABLE_NAME      = tabCon.TABLE_NAME (+)

                        AND 'P'                    = tabCon.CONSTRAINT_TYPE (+)

 

Try outside of ColdFusion and see if it returns all fields.

Beth Bowden

Phone: 919-541-3355 FAX: 919-541-3687
E-Mail:
[EMAIL PROTECTED]
Address: NIEHS, MD EC-03, P.O. BOX 12233, Research Triangle Park, NC 27709


From: bayo Ojo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 05, 2006 12:20 PM
To: [email protected]
Subject: RE: [Reactor For CF] Is Reactor oracle 8i compliant?

 

Hello,

 

I have explored createGateway and createRecord commands so far.

 

Well, I was able to get createGateway to return just a column (the primary key filed) by making these modifications:

 

  1. I edited reactor.data.oracle.objectdao, adding the SQL statement Beth provided.

 

  1. Also changed the function setprimarykey/getprimarykey  in reactor.core.field cfc from
    1. <!--- primaryKey --->
    2.     <cffunction name="setPrimaryKey" access="public" output="false" returntype="void">
    3.        <cfargument name="primaryKey" hint="I indicate if the colum is part of the primary key" required="yes" type="boolean" />
    4.        <cfset variables.primaryKey = arguments.primaryKey />
    5.     </cffunction>
    6.     <cffunction name="getPrimaryKey" access="public" output="false" returntype="boolean">
    7.        <cfreturn Iif(variables.primaryKey, DE('true'), DE('false')) />
    8.     </cffunction>

       To

             <cffunction name="setPrimaryKey" access="public" output="false" returntype="void">

       <cfargument name="primaryKey" hint="I indicate if the colum is part of the primary key" required="yes" type="string" />

       <cfset variables.primaryKey = arguments.primaryKey />

    </cffunction>

    <cffunction name="getPrimaryKey" access="public" output="false" returntype="string">

       <cfreturn Iif(trim(variables.primaryKey), DE('true'), DE('false')) />

    </cffunction>

 

Note the returntype changed from boolean to string and the trim function around the variable.primaryKey. Which I guess is because of the string data type

 

 

With the createRecord I only get set/get function for just the primary key field. No set/get was returned for any other fields in the table.

 

 

I guess the problem is with this query in reactor.data.oracle.objectdao

 

 

<cfquery name="qFields"  datasource="#getDsn()#" username="#getUsername()#" password="#getPassword()#">

                                    SELECT col.column_name AS NAME

     , CASE

          WHEN colcon.constraint_name IS NOT NULL THEN 'true'

          ELSE 'false'

       END AS primarykey

     , col.nullable

     , col.data_type AS dbdatatype

     , col.data_length AS LENGTH

     , col.data_default AS "DEFAULT"

FROM   all_tab_columns col,

         all_constraints tabcon,

       all_cons_columns colcon

WHERE  col.table_name = <cfqueryparam cfsqltype="cf_sql_varchar" scale="128" value="#arguments.Object.getName()#" />

       and col.column_name = colcon.column_name

       AND col.table_name = colcon.table_name

       AND colcon.constraint_name = tabcon.constraint_name

         and col.table_name = tabcon.table_name

       AND tabcon.constraint_type = 'P'

 

</cfquery>

 

 

that returns  just the primary key field.

 

 

Bayo Ojo
Integrated Software Services Limited
15, Akinsemoyin Street,
Surulere, Lagos, Nigeria.
Mobile:2348033087030
Tel:     7915935

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

Reply via email to