title: Executing a stored procedure over ODBC
body: <p>I have an application that allows the user to enter an SQL string with a placeholder for certain values my application produces. The application will the replace the placeholders with values and execute the SQL string through various database backends.</p>
  
  <p>For the ODBC backend, I call SQLExecDirect() on the SQL strin which works nicely on regular queries, but fails for stored procedures with parameters.</p>
  
  <p>Is there a simple way to extend this mechanism to support stored procedures ? A certain way how the SQL must be written ?</p>
  
  <p>The only thing I can think of right now is to start parsing the SQL string and call SQLBindParameter() n times if it conatains a "call". But parsing SQL is tricky.</p>
  
  <p>Any ideas ?</p>
  
  <p>Working SQL example: SELECT columnA from foo where columnB = '%placeholder'</p>
  
  <p>Non-working SQL: CALL StoredFoo('%placeholder')</p>