July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Following the pattern set in the previous few chapters, I'll wrap up the discussion of ecpg by developing an interactive query processor. Because of the complexity of using ecpg to handle dynamic queries, I'll take a few shortcuts in this client, and I'll try to point to them as I go.
Let's start by looking at the main() function for the final client application in this chapter:
1 /* client4.pgc */ 2 3 #include <stdio.h> 4 #include <stdlib.h> 5 6 EXEC SQL INCLUDE sql3types; 7 EXEC SQL INCLUDE sqlca; 8 9 EXEC SQL WHENEVER SQLERROR DO print_error(); 10 11 static int is_select_stmt( char * stmt ); 12 static void process_other_stmt( char * stmt_text ); 13 static void process_select_stmt( char * stmt_text ); ...
Read now
Unlock full access