quoted constant and unabbreviated unambiguous buffer error

Posted by hermes on 04-Sep-2015 08:10

I have this code snip and I get that this must be a quoted constant and unabbreviated unambiguous buffer when I enter a date. What am I doing wrong.

mysearch = "FOR EACH employee_table NO-LOCK WHERE " +
         "employee_table.namelist = '" + hr.dates + "' AND " +
         "employee_table.status <> 'E'".

mysearch = do_the_query(mysearch,"employee_table","name","").
mysearch = do_the_query(mysearch,"employee_table","start_date","sDate").
mysearch = do_the_query(mysearch,"employee_table","review_date","rDate").

All Replies

Posted by Garry Hall on 04-Sep-2015 08:42

Reading between the lines, you are getting the message:

%s<database name> %s<buffer name> %s<field name> must be a quoted constant or an unabbreviated, unambiguous buffer/field reference for buffers known to query %s<name>. (7328)

Whatever query is being used in function do_the_query() does not have a reference to the employee_table buffer.

Posted by TheMadDBA on 04-Sep-2015 10:28

Assuming that  sDate and rDate are variables and your function call works... You need to pass in string(sDate) instead of "sDate".

The dynamic query needs the actual value of the variable and not the variable name.

This thread is closed