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

Function main

src/interfaces/ecpg/test/expected/sql-binary.c:52–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51
52int
53main (void)
54{
55 /* exec sql begin declare section */
56
57
58
59
60#line 22 "binary.pgc"
61 struct TBempl empl ;
62
63#line 23 "binary.pgc"
64 char * pointer = NULL ;
65
66#line 24 "binary.pgc"
67 char * data = "\\001\\155\\000\\212" ;
68/* exec sql end declare section */
69#line 25 "binary.pgc"
70
71 int i;
72
73 ECPGdebug (1, stderr);
74
75 empl.idnum = 1;
76 { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
77#line 31 "binary.pgc"
78
79if (sqlca.sqlcode < 0) exit (1);}
80#line 31 "binary.pgc"
81
82 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set bytea_output = escape", ECPGt_EOIT, ECPGt_EORT);
83#line 32 "binary.pgc"
84
85if (sqlca.sqlcode < 0) exit (1);}
86#line 32 "binary.pgc"
87
88 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea )", ECPGt_EOIT, ECPGt_EORT);
89#line 34 "binary.pgc"
90
91if (sqlca.sqlcode < 0) exit (1);}
92#line 34 "binary.pgc"
93
94 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into empl values ( 1 , 'first user' , 320 , $1 )",
95 ECPGt_char,&(data),(long)0,(long)1,(1)*sizeof(char),
96 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
97#line 35 "binary.pgc"
98
99if (sqlca.sqlcode < 0) exit (1);}
100#line 35 "binary.pgc"
101
102 ECPGset_var( 0, &( empl.idnum ), __LINE__);\
103 /* declare C cursor for select name , accs , byte from empl where idnum = $1 */
104#line 36 "binary.pgc"
105
106if (sqlca.sqlcode < 0) exit (1);
107#line 36 "binary.pgc"
108
109#line 36 "binary.pgc"

Callers

nothing calls this directly

Calls 5

ECPGdebugFunction · 0.85
ECPGconnectFunction · 0.85
ECPGdoFunction · 0.85
ECPGset_varFunction · 0.85
ECPGdisconnectFunction · 0.85

Tested by

no test coverage detected