Query Parameters

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
webdeveloper8
User
Posts: 17
Joined: Wed Dec 31, 1969 8:00 pm

Query Parameters

Post by webdeveloper8 » Fri Jun 08, 2012 10:25 am

Our client added a new option under the "Status Field" in Candidates called "Web"

I am trying to display only these results.

Here is my query.

// Create an array with the query parameters
$query_array = array(
'entityName' => 'Candidate',
'where' => 'status=web',
'where' => 'isDeleted=0',
'orderBys'=>'dateAdded',
'parameters' => array()
);

There should only be two that get returned at this point but that isn't working.

Any suggestions?

jroorda
User
Posts: 28
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by jroorda » Fri Jun 08, 2012 5:09 pm

Hi webdeveloper8,
This is Justin with Bullhorn Support
For your query the where statement should be on the same part of the array.

Example:
// Create an array with the query parameters
$query_array = array(
'entityName' => 'Candidate',
'where' => 'status=web AND isDeleted=0',
'orderBys'=>'dateAdded',
'parameters' => array()
);

Let me know if that works for you!
Last edited by jroorda on Mon Jun 11, 2012 2:48 pm, edited 1 time in total.

webdeveloper8
User
Posts: 17
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by webdeveloper8 » Mon Jun 11, 2012 2:47 pm

that doesnt work. gives me the following error.

string(1153) " rO0ABXNyACpjb20uYnVsbGhvcm4uZGF0YXNlcnZpY2UuYXBpLkFwaURhdGFDbGllbnQAAAAAAAAA AQIACEoACmxhc3RBY2Nlc3NJAA5zdXBlckNsdXN0ZXJJZEwADWNvcnBvcmF0aW9uSWR0ABNMamF2 YS9sYW5nL0ludGVnZXI7TAAGZGJOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAMbWFzdGVyVXNl cklkcQB+AAFMAA5wcml2YXRlTGFiZWxJZHEAfgABTAAGdXNlcklkcQB+AAFMAAp1c2VyVHlwZUlk cQB+AAF4cAAAATfc3e6FAAAABHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFs dWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAzOdAAMQlVMTEhPUk4yOTc4c3EA fgAEAE+s7HNxAH4ABAAAEvJzcQB+AAQAAiHzc3EAfgAEAABEIQ==3278139763Candidate20dateAddedstatus=Web AND isDeleted=0 " -99999: org.hibernate.exception.SQLGrammarException: could not execute query

jroorda
User
Posts: 28
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by jroorda » Mon Jun 11, 2012 3:54 pm

Hi webdeveloper8,
In your responce:
string(1153) " rO0ABXNyACpjb20uYnVsbGhvcm4uZGF0YXNlcnZpY2UuYXBpLkFwaURhdGFDbGllbnQAAAAAAAAA AQIACEoACmxhc3RBY2Nlc3NJAA5zdXBlckNsdXN0ZXJJZEwADWNvcnBvcmF0aW9uSWR0ABNMamF2 YS9sYW5nL0ludGVnZXI7TAAGZGJOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAMbWFzdGVyVXNl cklkcQB+AAFMAA5wcml2YXRlTGFiZWxJZHEAfgABTAAGdXNlcklkcQB+AAFMAAp1c2VyVHlwZUlk cQB+AAF4cAAAATfc3e6FAAAABHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFs dWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAzOdAAMQlVMTEhPUk4yOTc4c3EA fgAEAE+s7HNxAH4ABAAAEvJzcQB+AAQAAiHzc3EAfgAEAABEIQ==3278139763Candidate20dateAddedstatus=Web AND isDeleted=0 " -99999: org.hibernate.exception.SQLGrammarException: could not execute query

I noticed that isdeleted=0 has a (") quotation mark next to it. Can you please check your code the query should look like:

$query_array = array(
'entityName' => 'Candidate',
'where' => 'status=web AND isDeleted=0',
'orderBys'=>'dateAdded',
'parameters' => array()
);

Not

$query_array = array(
'entityName' => 'Candidate',
'where' => 'status=web AND isDeleted=0'',
'orderBys'=>'dateAdded',
'parameters' => array()
);

webdeveloper8
User
Posts: 17
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by webdeveloper8 » Mon Jun 11, 2012 3:59 pm

here is my query

// Create an array with the query parameters
$query_array = array(
'entityName' => 'Candidate',
'maxResults' => '20',
'where' => 'status=web AND isDeleted=0',
'orderBys'=>'dateAdded',
'parameters' => array()
);

jroorda
User
Posts: 28
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by jroorda » Mon Jun 11, 2012 4:31 pm

I apologize webdeveloper8,
Please try this array:
I ran it throught multiple enviorments and it was working for me.
Please let me know if it doesnt work for you.

$query_array = array(
'entityName' => 'Candidate',
'maxResults' => '100',
'distinct' => 'FALSE',
'where' => 'isDeleted=0 and status=\'Web\'',
'parameters' => array(
'orderBys'=>'dateAdded',)
);

webdeveloper8
User
Posts: 17
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by webdeveloper8 » Mon Jun 11, 2012 4:33 pm

ill try that.

i thought that you could only return 20 results? can you specify a number like that for results?

jroorda
User
Posts: 28
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by jroorda » Mon Jun 11, 2012 4:40 pm

The query can bring back a high number of results till it times out.
However that operation only returns ID numbers.
The find operation brings back the Bullhorn DTO based upon the ID number.
The find operation brings back one DTO at a time.
The findMultiple operation brings back up to 20 DTOS.

webdeveloper8
User
Posts: 17
Joined: Wed Dec 31, 1969 8:00 pm

Re: Query Parameters

Post by webdeveloper8 » Mon Jun 11, 2012 4:50 pm

Got it. Thanks.

And your last query worked. Appreciate it.

Post Reply