Skip to Content.
Sympa Menu

freetds - Working with stored procedures

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Vladimir Maximenko <mvu AT himera.wplus.net>
  • To: TDS development Group <freetds AT franklin.oit.unc.edu>
  • Cc: "Ruslan R. Laishev" <Laishev AT SMTP.DeltaTel.RU>
  • Subject: Working with stored procedures
  • Date: Wed, 28 Feb 2001 09:16:38 +0300 (MSK)


Hi!
I use FreeTDS library to connect to SyBaseSQL server and have some
troubles with calling and receave data from Stored procedures. Developers
can't help me and I decide develop it for myself.
In the attachment we have repared function in libtds/mem.c:
TDSPARAMINFO *tds_alloc_param_result(TDSPARAMINFO *old_param)
It worked not correctly and I repare it.
Now I work for another path of this problem......

--========== The best regards ============--

Vladimir U. Maximenko

mailto: mvu AT wplus.net v_max99 AT mailru.com v_max99 AT mail.ru
_alloc_param_result() works a bit differently than the other alloc result
** functions. Output parameters come in individually with no total number
** given in advance, so we simply call this func every time with get a
** TDS_PARAM_TOKEN and let it realloc the columns struct one bigger.
** tds_free_all_results() usually cleans up after us.
*/
TDSPARAMINFO *tds_alloc_param_result(TDSPARAMINFO *old_param)
{
TDSPARAMINFO *param_info;
int col;
tdsdump_log("Inside tds_alloc_param_result()\n" );
if (!old_param)
{
tdsdump_log("New pointer\n");
param_info = (TDSPARAMINFO *) malloc(sizeof(TDSPARAMINFO));
memset(param_info,'\0',sizeof(TDSPARAMINFO));
param_info->num_cols=1;
param_info->columns = (TDSCOLINFO **)
malloc(sizeof(TDSCOLINFO *));
param_info->columns[0] = (TDSCOLINFO *)
malloc(sizeof(TDSCOLINFO *));
memset(param_info->columns[0],'\0',sizeof(TDSCOLINFO));
//added by mvu
} else {
tdsdump_log("Another pointer\n");
param_info = old_param;
param_info->num_cols++;
param_info->columns = (TDSCOLINFO **)
realloc(param_info->columns, sizeof(TDSCOLINFO *) * param_info->num_cols);
param_info->columns[param_info->num_cols-1] = (TDSCOLINFO *)
malloc(sizeof(TDSCOLINFO *)); //added by mvu

memset(param_info->columns[param_info->num_cols-1],'\0',sizeof(TDSCOLINFO));
//added by mvu
}
return param_info;
}



  • Working with stored procedures, Vladimir Maximenko, 02/28/2001

Archive powered by MHonArc 2.6.24.

Top of Page