Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Failed to use Pro *C to write CGI program ?

Failed to use Pro *C to write CGI program ?

From: Eric Chow <eric138_at_yahoo.com>
Date: Fri, 15 Oct 1999 15:26:00 +0800
Message-ID: <3806D708.C2383EE@yahoo.com>


Hello,

I tried to use Pro *C to write a simple CGI program, but it failed when I executed in browsers.
The following is the source code :



#include <stdio.h>
EXEC SQL INCLUDE SQLCA;
int main() {

   char db[] = "user/pass_at_db";
   int result;

   EXEC SQL CONNECT :db;

   EXEC SQL SELECT count(*) INTO result FROM testDB;    /* output to the WEB */
   printf("Content-type: text/html\n");    printf("<html><body>Result = %d</body></html>\n", result);    return 1;
}



The above program can compile successfully and can be executed very well in command prompt in Sun Solaris 2.6.
After I put the executable file in cgi-bin, and load in in browser. It can't display anything justpop out a window with "This document contains no data....". And then I remove all the embed SQL just leaving the standard C statements, it can be loaded well in browser.

Would you please to teach me how can I use C(Pro *C) to write CGI program ??
Or is there any other method to connect to Oracle in C ?????

Best regards,
Eric Received on Fri Oct 15 1999 - 02:26:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US