Subj : Pb with Stored Procedure To : borland.public.cpp.borlandcpp From : dohugo Date : Tue Jun 08 2004 06:13 am I have problem using String as output parameter in stored procedure. My output String does not contain a terminated char. So it contains the out put string and some other characters (saved in memory) Did I miss something in the code below or is there something wrong in my DB ? Thanks in advance. TStoredProc * __fastcall TDBO::PrepareSP() { TStoredProc *spGetOrderNum = NULL; TParam *prm = NULL; sp = NewStoredProc(Application,"STOPROCNA",pbByName); try{ if (sp){ prm = sp->Params-> CreateParam(ftString, "ONAME", ptOutput); prm = sp->Params-> CreateParam(ftString, "STOPROCNA", ptResult); } return( sp); } catch (Exception &exception) { FreeStoredProc(sp); return( (TStoredProc *)NULL ); } } **** bool __fastcall TDBO::ExecuteSP( AnsiString &aONA ) { bool bRet = false; TStoredProc *sp = (TStoredProc *)NULL; sp= PrepareSP(); if (sp) { try { sp->Prepare(); sp->ExecProc(); aONA = sp->ParamByName("ONAME")->AsString; bRet = true; sp->Close(); FreeStoredProc(sp); } catch ( Exception &exception ) { FreeStoredProc(sp); } } return ( bRet ); } .