Hello, I'm normally the Java programmer here, but we got some old stuff running Pro*C.....anyway this is my error:

myprops.c: In function `my_setupPropertyCursor':
myprops.c:10931: error: called object is not a function

Here's the code:

/*================================================================
Name: mylibprops.c

Compile myprops to include this code.
10/29/04 -- MG -- Convert to use the search summary table.
=================================================================== */

#include <stdlib.h>
#include <math.h>
#include <homesland.h>
#include <htmllib.h>
#include <util.h>
#include <strutil.h>

#include <sqlca.h>
#include <oralib.h>
#include <datalib.h>

#include "props.h"

void my_setupPropertyCursor(const char * userId) {
     
	int startmeup = 0;
    int endmeup = 0;	
    char *escapedUserId = NULL;

    /*Take care of a reduced result set for speed.*/
  startmeup = 0;
  endmeup = BARE_LISTINGS_PER_PAGE;

  if (wf_filled("pageclicked")) {
  	endmeup = BARE_LISTINGS_PER_PAGE * atoi(wf("pageclicked")); 
	startmeup = endmeup - BARE_LISTINGS_PER_PAGE;
  } 
	
	
	
	
	Olen(sql_stmt) = Olen(sql_count_stmt) = 0;
    Ostr(sql_stmt)[0] = Ostr(sql_count_stmt)[0] = '\0';
	
    escapedUserId = escapeSQL(userId);    /** Remember to free this when we're done! */
    /** if (!escapedUserId) escapedUserId = userId;	We should probably bail, but we'll try to soldier on... */
 
  /*  printf("<!--- 31 mylibprops Hope this works --->");  */
    snprintf(Ostr(sql_stmt), sizeof(sql_stmt.arr), 
	    
		
		"SELECT b.state_code,\n"
		"   INITCAP(b.city) city,\n"
		"   b.listing_id,\n"
	    "	b.street_number||DECODE(b.street_number, NULL, '', ' ')||b.street_name,\n"
	    "	LTRIM(TO_CHAR(DECODE(b.list_price,0,NULL,b.list_price),'L99G999G999')),\n"
	    "   b.list_price PRICE,\n"
		"   b.bedrooms,\n"
		"   b.square_feet,\n"
		"   b.full_baths,\n"
	    "	b.half_baths,\n"
		"   b.three_quarter_baths,\n"
		"   NVL(b.year_built, 0),\n"
	    "   b.lot_size,\n"
		"   0 lot_size_units,\n"
	    "   b.floors,\n"
		"   b.listing_arch_style_code,\n"
		"   INITCAP(RTRIM(b.listing_arch_style_desc)) otherstyle,\n"
		"   b.property_type_code,\n"
	    "   '',\n"
		"   nvl(b.sold,' '),\n"
		"   INITCAP(RTRIM(b.listing_arch_style_desc)),\n"
	    "   b.caption_summary,\n"
		"   (b.list_price * -1),\n"
	    "   DECODE(b.pp, NULL, 0, 1) pplisting,\n"
	    "   DECODE(b.oem,NULL,0,'HCPP',0,'BHG',0,1) ppoem,\n"
	    "   NVL(b.actual_city, b.city),\n"
	    "	NVL(b.actual_state_code, b.state_code),\n"
	    "   'N',\n"
		"   NVL(b.VIRTUAL_TOUR,'N'),\n" /*change the following line back to TNNEXTID2URL */
	    "	DECODE(b.thumbnail_image_ref, NULL, b.ext_thumbnail_url, FORMATTING.TEMPTNEXTID2URL(b.thumbnail_image_ref)),\n"
	    "   b.MLS_NUMBER,\n"
		"   0,\n"
		"   b.attribution_logo_image_name,\n"
		"   b.attribution_logo_alt_text,\n"
	    "   '' ppsearchcity,\n"
        "   DECODE(b.sold, NULL, 1, ' ', 1, 'R', 1, 'P', 2, 'U', 3, 'Y', 4, 'E', 5, 6) ppsearchsold,\n"
	    "   b.data_owner_contact_id,\n"
		"   (b.office_contact_id - 10000000) office_contact_id,\n"
		"   (b.primary_agent_contact_id - 20000000) primary_agent_contact_id\n"
        
		"   b.NOTES,\n"
		"   nvl(b.LISTING_ID, 0)\n" 
		
		
	"FROM (SELECT a.*, rownum rnum"      
		"FROM(SELECT srch.state_code,\n"
		"   srch.city,\n"
		"   srch.listing_id,\n"
	    "	srch.street_number,\n"
		"	srch.street_name,\n"
	    "	srch.list_price,\n"
	    "   srch.list_price PRICE,\n"
		"   srch.bedrooms,\n"
		"   srch.square_feet,\n"
		"   srch.full_baths,\n"
	    "	srch.half_baths,\n"
		"   srch.three_quarter_baths,\n"
		"   srch.year_built,\n"
	    "   srch.lot_size,\n"
		"   0 lot_size_units,\n"
	    "   srch.floors,\n"
		"   srch.listing_arch_style_code,\n"
		"   srch.listing_arch_style_desc,\n"
		"   srch.property_type_code,\n"
	    "   '',\n"
		"   srch.sold,\n"
		"   srch.listing_arch_style_desc)),\n"
	    "   srch.caption_summary,\n"
		
	    "   srch.pp,\n"
	    "   srch.oem,\n"
	    "   srch.actual_city,\n"
	    "	srch.actual_state_code,\n"
	    "   'N',\n"
		"   srch.VIRTUAL_TOUR,\n" /*change the following line back to TNNEXTID2URL */
	    "	srch.thumbnail_image_ref,\n"  
		"	srch.ext_thumbnail_url,\n"
	    "   srch.MLS_NUMBER,\n"
		"   0,\n"
		"   srch.attribution_logo_image_name,\n"
		"   srch.attribution_logo_alt_text,\n"
	    "   '' ppsearchcity,\n"
        "   srch.sold,\n"
	    "   srch.data_owner_contact_id,\n"
		"   (srch.office_contact_id,\n"
		"   (srch.primary_agent_contact_id,\n"
        "   %s\n"
        "   %s,\n"
		"   M.NOTES,\n"
		"   M.LISTING_ID,\n" 
	    "   FROM listing_search srch, OLS_MY_SAVED_LISTINGS M\n"
	    " WHERE srch.listing_id = M.LISTING_ID\n"
		" AND M.FK_USERNAME = '%s'\n"
	    " ORDER BY M.DATE_SAVED DESC) a \n",
		"WHERE rownum <= %d) b \n"

        "WHERE rnum > %d \n"


	    (is_mls_recip) ? ", (srch.office_contact_id - 10000000) office_contact_id, srch.supplier_lr_logo, (srch.primary_agent_contact_id - 20000000) primary_agent_contact_id " : "", 
	    wf("subdivision")[0] ? ",  srch.subdivision" : (wf("street")[0] ? ", srch.street_name" : ", ''"), 
		escapedUserId ? escapedUserId : userId,endmeup,startmeup);

	    snprintf(Ostr(sql_count_stmt),sizeof(sql_count_stmt.arr),"SELECT count(*) , NVL(sum(vt),0) FROM (SELECT srch.listing_id, DECODE(srch.virtual_tour,'Y',1,0) vt " 
		    "   FROM listing_search srch, OLS_MY_SAVED_LISTINGS M\n"
		    " WHERE srch.listing_id = M.LISTING_ID\n"
			" AND M.FK_USERNAME = '%s')\n",
			escapedUserId ? escapedUserId : userId);


  if(wf_exists("pageclicked"))
    pageClicked = atoi(wf("pageclicked"));
  else
  {
	/*
	Oh boy, how to explain.  Myprops uses displaylistings.  If there are more
	than 10 listings, displaylistings will crash if there is no query string.
	Rather than try to fix displaylistings, it's easier and safer to 
	make a query string.
	*/
	fieldlist * newFieldListItem = (fieldlist*) (calloc(1, sizeof(fieldlist)));
	newFieldListItem->name = (char *)_strdup("pageclicked");
	newFieldListItem->value = (char *)_strdup("1");
	newFieldListItem->type = '\0';
	newFieldListItem->next = fields;
	fields = newFieldListItem;
	if (getenv("QUERY_STRING") == 0)
		_putenv("QUERY_STRING=pageclicked=1");
	pageClicked = 1;
  }

  Olen(sql_stmt) = strlen(Ostr(sql_stmt));
  Olen(sql_count_stmt) = strlen(Ostr(sql_count_stmt));

  printf("<!--- count stmt /n%s/n/n --->",Ostr(sql_count_stmt));
  printf("<!--- sql stmt /n%s/n/n --->",Ostr(sql_stmt));

  EXEC SQL WHENEVER SQLERROR DO sql_error();
  EXEC SQL PREPARE S FROM :sql_stmt;
  EXEC SQL PREPARE SC FROM :sql_count_stmt;
#ifdef USE_SCROLL_CURSOR 
  EXEC SQL DECLARE C SCROLL CURSOR FOR S;
#else 
  EXEC SQL DECLARE C CURSOR FOR S;
#endif
  EXEC SQL DECLARE N CURSOR FOR SC;
  if (escapedUserId) free(escapedUserId);

  return;
}

Recommended Answers

All 4 Replies

Right...would you be kind enough to point out which line throws the error?

unfortunately this is all I get back from my compiler:.....yeah it sucks I know

myprops.c: In function `my_setupPropertyCursor':
myprops.c:10931: error: called object is not a function

The error gives you a line number, tell us which line it's referring to in the code you posted.

Might you be missing a comma here?

"WHERE rnum > %d \n",//??


	    (is_mls_recip) ? ", (srch.office_contact_id - 10000000) office_contact_id, srch.supplier_lr_logo, (srch.primary_agent_contact_id - 20000000) primary_agent_contact_id " : "",
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.