CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Call a procedure in a custom search?
Pages: [1]

Author Topic: Call a procedure in a custom search?  (Read 506 times)

ryeradio

  • I post frequently
  • ***
  • Posts: 185
  • Karma: 1
  • CiviCRM version: 4.2.1
  • CMS version: Drupal
  • MySQL version: MySQL5
  • PHP version: PHP5
Call a procedure in a custom search?
February 06, 2013, 06:06:37 am
Hi I have a custom search that I am trying to create. The SQL has a union statement, so I wasn't sure how to put that type of code into the php file. So I thought I would create a stored procedure. I created the stored procedure with a parameter and it works great, but can I call a stored procedure in a custom search file? If so where would I put that?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Call a procedure in a custom search?
February 06, 2013, 08:40:25 am

the custom search interface does not impose restrictions on the type of sql statement used. I think the only restriction is it returns one sql statement, and you can accomplish this by using temp tables and return a select * on the temp table as the final result (in case of complex searches)

check:

CRM/Contact/Form/Search/Custom/Group.php

for a more complex query search

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Call a procedure in a custom search?

This forum was archived on 2017-11-26.