CREATE OR REPLACE FUNCTION function_name RETURN DATE AS v_date DATE; BEGIN ; dbms_output.put_line(v_date); RETURN v_date; END function_name;…
create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETURN emp%RowType; cur_emp ref_cur_emp; rec_emp cur_emp%RowType; begin Open cur_emp For select * from emp t; Loop fetch cur_emp InTo rec_emp; Exit When c…
最近在打算用python作测试用例以便对游戏服务器进行功能测试以及压力测试; 因为服务器是用c++写的,采用的TCP协议,当前的架构是打算用python构造结构体,传送给c++层进行socket发送给游戏服务器,响应消息再交由python进行校验; 开始: 首先是c++调用python这一层需要打通; 幸运的是python自己有一套库提供c/c++进行调用; 下面我贴代码;用的vs2013,python用的2.7 // python_c++.cpp : 定义控制台应用程序的入口点. // #in…
--PACKAGE CREATE OR REPLACE PACKAGE test_141213 is TYPE type_ref IS record( ENAME ), WORK_CITY ), SAL )); TYPE t_type_ref IS TABLE OF type_ref; FUNCTION retrieve(v_name varchar2) RETURN t_type_ref PIPELINED; END test_141213; -- PACKAGE BODY CREATE OR…
declare Type ref_cur_emp IS REF CURSOR RETURN scott.emp%RowType; cur_emp ref_cur_emp; rec_emp cur_emp%RowType; v_sql ) := 'select * from scott.emp t'; begin -- xxx Open cur_emp For v_sql; Open cur_emp For select * from scott.emp t; Loop fetch cur_emp…
-- refer: -- http://www.cnblogs.com/gnielee/archive/2009/09/09/1563154.html -- http://www.cnblogs.com/yudy/archive/2012/07/18/2597874.html ); CREATE OR REPLACE FUNCTION splitstr(p_string IN VARCHAR2, p_delimiter IN VARCHAR2 := ',') RETURN ty_str_spli…
--PACKAGE CREATE OR REPLACE PACKAGE test_141215 is TYPE type_ref IS record( ENAME ), SAL )); TYPE t_type_ref IS TABLE OF type_ref; FUNCTION retrieve(v_name varchar2) RETURN t_type_ref PIPELINED; END test_141215; -- PACKAGE BODY CREATE OR REPLACE PACK…
declare v_sal ) :; begin --if you could not see the output in console, you should set output on first use the command in command line : set serveroutput on dbms_output.put_line(v_sal); end;…
CREATE OR REPLACE PACKAGE BODY temp_package_demo is FUNCTION f_demo(userid NUMBER) RETURN BOOLEAN IS v_temp ); BEGIN INTO v_temp FROM scott.emp WHERE empno = userid; RETURN TRUE; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN FALSE; END; PROCEDURE p_demo_1…
CREATE OR REPLACE PACKAGE temp_package_demo is v_demo ); PROCEDURE p_demo_1(userid NUMBER DEFAULT v_demo, SAL number); FUNCTION f_demo(userid NUMBER) RETURN BOOLEAN; END temp_package_demo;…