Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Calling Stored proc from MFC CRecordset

Calling Stored proc from MFC CRecordset

From: <JohnRonan_at_worldnet.att.net>
Date: Thu, 27 Aug 1998 15:39:11 GMT
Message-ID: <6s3uj0$gqb$1@nnrp1.dejanews.com>


I have a stored procedure that I call from a Visual C++ MFC CREcordset-derived class. ("CStoredRec").

The stored procedure simply has one output VARCHAR parameter that gets assigned a value. With one driver, I get: "numeric or value error". With another driver, I get: "invalid length inside variable character string". With a third driver (Oracle73), I get no errors but my output param is not affected. I know the stored proc works, because I use it elsewhere (tho not from a crecordset).
here are appropriate code frags. What am I missing here?

note: m_procName is a "soft" procedure name. it is a CString and is [correctly] set to the name of the procedure. m_returnValue is a

// constructor

CStoredRec::CStoredRec(CDatabase* pdb, CString const &procName)
{

 //{{AFX_FIELD_INIT(CStoredRec)
 //}}AFX_FIELD_INIT

 m_nDefaultType = snapshot;
 m_procName = procName;
 m_pDatabase = pdb;
 m_returnValue = _T("xxxxxxx");
 m_nFields = 0;
 m_nParams = 1;

}

CString CStoredRec::GetDefaultSQL()
{

 CString str;
 str.Format("{CALL %s(?)}", m_procName);  return _T(str);
}

void CStoredRec::DoFieldExchange(CFieldExchange* pFX)
{

 pFX->SetFieldType(CFieldExchange::outputParam);

 RFX_Text( pFX, "unused", m_returnValue);

 //RFX_Text(pFX, _T("message"), m_returnValue);  //{{AFX_FIELD_MAP(CStoredRec)
 pFX->SetFieldType(CFieldExchange::outputColumn);  //}}AFX_FIELD_MAP
 //RFX_Int(pFX, _T("[unused]"), m_returnValue); }

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Aug 27 1998 - 10:39:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US