Advertisement

05.21.2008 at 12:09AM PDT, ID: 23419827
[x]
Attachment Details

Call 'C' Function using SQL

Asked by HRMorton in C Programming Language, SQL Query Syntax

Tags: C, C

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

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
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';
 
......
[+][-]05.21.2008 at 12:16AM PDT, ID: 21612713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 12:37AM PDT, ID: 21612795

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 12:52AM PDT, ID: 21612843

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C Programming Language, SQL Query Syntax
Tags: C, C
Sign Up Now!
Solution Provided By: sunnycoder
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.21.2008 at 01:01AM PDT, ID: 21612877

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 01:26AM PDT, ID: 21612978

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628