CVS update: php3/functions

From: Date: Fri, 25 Sep 1998 20:08:38 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1511@lists.php.net to get a copy of this message
Date: Friday September 25, 1998 @ 16:08 Author: danny Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv2245/functions Modified Files: ifx.ec Log Message: Added support for stored procedures, both cursory and noncursory. Result columns automatically renamed : [Expr_1] , [Expr_2] , etc... Index: php3/functions/ifx.ec diff -c php3/functions/ifx.ec:1.28 php3/functions/ifx.ec:1.29 *** php3/functions/ifx.ec:1.28 Tue Sep 22 13:08:58 1998 --- php3/functions/ifx.ec Fri Sep 25 16:08:36 1998 *************** *** 86,91 **** --- 86,94 ---- - supports now IUS- serial8,int8,boolean, nchar, nvchar, lvarchar - still incomplete slob-support + Changes 25.9.1998 (danny.heijl@cevi.be) + - cursory and non-cursory stored procedures + */ *************** *** 914,919 **** --- 917,923 ---- int ctype; int affected_rows; int query_type; + int cursoryproc; Informix_TLS_VARS; *************** *** 1006,1016 **** for (i = 0; i < MAXSLOBS; ++i) Ifx_Result->slob_id[i] = -1; $endif; Ifx_Result->iscursory = -1; /* prevent ifx_do */ Ifx_Result->paramquery=0; ! if (query_type != 0) { /* not a select, execute immediate */ /* ## ## NONSELECT-STATEMENT ## --- 1010,1028 ---- for (i = 0; i < MAXSLOBS; ++i) Ifx_Result->slob_id[i] = -1; $endif; + + cursoryproc = 0; + if (query_type == SQ_EXECPROC) { + EXEC SQL GET DESCRIPTOR :descrpid :i = COUNT; + if (i > 0) { + cursoryproc = 1; + } + } Ifx_Result->iscursory = -1; /* prevent ifx_do */ Ifx_Result->paramquery=0; ! if ((query_type != 0) && (!cursoryproc)) { /* NO RESULT SET */ /* ## ## NONSELECT-STATEMENT ## *************** *** 1243,1248 **** --- 1255,1261 ---- int ctype; int affected_rows; int query_type; + int cursoryproc; Informix_TLS_VARS; *************** *** 1339,1348 **** Ifx_Result->slob_id[i] = -1; $endif; Ifx_Result->iscursory = -1; /* prevent ifx_do */ Ifx_Result->paramquery=0; ! if (query_type != 0) { /* not a select, execute immediate */ /* ## ## NONSELECT-STATEMENT ## --- 1352,1369 ---- Ifx_Result->slob_id[i] = -1; $endif; + cursoryproc = 0; + if (query_type == SQ_EXECPROC) { + EXEC SQL GET DESCRIPTOR :descrpid :i = COUNT; + if (i > 0) { + cursoryproc = 1; + } + } + Ifx_Result->iscursory = -1; /* prevent ifx_do */ Ifx_Result->paramquery=0; ! if ((query_type != 0) && (!cursoryproc)) { /* NO RESULT SET */ /* ## ## NONSELECT-STATEMENT ## *************** *** 1943,1948 **** --- 1964,1972 ---- p = fieldname; /* rtrim fieldname */ while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; *p = 0; + + if (strcmp("(expression)", fieldname) == 0) /* stored proc */ + sprintf(fieldname, "[Expr_%d]", i); if (indicator == -1) { /* NULL */ if((Informix_GLOBAL(php3_ifx_module).textasvarchar==0 *************** *** 2257,2262 **** --- 2281,2288 ---- *p = toupper(*p); while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; *p = 0; + if (strcmp("(expression)", fieldname) == 0) /* stored proc */ + sprintf(fieldname, "[Expr_%d]", i); php3_printf("<th>%s</th>", fieldname); } *************** *** 2555,2560 **** --- 2581,2588 ---- p = fieldname; /* rtrim fieldname */ while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; *p = 0; + if (strcmp("(expression)", fieldname) == 0) /* stored proc */ + sprintf(fieldname, "[Expr_%d]", i); switch (fieldtype) { case SQLSERIAL : *************** *** 2761,2766 **** --- 2789,2797 ---- p = fieldname; /* rtrim fieldname */ while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; *p = 0; + if (strcmp("(expression)", fieldname) == 0) /* stored proc */ + sprintf(fieldname, "[Expr_%d]", i); + switch (fieldtype) { case SQLSERIAL : char_data = "SQLSERIAL"; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1511) next »