Ò»¸öÊý¾Ý¿â²Ù×÷À࣬ÊÊÓÃÓÚOracle£¬ACCESS,SQLSERVER
×î½ü×öÁËÒ»¸öÊý¾ÝÕï¶ÏµÄÏîÄ¿£¬ÀïÃæ×Ô¼ºÐ´ÁËÒ»¸öÊý¾Ý¿âµÄ²Ù×÷À࣬°üº¬£ºÁ¬½ÓÊý¾Ý¿â¡¢¶ÁÊý¾Ý±í¡¢Ö´ÐÐSQL²Ù×÷£¬ÊÍ·ÅÊý¾Ý¿âµÈ×é³É£¬Ï£Íû¶Ô´ó¼ÒÓÐÓã¬ÓÉÓÚˮƽÓÐÏÞ£¬ÈôÓдíÎó»òÕß´úÂë²»×ãµØ·½»¶ÓÖ¸Õý£¬Ð»Ð»¡£
ADOOperate.H
//////////////////////////////////////////////////////////////////////
// À๦ÄÜ£ºÓÃÓÚÊý¾Ý¿âµÄ²Ù×÷ Ö÷ҪʵÏÖ Á¬½ÓÊý¾Ý¿â ¶ÁÊý¾Ý±í ¼ì²éÊý¾Ý±í Ö´ÐÐSQLÓï¾ä
//
// Ëï¸ß³¯ 2010.03.25
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ADOOPERATE_H__EB4AC016_15D4_46E9_A754_E1C1A036DAAE__INCLUDED_)
#define AFX_ADOOPERATE_H__EB4AC016_15D4_46E9_A754_E1C1A036DAAE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stdafx.h"
class CADOOperate
{
public:
CString m_DataSource; // Êý¾ÝÔ´
CString m_PassWord; // ÃÜÂë
CString m_UserName; // Êý¾Ý¿âÃû
_ConnectionPtr m_pConn; // ADOÁ¬½Ó
CString strTableName; // ±íÃû Íâ±ß´«Èë
_RecordsetPtr m_pRst; // ¼Ç¼¼¯
public:
BOOL funCheckTable(CString strName,CString strDBType);
BOOL ExecuteSQL(CString strSQL,LPCSTR strDBType = ORACLE);
_RecordsetPtr& ReadTable(LPCSTR strSQL1 = NULL,LPCSTR strDBType = ORACLE); // ¶Á±í ·µ»Ø¼Ç¼¼¯
BOOL OpenDataBase(CString lpDBType); // Á¬½ÓÊý¾Ý¿â
void ExitADO();
CADOOperate();
virtual ~CADOOperate();
};
#endif // !defined(AFX_ADOOPERATE_H__EB4AC016_15D4_46E9_A754_E1C1A036DAAE__INCLUDED_)
ADOOperate.C
// ADOOperate.cpp: implementation of the CADOOperate class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ADOOperate.h"
#include "h_Const.h"
#include "ShareFun.h"
#include "FileLog.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CADOOperate::CADOOperate()
{
strTableName = " "; // ³õʼ»¯±íÃû
m_DataSource = " "; // Êý¾ÝÔ´
m_PassWord = " "; // ÃÜÂë
m_UserName = " "; // Êý¾
Ïà¹ØÎĵµ£º
OracleÖеÄdecodeÓ÷¨
Decode(Ìõ¼þ£¬Öµ1£¬ÏÔʾֵ1£¬Öµ2£¬ÏÔʾֵ2£¬…… Öµn£¬ÏÔʾֵn)
Ó¦ÓþÙÀý£º
select t.res_id,
t.res_size || '(kb)' as res_size,
decode(t.res_type,1,'Ä£°åÇø','0','ÎĵµÇø') res_type,
......
OracleÖÐÁÙʱ±í²úÉú¹ýÁ¿RedoµÄ˵Ã÷
×î½ü,ÔÚOracle9iÖÐÄãÓùýÁÙʱ±íÂð?
ËüÊÇ·ñ¸øÄã´øÀ´ÁËÐÔÄÜÌá¸ß?Äã×¢Òâ¹ýô?
--------------------------------------------------------------------------------
ºÃÁËÑÔ¹éÕý´«.
ÎÒÃÇÖªµÀÁÙʱ±íÔÚDML²Ù×÷ÖпÉÒÔ¼õÉÙredoµÄÉú³É,´Ó¶øÔÚ±£´æÖмä½á¹û¼¯Ê±¿ÉÒÔ´øÀ´½Ï´óµÄÐÔÄÜÌá¸ß.
¿ÉÊÇ,È ......
Æäʵ´´½¨dgÍøÂçÉϵÄÎĵµºÜ¶à£¬ÎÒÊÇ¿´Ð¡²¼ÀÏʦÊÇÊÓƵѧϰµÄ
ÓÃÐéÄâ»ú×ö²âÊÔ£¬ÅªÁ˺ü¸Ì죬ÏÂÃæ¼Ç¼һÏÂÔø¾×ö¹ýÓ¡Ïó±È½ÏÉîµÄµØ·½
1.½«Primary·þÎñÆ÷´¦Óڹ鵵ģʽºÍForce Loggingģʽ
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
S ......
·µ»Ø¶à¸ö¶ÔÏó£º
PROCEDURE AUTO_SEL_INVOICE_DETAIL(
P_RESULT_LIST OUT SYS_REFCURSOR) AS
BEGIN
OPEN P_RESULT_LIST FOR
SELECT DISTINCT CC.CHARGE_COLLECTION_ID CHARGE_COLLECTION_ID, CC.COLLECT_DATE COLLECT_DATE, C ......