Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access store procedure through db library in C

Status
Not open for further replies.

calum

Programmer
May 24, 2002
1
GB
// Store Procedure
CREATE proc calum_select_mcf_patient
(@piuid varchar(64) = '1%',
@domain_ref int = 1131)
as
select * from mcf_patient
where patient_instance_uid like @piuid
and domain_ref = @domain_ref
return
GO

// SQL Client Library
#include <sqlfront.h>
#include <sqldb.h>


// C Program
DBCHAR piuid[64]=&quot;'1%'&quot;;
...
if (dbrpcparam(dbproc, &quot;@piuid&quot;, (BYTE)NULL, SQLVARCHAR, 64, 64, (BYTE *)piuid) == FAIL)
{
printf(&quot;dbrpcparam failed.\n&quot;);
dbexit();
exit(ERREXIT);
}
...
/* Print any rows that may have been returned. */
dbprrow(dbproc);
...

Program runs but no result returns back, any insight? I tried the fourth and fifth parameter as (-1, 64), (-1, 4) also, none of them works.
(When I run calum_select_mcf_patient '1%' in SQL QA it's fine)

Thanks,
Calum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top