Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Error when calling stored procedure from CRecordset

Error when calling stored procedure from CRecordset

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++csharpcsssharepoint
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nandiator
    wrote on last edited by
    #1

    Hello, I am using MFC to call a stored procedure written in Oracle PL/SQL, but when I make the call I get the next error in Spanish: "No se enlazaron columnas antes de llamar a SQLFetchScroll o SQLExtendedFetch", which more or less in English means: "No rows were binded before calling SQLFetchScroll or SQLExtendedFetch". I am using a CRecordset derived class to access the stored procedure. I am unable to find the error. THE STORED PROCEDURE'S HEADER: Sp_Int_Ot_Ordendetrabajoalta ( lineatrabajo NUMBER, lv_orden NUMBER, usuario VARCHAR2, idvehiculo NUMBER, fechamax1 VARCHAR2, resumen VARCHAR2, detalle VARCHAR2, coderp VARCHAR2, numtrabrecibidos NUMBER, lv_CODOT VARCHAR2, retorno OUT INTEGER) THE .H FOR THE CRECORDSET DERIVED CLASS (Visual Studio 6 comments removed) class CRecSP : public CRecordset { public: CRecSP(CDatabase* pDatabase = NULL); DECLARE_DYNAMIC(CRecSP) CString m_szSQL; long m_RETORNO; virtual CString GetDefaultConnect(); virtual CString GetDefaultSQL(); virtual void DoFieldExchange(CFieldExchange* pFX); }; THE .CPP FOR THE CLASS (VS6 comments removed) IMPLEMENT_DYNAMIC(CRecSP, CRecordset) CRecSP::CRecSP(CDatabase* pdb) : CRecordset(pdb) { m_RETORNO = 0; m_nParams = 1; m_nDefaultType = snapshot; } CString CRecSP::GetDefaultConnect() { return _T( DB_CONNECTION_STRING ); } CString CRecSP::GetDefaultSQL() { return m_szSQL; } void CRecSP::DoFieldExchange(CFieldExchange* pFX) { pFX->SetFieldType(CFieldExchange::outputParam); RFX_Long(pFX, _T("[retorno]"), m_RETORNO ); } USING THE CRECORDSET DERIVED CLASS: (Vars read from EditBoxes as CStrings and formatted in the SQL) CRecSP *rec = new CRecSP(&db); szSQL.Format( "{CALL FGROT2005.SP_INT_OT_ORDENDETRABAJOALTA(%s,%s,'%s',%s,'%s','%s','%s','%s',%s,'%s',?)}", szLinea, szOrden, "USER", szIdVeh, szFechaMax, szResumen, szDetalle, "ERP", "0", szCodOT ); rec->m_szSQL = szSQL; //rec->Open( CRecordset::forwardOnly,szSQL,CRecordset::readOnly ); rec->Open( ); iError = rec->m_RETORNO; rec->Close(); -- modified at 3:49 Tuesday 6th September, 2005

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups