Forum Stats

  • 3,770,593 Users
  • 2,253,137 Discussions
  • 7,875,502 Comments

Discussions

memory allocation of OCIBindDynamic callback

ys123
ys123 Member Posts: 96 Blue Ribbon
edited May 17, 2015 11:19PM in Oracle Call Interface (OCI)

Hi dear all,

Is it safe to allocate buffer from stack in the callback like this ?

static sb4 CBIN(
  void *ictxp, 
  OCIBind *bindp, 
  ub4 iter,
  ub4 index, 
  void **bufpp, 
  ub4 *alenp,
  ub1 *piecep,
  void **indp)
{
  char buf[100];
  sprintf(buf,"TEST %d %d",iter,index);
  *bufpp = buf;
  ...
  return OCI_CONTINUE;
}
This discussion has been closed.