| 1924 | // |
| 1925 | |
| 1926 | static void gen_dyn_prepare(const act* action) |
| 1927 | { |
| 1928 | const TEXT* transaction; |
| 1929 | gpre_req* request; |
| 1930 | gpre_req req_const; |
| 1931 | |
| 1932 | const dyn* statement = (const dyn*) action->act_object; |
| 1933 | const gpre_dbb* database = statement->dyn_database; |
| 1934 | |
| 1935 | if (statement->dyn_trans) |
| 1936 | { |
| 1937 | transaction = statement->dyn_trans; |
| 1938 | request = &req_const; |
| 1939 | request->req_trans = transaction; |
| 1940 | } |
| 1941 | else |
| 1942 | { |
| 1943 | transaction = "gds__trans"; |
| 1944 | request = NULL; |
| 1945 | } |
| 1946 | |
| 1947 | if (gpreGlob.sw_auto) |
| 1948 | { |
| 1949 | t_start_auto(request, status_vector(), action, true); |
| 1950 | printa(COLUMN, "if (%s .ne. 0) then", transaction); |
| 1951 | } |
| 1952 | |
| 1953 | const TEXT* sqlda = statement->dyn_sqlda; |
| 1954 | #ifdef HPUX |
| 1955 | TEXT s2[64]; |
| 1956 | if (sqlda) |
| 1957 | { |
| 1958 | sprintf(s2, "isc_baddress (%s)", sqlda); |
| 1959 | sqlda = s2; |
| 1960 | } |
| 1961 | #endif |
| 1962 | |
| 1963 | TEXT s1[MAX_CURSOR_SIZE]; |
| 1964 | printa(COLUMN, "CALL %s (isc_status, %s, %s, %s, %sLEN(%s)%s, %s%s%s, %s%d%s, %s)", |
| 1965 | ISC_EMBED_DSQL_PREPARE, database->dbb_name->sym_string, |
| 1966 | transaction, make_name(s1, statement->dyn_statement_name), |
| 1967 | DSQL_I2CONST_1, statement->dyn_string, DSQL_I2CONST_2, REF_1, |
| 1968 | statement->dyn_string, REF_2, DSQL_I2CONST_1, gpreGlob.sw_sql_dialect, |
| 1969 | DSQL_I2CONST_2, sqlda ? sqlda : NULL_SQLDA); |
| 1970 | |
| 1971 | if (gpreGlob.sw_auto) |
| 1972 | printa(COLUMN, "END IF"); |
| 1973 | |
| 1974 | status_and_stop(action); |
| 1975 | } |
| 1976 | |
| 1977 | |
| 1978 | //____________________________________________________________ |
no test coverage detected