Oracle 存储过程简单语法

一、无参数的存储过程

--创建存储过程
create or replace procedure getdate
as
datetime varchar2();
begin
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') into datetime from dual;
dbms_output.put_line('当前时间为:'||datetime);
end; --调用存储过程
begin
  getdate;
end;

执行结果输出系统当前时间

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXQAAACLCAIAAAD+svV8AAAQzUlEQVR4nO2d7W8Uxx3H5y+q7AhHunvdKk3TvMQmUWqI1G6lvoioKscxJCoqhABF3SOEXEH2i6qNQmxdEglpCzGB2EmamPDkYGzqxRgulNg+A4Z7iH1G2r7Y292Z3dnH29ldm+9HK3lv9rdze3M3n52ZXe+QFQAAEABJ+wDCcfDwsYwvaZcQAFlh48lFyzCQCwAmpMDDFpR6c4Be0haIF6kXDtpWIDvwWy42vxw8fOxJNsi+XNIuIR8gF5AYIeTyOANkXy5pl5AXkAtIEsglTiAXAEyCymV9ff1RBvCRiyIRg5ysJqUUi4OHj6VdQl6sr69DLiAxQsglicPxw0suikQpRZVz3n5RpCj+8dkr41UXcgFJQlZWVgixK4Yrl4c2hrcbrYTtw5xE0vX2JSqVetUG7nJR5RyRFK+EZOQSqJSCcOntLt9CCxJDAbmAJCFOs6zw5NJsNu/TXNy3hWz/yFjfp699tJ2QLfsuWhHGi4+2W+lt4SoXjkpUOaeLgDaCvk51nySllajIOaY/5bsXXy5+peRdFEEKKnphNptNyAUkRtBuUbPZXKY52Uu27L3AJF3Yu4X0nuQmcKKj4SUXe5PC9I1TE85EQypWd8p3L75c/ErJuyiCFFT0woRcQJKEkEuF4WQvIVv2TlgJE3u3kN6TTMzE3i16yMleNjYyMbVc3BJbL4IpiS8Xz1I62Wu2fXpPMq97Tzq2moU2sXeLmewWYwtzvqxUKhXIBSRJULk0Go05O+fe7CSEkG1DxqvON885ArYNzc3NDW0j9m3RiDTmEkouwds7fLn4lBK/KMxEequxPrTN3NmRg7l+7s1ONl/7XnNzc3ONRgNyAYkRdMyl0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cMBgeHr58+TLkAgCIBbK4uHTv3o+3b9+5evX7UqkEuQAAYoHMzs5Nfj/15VffXLt2/dj7xyAXAEAskGvXpr+duDg29vXVq99DLgCAuCCXLk1+8813X3zx1ZUrk5ALACAuIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBAgFwCAECAXAIAQIBcAgBDI/Hz52rVpyAUAEC/k008+UdVbkAsAIF7IhQsXIBcAQOygWwQAEAK6RQAAIaBbBAAQArpFAAAhoFsEABACmZychFwAALGDbhEAQAi4/R8AIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAgBMgFACAEyAUAIATIBQAghP8D2z4srIXDu1sAAAAASUVORK5CYII=" alt="" />

二、带参数的存储过程

--创建存储过程
create or replace procedure getnetworkid(familyid in varchar2)
as
networkid varchar2();
begin
select f.cnetworkid into temp from Vav_Radio_Family f
where f.cfamilyid=familyid;
dbms_output.put_line('地区:'||networkid);
end;
--调用存储过程
begin
getnetworkid();
end;

执行结果,输出地区

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUsAAACfCAIAAAD/DWxEAAAN+0lEQVR4nO3d/08b5x0H8OcvmnAFleyfN3Vb1x8DtOoglbabtB8qpsmlQKshhaYJi3ZO09RLBD9MW1Ua5G4S0i2p03Rk2lTSfGkmAowLTeqyFDAhtP5SMJG8H+7bc8+d73z24bM/vF86tefHzx3OA28/z53P97BdAKCLRf0CbE6fOd/mS9QtBBBM2yW82saQcOg4bLfNes6oU+wl8sbBKAOC0hP+tD20f8KjbiEfSDgIrIR/1wbaP+FRt5AXJByckPAAkHDoOHrCDw4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cgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgDIkHIAyJByAMiQcgLL/AwOb1ZET/mhJAAAAAElFTkSuQmCC" alt="" />

三、带输出参数的存储过程

--创建存储过程
create or replace procedure out_date(datetime out varchar2)
as
begin
select count(*) into datetime from dual;
dbms_output.put_line('当前时间为:'||datetime);
end;
--调用存储过程
declare
datetime varchar2();
begin
out_date(datetime);
end;

执行结果,输出系统时间

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXcAAACkCAIAAADjf/mcAAAQeElEQVR4nO3d/28U6WHH8ecvquwIIu3+3CpN0/yIIVFqiNROpf4QUVWOD7ioSHAXoKfOEnLZgmypVXsKB9q0EtL0iO8uhapVTOA4KrCpBx93PkqM13zJeb3xF6TtD7Mz88zMM99299mZhfdLKzH77LOPh8c7n33m2fE+4h8BQCfxAgB0KmnKnH7n3ZLfiu4hYGSUN2U6JUbKANkFUqbwAYJ8KzpJkhTeOYy2MELCKfOyHMqfMkX3UApSBuWhSJmvSqD8KVN0DyUhZVAqpEwvSBkgu3DK7O7u/q4EUlLGMoSrYtrDyhbf6XfeLbqHkuzu7pIyKA9FyhS1K7KklLEMKVtss5IcNJbRSxClPKvkxzApg1JRpMzzkEsH3XHDwUuKQrH3rVtSqXSvD/EpY5sVYVhJBcNJmUy9lMWtt/amdlqWOhJSBqUSTpmdnZ2nspsn94iD77vbJ52t9w8KsefkTb+Ge+f9g355X2JTRpEptllxEkGOBmdbOrMyrG6hZVYCp1qpz1KnTFovJXdFlo7qvTN3dnZIGZSHImXWZRcnxZ4TNwJFN07sEZMXlQWK2r1JSpnwIMMLnmheRAvddPHPtFKfpU6ZtF5K7oosHdV7Z5IyKBVFyjQDLk4KsefEvF8wf2KPmLwYqDN/Yo9T5eJksG7PBjSWiSvs3smWTeqUSeyli5PeaGj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8NFgBqnmU+T/V7CRuPKc7UgnjwxkhiJDyqRPysTNyzjTqO7h6rWTZcrD/6GRMYXixMr/ue5REbzOWBEZgY/nuUgP0Ie/yQagFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBepAwAvUgZAHqRMgD0ImUA6EXKANCLlAGgFykDQC9SBoBe/w/2fnsav5bj3QAAAABJRU5ErkJggg==" alt="" />

用dbms_output.put_line();   --打印输出结果

上一篇:基于angular实现模拟微信小程序swiper组件


下一篇:模拟微信小程序页面Page方法