summaryrefslogtreecommitdiffstats
path: root/src/interfaces/ecpg/test/sql/show.pgc
blob: 339678ae994ca0f915fd940b53e4c90f56c813ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

EXEC SQL INCLUDE ../regression;

int main() {
  EXEC SQL BEGIN DECLARE SECTION;
    char var[25] = "public";
  EXEC SQL END DECLARE SECTION;

  ECPGdebug(1, stderr);
  EXEC SQL CONNECT TO REGRESSDB1;

  EXEC SQL WHENEVER SQLWARNING SQLPRINT;
  EXEC SQL WHENEVER SQLERROR SQLPRINT;

  EXEC SQL SET search_path TO :var;
  EXEC SQL SHOW search_path INTO :var;
  printf("Var: Search path: %s\n", var);

  EXEC SQL SET search_path TO 'public';
  EXEC SQL SHOW search_path INTO :var;
  printf("Var: Search path: %s\n", var);

  EXEC SQL SET standard_conforming_strings TO off;
  EXEC SQL SHOW standard_conforming_strings INTO :var;
  printf("Var: Standard conforming strings: %s\n", var);

  EXEC SQL SET TIME ZONE PST8PDT;
  EXEC SQL SHOW TIME ZONE INTO :var;
  printf("Time Zone: %s\n", var);

  EXEC SQL SET TRANSACTION ISOLATION LEVEL read committed;
  EXEC SQL SHOW TRANSACTION ISOLATION LEVEL INTO :var;
  printf("Transaction isolation level: %s\n", var);

  EXEC SQL DISCONNECT ALL;

  return 0;
}