MCPcopy Create free account
hub / github.com/apache/cloudberry / main

Function main

src/interfaces/ecpg/test/expected/sql-func.c:25–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25int main() {
26
27#line 8 "func.pgc"
28 char text [ 25 ] ;
29
30#line 8 "func.pgc"
31
32
33 ECPGdebug(1, stderr);
34 { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
35#line 11 "func.pgc"
36
37
38 { ECPGsetcommit(__LINE__, "on", NULL);}
39#line 13 "func.pgc"
40
41 /* exec sql whenever sql_warning sqlprint ; */
42#line 14 "func.pgc"
43
44 /* exec sql whenever sqlerror sqlprint ; */
45#line 15 "func.pgc"
46
47
48 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table My_Table ( Item1 int , Item2 text )", ECPGt_EOIT, ECPGt_EORT);
49#line 17 "func.pgc"
50
51if (sqlca.sqlwarn[0] == 'W') sqlprint();
52#line 17 "func.pgc"
53
54if (sqlca.sqlcode < 0) sqlprint();}
55#line 17 "func.pgc"
56
57 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table Log ( name text , w text )", ECPGt_EOIT, ECPGt_EORT);
58#line 18 "func.pgc"
59
60if (sqlca.sqlwarn[0] == 'W') sqlprint();
61#line 18 "func.pgc"
62
63if (sqlca.sqlcode < 0) sqlprint();}
64#line 18 "func.pgc"
65
66
67 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create function My_Table_Check ( ) returns trigger as $test$\
68 BEGIN\
69 INSERT INTO Log VALUES(TG_NAME, TG_WHEN);\
70 RETURN NEW;\
71 END; $test$ language plpgsql", ECPGt_EOIT, ECPGt_EORT);
72#line 26 "func.pgc"
73
74if (sqlca.sqlwarn[0] == 'W') sqlprint();
75#line 26 "func.pgc"
76
77if (sqlca.sqlcode < 0) sqlprint();}
78#line 26 "func.pgc"
79
80
81 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create trigger My_Table_Check_Trigger before insert on My_Table for each row execute procedure My_Table_Check ( )", ECPGt_EOIT, ECPGt_EORT);
82#line 32 "func.pgc"

Callers

nothing calls this directly

Calls 6

ECPGdebugFunction · 0.85
ECPGconnectFunction · 0.85
ECPGsetcommitFunction · 0.85
ECPGdoFunction · 0.85
sqlprintFunction · 0.85
ECPGdisconnectFunction · 0.85

Tested by

no test coverage detected