/* Processed by ecpg (regression mode) */ /* These include files are added by the preprocessor */ #include <ecpglib.h> #include <ecpgerrno.h> #include <sqlca.h> /* End of automatic include section */ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
int
main(void)
{ /* exec sql begin declare section */
#line17"test6.pgc" int val1output = 2 ;
#line18"test6.pgc" int val1 = 1 ;
#line19"test6.pgc" char val2 [ 6 ] = "data1" ;
#line20"test6.pgc" char * stmt1 = "SELECT * from test1 where a = $1 and b = $2" ; /* exec sql end declare section */ #line21"test6.pgc"
ECPGdebug(1, stderr);
/* Connect to the database */
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "myconn", 0); } #line26"test6.pgc"
/* Test 1: Try to get descriptor on a disconnected connection */
printf("Test 1: Try to get descriptor on a disconnected connection\n");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test1 ( a int , b text )", ECPGt_EOIT, ECPGt_EORT);} #line30"test6.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test1 ( a , b ) values ( 1 , 'data1' )", ECPGt_EOIT, ECPGt_EORT);} #line31"test6.pgc"
/* Test 2: Try to deallocate all on a non-existent connection */
printf("Test 2: deallocate all with non-existent connection\n");
{ ECPGdeallocate_all(__LINE__, 0, "nonexistent");} #line50"test6.pgc"
printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
/* Test 3: deallocate on disconnected connection */
printf("Test 3: deallocate all on disconnected connection\n");
{ ECPGdeallocate_all(__LINE__, 0, NULL);} #line55"test6.pgc"
printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
/* Test 4: Use prepared statement from non-existent connection */
printf("Test 4: Use prepared statement from non-existent connection\n");
{ ECPGprepare(__LINE__, "nonexistent", 0, "stmt1", "SELECT 1");} #line60"test6.pgc"
/* declare cur1 cursor for $1 */ #line61"test6.pgc"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.