Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Primitive Type Returned when trying to connect a grid to data

New Here ,
Oct 02, 2009 Oct 02, 2009

Dev Environment:  XP Pro, ColdFusion 9, ColdFusion Builder 1, FlashBuilder 4, Firebird 2.1.2, Jaybird 2.1.6

Error message recieved while trying to connect data to a grid in FlashBuilder 4:
--------------------------------------------------------------
Primitive Type Returned

The operation returned a response of the type "Object"

You may either update server code to fix the returned data or Click OK to set
"Object" as the return type of this operation
---------------------------------------------------------------


Here is the CF9 component code: 
(This is the same code as for the other successful grid,
except for every occurrance of SES in the code below, it is
replaced with "SBJ" in the other code for the working grid)

    <cffunction name="getSESs" output="false" access="remote" returntype="any" >
        <cfargument name="par_guid" required="true" />

        <!--- Fetch a list photo sessions whose par_guid field
        value matches the given value --->
       
        <cfset var qSESs="">
        <cfquery name="qSESs" datasource="cfBAA_jdbc">
            SELECT * FROM BAA_SES
              WHERE PAR_GUID =
                <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.par_guid#">
              ORDER BY SES_NMBR
        </cfquery>
        <cfreturn qSESs>
    </cffunction>

----------------------------  Please see the attached image file for a "story board" of what I did to get this error ---------------------

TOPICS
Database access
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2009 Oct 04, 2009

Flash builder's "Configure Return Type" dialog recognizes this OK and it works

    <!--- Fetch a single session record --->
     <cffunction name="getSES" output="false" access="remote" returntype="any" >
         <cfargument name="obj_guid" type="string" required="true" />
         <cfset var qSES="">
         <cfquery name="qSES" datasource="cfBAA_odbc">
             SELECT *
             FROM BAA_SES
             WHERE OBJ_GUID = <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.obj_guid#">
         </cfquery>
         <cfreturn qSES>
     </cffunction>

Flash builder's "Configure Return Type" dialog doesn't recognize this.  It always returns "Object" which is wrong.  I have done several CF server restarts, PC reboots, several FB4 "re-sync with server file".  Refuses to recognise this.

    <cffunction name="getIMG" output="false" access="remote" returntype="any" >
        <cfargument name="obj_guid" type="string" required="true" />
        <cfset var qIMG="">
        <cfquery name="qIMG" datasource="cfBAA_odbc">
            SELECT *
            FROM BAA_IMG
            WHERE OBJ_GUID = <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.obj_guid#">
        </cfquery>
        <cfreturn qIMG>
    </cffunction>

What am I doing wrong?  The rest of my source for my "learning project" is attached.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2009 Oct 04, 2009

Problem solved.  Ok, anyone following in my foot steps.  The value that you enter into the "Configure Return Type" dialog that will fill the parameter(s)  MUST yield a result set of at least one record.  I thought I was doing this, but my DB utility and CF where configured to look at 2 different DBs.  Same structure, but I was pulling IDs from one DB that of course did not yield a result set in the other, in which case FB4 cannot help.

Beginners onward!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2009 Oct 04, 2009
LATEST

I described the solution to the problem in the last post.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources