troubleshooting Question

Call 'C' Function using SQL

Avatar of HRMorton
HRMorton asked on
CSQL
5 Comments1 Solution215 ViewsLast Modified:
Hi,

I have a C function, attached, which is usually called from a ProCobol program. I need to call this from SQL, passing in information taken from the database.
Is there a way of doing this ?

Thanks
Heather


void CMMODCHK (char *SortCode,
               char *SortCodeLen,
               char *AccNumber,
               char *AccNumberLen,
               char *AccCode,
               char *ModeFlag,
               char *STSMODFAIL,
               char *STSSCNIRGE,
               char *STSNOBRNCH,
               char *STSTRANDIS,
               char *STSFOREIGN,
               char *STSXSCRIBE,
               char *STSROLLREQ,
               char *STSBADSORT,
               char *STSBADACNT,
               char *STSDATFERR,
               char *RESERVED1,
               char *RESERVED2,
               char *RESERVED3,
               char *RESERVED4,
               char *RESERVED5,
               char *ErrorMsg)
{
   char  cmAccCode[ACCODELEN], cmSortCode[CHKPARAMLEN], cmAccNumber[CHKPARAMLEN];
   char  *index, instring[RECLEN], *instring_ptr, *instringTemp_ptr,
         instringTemp[RECLEN], outstring[RECLEN];
   ULONG cmModeFlag ;
   int   length, counter, rc, port_number, x;
   int sock = -1 ;
   struct hostent *raddr;
   struct sockaddr_in addr ;
   struct sockaddr myaddr;
 
   /* Initialize */
   STSMODFAIL[0] = STSSCNIRGE[0] = STSNOBRNCH[0] = STSTRANDIS[0] =
   STSFOREIGN[0] = STSXSCRIBE[0] = STSROLLREQ[0] = STSBADSORT[0] =
   STSBADACNT[0] = STSDATFERR[0] = RESERVED1[0] = RESERVED1[1] =
   RESERVED2[0] = RESERVED3[0] = RESERVED4[0] = RESERVED5[0] = ErrorMsg[0] = '\0';
 
......
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros