| 1975 | // |
| 1976 | |
| 1977 | static void gen_dyn_immediate( const act* action) |
| 1978 | { |
| 1979 | gpre_req* request; |
| 1980 | gpre_req req_const; |
| 1981 | |
| 1982 | const dyn* statement = (dyn*) action->act_object; |
| 1983 | const TEXT* transaction; |
| 1984 | if (statement->dyn_trans) |
| 1985 | { |
| 1986 | transaction = statement->dyn_trans; |
| 1987 | request = &req_const; |
| 1988 | request->req_trans = transaction; |
| 1989 | } |
| 1990 | else |
| 1991 | { |
| 1992 | transaction = names[isc_trans_pos]; |
| 1993 | request = NULL; |
| 1994 | } |
| 1995 | |
| 1996 | const gpre_dbb* database = statement->dyn_database; |
| 1997 | |
| 1998 | TEXT s[64]; |
| 1999 | const TEXT* s2 = "ISC-CONST-DYN-IMMEDL"; |
| 2000 | printa(names[COLUMN], true, GET_LEN_CALL_TEMPLATE, STRING_LENGTH, statement->dyn_string, s2); |
| 2001 | sprintf(s, " %s%s%s,", BY_VALUE, s2, END_VALUE); |
| 2002 | |
| 2003 | if (gpreGlob.sw_auto) |
| 2004 | { |
| 2005 | t_start_auto(request, status_vector(action), action, true); |
| 2006 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2007 | } |
| 2008 | |
| 2009 | printa(names[COLUMN], true, |
| 2010 | statement->dyn_sqlda2 ? |
| 2011 | "CALL \"%s\" USING %s, %s%s, %s%s,%s %s%s, %s%d%s, %s%s, %s%s" : |
| 2012 | "CALL \"%s\" USING %s, %s%s, %s%s,%s %s%s, %s%d%s, %s%s", |
| 2013 | statement->dyn_sqlda2 ? ISC_EXECUTE_IMMEDIATE2 : ISC_EXECUTE_IMMEDIATE, |
| 2014 | status_vector(action), BY_REF, database->dbb_name->sym_string, |
| 2015 | BY_REF, transaction, s, BY_DESC, statement->dyn_string, BY_VALUE, |
| 2016 | gpreGlob.sw_sql_dialect, END_VALUE, |
| 2017 | statement->dyn_sqlda ? BY_REF : "", |
| 2018 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED, |
| 2019 | statement->dyn_sqlda2 ? BY_REF : "", |
| 2020 | statement->dyn_sqlda2 ? statement->dyn_sqlda2 : OMITTED); |
| 2021 | |
| 2022 | if (gpreGlob.sw_auto) |
| 2023 | printa(names[COLUMN], false, "END-IF"); |
| 2024 | |
| 2025 | set_sqlcode(action); |
| 2026 | } |
| 2027 | |
| 2028 | |
| 2029 | //____________________________________________________________ |
no test coverage detected