GalaxyPilot —— D.S


                  生命不熄,戰(zhàn)斗不止
          數(shù)據(jù)加載中……

          ORACLE中使用動態(tài)游標(biāo)的例子

          create or replace function get_ope_popedom(sta_id varchar2) return varchar2
            /*
             * NAME:
             *   get_ope_popedom
             *
             * PARAMETER:
             *   sta_id   - 車站編號,多個站時以逗號分隔
             *
             * RETURN:
             *   --對應(yīng)車站編號的車站名稱,多個站時以逗號分隔
             *
             * AUTHOR:
             *   舵手
             *
             * DESCRIPTION:
             *   --根據(jù)傳入的車站編號返回相應(yīng)的車站名稱
             *
             */
          as
          Result varchar2(1000);
          name_temp varchar2(40);
          type cursor_t is ref cursor;
          emp_cur cursor_t ;
          begin
            OPEN emp_cur FOR 'SELECT sta_name FROM station_code where sta_code =:1'
            using sta_id;
            LOOP
                FETCH emp_cur INTO name_temp;
                If (emp_cur%NOTFOUND) Then
                   EXIT;
                End if;
                Result := Result || name_temp || ',';
            end loop;
            close emp_cur;
            Result := substr(Result,1,(length(Result)-1));
            return(Result);
          end get_ope_popedom;
          /

          posted on 2006-03-14 11:02 舵手 閱讀(3583) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 阿克陶县| 都兰县| 登封市| 望都县| 贵定县| 张北县| 房山区| 顺昌县| 池州市| 赣榆县| 绍兴市| 辽中县| 台中县| 海晏县| 巴青县| 绩溪县| 冀州市| 司法| 临夏县| 渑池县| 杭锦后旗| 桦川县| 麟游县| 云和县| 米易县| 多伦县| 江西省| 仪陇县| 屏东市| 正镶白旗| 浦城县| 鄄城县| 潜江市| 小金县| 叙永县| 东乡族自治县| 沁阳市| 修文县| 神农架林区| 巴中市| 长汀县|