| 1846 | // |
| 1847 | |
| 1848 | static 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 | //____________________________________________________________ |
no test coverage detected