Help! Experts in pro*c and PL/SQL
Date: Mon, 26 Dec 1994 00:14:05 GMT
Message-ID: <D1E5zI.MCG_at_mail.auburn.edu>
Hi,
I'm having problem when I'm trying to run the following
pro*c program with PL/SQL embedded in it. Iam just not able
to run it. I want to be able to execute any query in this
fashion...
#include <stdio.h>
main()
{
EXEC SQL BEGIN DECLARE SECTION;
char username[20];
char password[20];
char stmt[80];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE sqlca;
strcpy(username,"username");
strcpy(password,"password");
printf("please enter your SQL query >"); scanf("%s",stmt);
EXEC SQL WHENEVER SQLERROR goto sql_error;
EXEC SQL CONNECT :username IDENTIFIED BY :password;
/****************** I want to put a PL/SQL block here************************/
EXEC SQL EXECUTE
BEGIN
spool result; /**I want to open result to spool the result into**/
stmt; /*here I want to execute the statement */
spool off;
END;
END-EXEC;
/** End PL/SQL block**/
sql_error:
printf("error!");
}
---Received on Mon Dec 26 1994 - 01:14:05 CET
**************************** *********************************
Vasudev Yendapally 333 EastMagnolia Ave # 3 Dept. of Computer Science Auburn AL - 36830 Auburn University Phone (205)-821-3501
**************************** *********************************