inline void CaUserDefault::Init(CaNode* pNode) { m_strVirtualNodeUser = _T(""); CaSessionManager& sessionMgr = theApp.GetSessionManager(); CaSession session; session.SetNode(pNode->GetName()); session.SetDatabase(_T("iidbdb")); session.SetIndependent(TRUE); session.SetDescription(sessionMgr.GetDescription()); CaSessionUsage UseSession (&sessionMgr, &session); m_strVirtualNodeUser = INGRESII_llDBMSInfo(_T("username")); // session_user? }
BOOL IJA_llQueryTableTransactionData ( CaQueryTransactionInfo* pQueryInfo, CaTableTransactionItemData* pTableTrans) { CString strStatement; CString strDatabase; CString strDatabaseOwner; CString strTable; CString strTableOwner; if (!pQueryInfo) return FALSE; pQueryInfo->GetDatabase (strDatabase, strDatabaseOwner); pQueryInfo->GetTable (strTable, strTableOwner); CaSessionManager& smgr = theApp.GetSessionManager(); CaSession session; session.SetNode(pQueryInfo->GetNode()); session.SetDatabase(strDatabase); session.SetIndependent(TRUE); CaSessionUsage sessionUsage(&smgr, &session, SESSION_COMMIT); // commit on release // // TODO: Replace this statement to select from the temporary table: strStatement.Format (_T("select * from %s.%s"), (LPCTSTR)strTableOwner, (LPCTSTR)strTable); CaIjaCursor* pCursor = new CaIjaCursor (1, strStatement); if (pCursor && pCursor->Open()) { int nCount = 0; CStringList& listData = pTableTrans->GetListData(); // // Fetch only one row for a transaction <pTableTrans> pCursor->Fetch(listData, nCount); pCursor->Close(); } return TRUE; }