MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / gen_fetch

Function gen_fetch

src/gpre/languages/ada.cpp:1848–1890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1846//
1847
1848static void gen_fetch( const act* action, int column)
1849{
1850 gpre_req* request = action->act_request;
1851
1852 if (request->req_sync)
1853 {
1854 gen_send(action, request->req_sync, column);
1855 printa(column, "if SQLCODE = 0 then");
1856 column += INDENT;
1857 }
1858
1859 gen_receive(action, column, request->req_primary);
1860 printa(column, "if SQLCODE = 0 then");
1861 column += INDENT;
1862
1863 SCHAR s[20];
1864 printa(column, "if %s /= 0 then", gen_name(s, request->req_eof, true));
1865 column += INDENT;
1866
1867 gpre_nod* var_list = (gpre_nod*) action->act_object;
1868 if (var_list)
1869 {
1870 for (int i = 0; i < var_list->nod_count; i++)
1871 asgn_to(action, (ref*) var_list->nod_arg[i], column);
1872 }
1873 else
1874 {
1875 // No WITH clause on the FETCH, so no assignments generated; fix
1876 // for bug#940. mao 6/20/89
1877 printa(column, "NULL;");
1878 }
1879
1880 column -= INDENT;
1881 printa(column, "else");
1882 printa(column + INDENT, "SQLCODE := 100;");
1883 endif(column);
1884 column -= INDENT;
1885 endif(column);
1886 column -= INDENT;
1887
1888 if (request->req_sync)
1889 endif(column);
1890}
1891
1892
1893//____________________________________________________________

Callers 1

ADA_actionFunction · 0.70

Calls 6

gen_sendFunction · 0.70
printaFunction · 0.70
gen_receiveFunction · 0.70
gen_nameFunction · 0.70
asgn_toFunction · 0.70
endifFunction · 0.70

Tested by

no test coverage detected