PL/SQL ʵÏÖ»ù±¾µÄËÄÔòÔËËã
CREATE OR REPLACE PACKAGE BODY PACK_RISK_FUNCTION AS
--- 1 ½«·ûºÅÌæ»»³É#ºÅ »òÐí¿ÉÒÔÓÃÕýÔò±í´ïʽ£¬µ«ÊÇÏÓÂé·³»¹ÊÇÖ±½ÓÓÃÌæ»»
FUNCTION CHANGE_OPERATOR(FORMULA VARCHAR2)
RETURN VARCHAR2
AS
V_FORMULA VARCHAR2(100);
BEGIN
V_FORMULA := REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(FORMULA,'(',''),')',''),'+','#'),'-','#'),'*','#'),'/','#');
RETURN V_FORMULA;
END CHANGE_OPERATOR;
/**---- 2 ½«×Ö·û´®°´ÕÕ # ½âÎö³É²»Í¬×Ö¶Î**/
---- ´´½¨Ò»¸öTABLE±äÁ¿ CREATE OR REPLACE TYPE STR_SPLIT IS TABLE OF VARCHAR2 (4000);
---- µ÷Óú¯ÊýÓï¾ä SELECT * from TABLE(SUB_FORMULA(FORMULA))
FUNCTION SUB_FORMULA(FORMULA VARCHAR2)
RETURN STR_SPLIT PIPELINED
AS
V_LENGTH NUMBER :=LENGTH(FORMULA);----×Ö·û´®³¤¶È
V_INDEX NUMBER; ---- #µÄλÖÃ
V_START NUMBER:=1; ---¿ªÊ¼Î»ÖÃ
BEGIN
WHILE V_START <= V_LENGTH LOOP
V_INDEX:= INSTR(FORMULA,'#',V_START);
IF V_INDEX =0 THEN
PIPE ROW(SUBSTR(FORMULA,V_START));
V_START :=V_LENGTH + 1;
ELSE
PIPE ROW(SUBSTR(FORMULA,V_START,V_INDEX-V_START));
V_START := V_INDEX + 1;
END IF;
END LOOP;
RETURN;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE || ' ' || SQLERRM);
RETURN;
END SUB_FORMULA;
/**
---3 ËÄÔòÔËË㺯Êý**/
FUNCTION OPERATION_GLOBAL (FORMULA IN RISKITEMINFO.RECKONNAME%TYPE)
RETURN VARCHAR2
IS
FORMULA_V RISKITEMINFO.RECKONNAME%TYPE :='('||FORMULA||')';
V_FORMULA VARCHAR2(500); ------´¢´æת³É#ºÅºóµÄ¹«Ê½
FIELD_NO VARCHAR2(100); ------×ֶαàºÅ
FIELD_VALUE VARCHAR2(100); --- Êý¾ÝÖµ
FIELD_TYPE NUMBER(2); ---- Êý¾ÝÀàÐÍ
RESULT_V NUMBER;
/* V_COUNT NUMBER;*/
R_RESULT VARCHAR2(100);
BEGIN
------ µ÷ÓÃCHANGE_OPERATORº¯Êý£¬½«ËÄÔòÔËËã·ûºÅת»»³É#
V_FORMULA :=PACK_RISK_FUNCTION.CHANGE_OPERATOR(FORMULA);
-----´´½¨ÓαêC1_CURSOR ÓÃÓÚ±£´æ ¹«Ê½·Ö¸îºóµÄ×Ö¶ÎÃû
DECLARE
CURSOR C1_CURSOR IS
SELECT * from TABLE(PACK_RISK_FUNCTION.SUB_FORMULA(V_FORMULA));
BEGIN
OPEN C1_CURSOR;
FETCH C1_CURSOR INTO FIELD_NO;
WHILE C1_CURSOR%FOUND LOOP
-----¸ù¾Ý×Ö¶ÎÃû²éÕÒ×îºóÈÕÆÚµÄÊý¾Ý½øÐмÆËã
SELECT A.FIELDTYPE,B.FIELDVALUE INTO FIE
Ïà¹ØÎĵµ£º
Microsoft SQL Server 2008
°²×°Í¼½â(Windows 7)
FoxDie
2010Äê04ÔÂ17ÈÕ
¼ò½é
±¾ÎÄÏêϸ¼Ç¼ÁËÒ»´ÎÍêÕûµÄMicrosoft SQL Server 2008ÔÚWindows 7²Ù×÷ϵͳÉϵݲװ¹ý³Ì¡£×¢Ò⣺Microsoft SQL Server 2008ÓëWindows 7²Ù×÷ϵͳ´æÔÚÒ»¶¨µÄ¼æÈÝÐÔÎÊÌ⣬ÔÚÍê³É°²×°Ö®ºóÐèҪΪMicrosoft SQL Server 2008°²×°SP1²¹¶¡¡£ÏÂÃ潫Ïêϸ ......
ÎÒÏëÃæÊÔ¹ýÈí¼þ¿ª·¢µÄÅóÓѶ¼»áÅöµ½sql·½ÃæµÄÃæÊÔÌ⣬Õâ¸ö¿ÉÒÔ˵ÊÇÃæÊԱؿ¼µÄ¡£ÕâÀïÄü¸¸öÀý×Ó¿ªÍØÒ»ÏÂ˼·¡£
1.
ÓÐÕâÑùÒ»Õűí
½ÌʦºÅ
ÐÇÆÚ
ÊÇ·ñÓпÎ
1
1
ÓÐ
2
3
ÓÐ
1
2
ÓÐ
1
2
ÓÐ
ÒªµÃ³öÕâÑùµÄÊý¾Ý£º
ÐÕÃû
ÐÇÆÚÒ»
ÐÇÆÚ¶þ
ÐÇÆÚÈý
ÐÇÆÚËÄ
ÐÇÆÚÎå
1
1
......
½âѹ SQLServer2005SP3-KB955706-x86-CHS.exe Îļþ(ʹÓà WinRAR ¿ÉÖ±½Ó½âѹ,»òʹÓà /extract)
½âѹºóÎļþ¼Ð ËÑË÷ “*.msi *.msp” £¬È»ºó¸´ÖÆËùÓÐËÑË÷µ½µÄÎļþ ·Åµ½ D:\SQL2005\SP3 ÖÐ.
ÌáÈ¡ cs_sql_dev_all_dvd.iso(SQL Server 2005 ¿ª·¢°æ) ÖÐµÄ x86 °æ±¾£¬·Åµ½ D:\SQL2005\MSSQL ÖУ»´Ëʱ D:\SQL2005\M ......
ÏÖÓÐSQL SERVERµÄÊý¾Ý±í£¨SalesItem£©,SalestemÓÐÒÔÏÂ×Ö¶Î:¿Í»§±àºÅ£¬ÏîÄ¿±àºÅ£¬¿Í»§Æ·ºÅ£¬»õ±Ò£¬µ¥¼Û£¬ÏúÊÛÔ±¡£ÐèÒª´Ó±íÖÐÈ¡³öC145µÄÊý¾Ý£¬ÔÙ°ÑÕâЩÊý¾ÝµÄ¿Í»§±àºÅ¸ÄΪC522£¬ÔÙ±£´æ»Ø±íSalesItemÎÊÌâ²¹³ä£ºÕâÀïÓÐ2²¿·ÖµÄÊý¾Ý£¬C145µÄÊý¾Ý²»±ä£¬»¹ÊÇÓеģ¬C522·ÝµÄÊý¾ÝÊÇ´Ó±íÖÐÈ¡³öC145¿Í»§±àºÅµÄÊý¾Ý£¬ÔÙ°ÑÕâЩÊý¾ÝµÄ¿Í»§± ......