Header And Logo

PostgreSQL
| The world's most advanced open source database.

sql-show.c

Go to the documentation of this file.
00001 /* Processed by ecpg (regression mode) */
00002 /* These include files are added by the preprocessor */
00003 #include <ecpglib.h>
00004 #include <ecpgerrno.h>
00005 #include <sqlca.h>
00006 /* End of automatic include section */
00007 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
00008 
00009 #line 1 "show.pgc"
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <string.h>
00013 
00014 
00015 #line 1 "regression.h"
00016 
00017 
00018 
00019 
00020 
00021 
00022 #line 5 "show.pgc"
00023 
00024 
00025 int main() {
00026   /* exec sql begin declare section */
00027        
00028   
00029 #line 9 "show.pgc"
00030  char var [ 25 ] = "public" ;
00031 /* exec sql end declare section */
00032 #line 10 "show.pgc"
00033 
00034 
00035   ECPGdebug(1, stderr);
00036   { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
00037 #line 13 "show.pgc"
00038 
00039 
00040   /* exec sql whenever sql_warning  sqlprint ; */
00041 #line 15 "show.pgc"
00042 
00043   /* exec sql whenever sqlerror  sqlprint ; */
00044 #line 16 "show.pgc"
00045 
00046 
00047   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set search_path to $0", 
00048     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00049     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
00050 #line 18 "show.pgc"
00051 
00052 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00053 #line 18 "show.pgc"
00054 
00055 if (sqlca.sqlcode < 0) sqlprint();}
00056 #line 18 "show.pgc"
00057 
00058   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show search_path", ECPGt_EOIT, 
00059     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00060     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
00061 #line 19 "show.pgc"
00062 
00063 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00064 #line 19 "show.pgc"
00065 
00066 if (sqlca.sqlcode < 0) sqlprint();}
00067 #line 19 "show.pgc"
00068 
00069   printf("Var: Search path: %s\n", var);
00070 
00071   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set search_path to 'public'", ECPGt_EOIT, ECPGt_EORT);
00072 #line 22 "show.pgc"
00073 
00074 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00075 #line 22 "show.pgc"
00076 
00077 if (sqlca.sqlcode < 0) sqlprint();}
00078 #line 22 "show.pgc"
00079 
00080   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show search_path", ECPGt_EOIT, 
00081     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00082     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
00083 #line 23 "show.pgc"
00084 
00085 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00086 #line 23 "show.pgc"
00087 
00088 if (sqlca.sqlcode < 0) sqlprint();}
00089 #line 23 "show.pgc"
00090 
00091   printf("Var: Search path: %s\n", var);
00092 
00093   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set standard_conforming_strings to off", ECPGt_EOIT, ECPGt_EORT);
00094 #line 26 "show.pgc"
00095 
00096 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00097 #line 26 "show.pgc"
00098 
00099 if (sqlca.sqlcode < 0) sqlprint();}
00100 #line 26 "show.pgc"
00101 
00102   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show standard_conforming_strings", ECPGt_EOIT, 
00103     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00104     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
00105 #line 27 "show.pgc"
00106 
00107 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00108 #line 27 "show.pgc"
00109 
00110 if (sqlca.sqlcode < 0) sqlprint();}
00111 #line 27 "show.pgc"
00112 
00113   printf("Var: Standard conforming strings: %s\n", var);
00114 
00115   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set time zone PST8PDT", ECPGt_EOIT, ECPGt_EORT);
00116 #line 30 "show.pgc"
00117 
00118 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00119 #line 30 "show.pgc"
00120 
00121 if (sqlca.sqlcode < 0) sqlprint();}
00122 #line 30 "show.pgc"
00123 
00124   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show time zone", ECPGt_EOIT, 
00125     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00126     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
00127 #line 31 "show.pgc"
00128 
00129 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00130 #line 31 "show.pgc"
00131 
00132 if (sqlca.sqlcode < 0) sqlprint();}
00133 #line 31 "show.pgc"
00134 
00135   printf("Time Zone: %s\n", var);
00136 
00137   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set transaction isolation level read committed", ECPGt_EOIT, ECPGt_EORT);
00138 #line 34 "show.pgc"
00139 
00140 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00141 #line 34 "show.pgc"
00142 
00143 if (sqlca.sqlcode < 0) sqlprint();}
00144 #line 34 "show.pgc"
00145 
00146   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show transaction isolation level", ECPGt_EOIT, 
00147     ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char), 
00148     ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
00149 #line 35 "show.pgc"
00150 
00151 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00152 #line 35 "show.pgc"
00153 
00154 if (sqlca.sqlcode < 0) sqlprint();}
00155 #line 35 "show.pgc"
00156 
00157   printf("Transaction isolation level: %s\n", var);
00158 
00159   { ECPGdisconnect(__LINE__, "ALL");
00160 #line 38 "show.pgc"
00161 
00162 if (sqlca.sqlwarn[0] == 'W') sqlprint();
00163 #line 38 "show.pgc"
00164 
00165 if (sqlca.sqlcode < 0) sqlprint();}
00166 #line 38 "show.pgc"
00167 
00168 
00169   return 0;
00170 }