总是记不住向方法中传数组参数的语法,所以记录一下. func calculateStatistics(scores:[Int]) -> (min:Int,max:Int,sum:Int) { var min = scores[] var max = scores[] var sum = for score in scores { if score>max { max=score } else if score<min{ min=score } sum += score } return
初始配置:电脑安装oracle 11g(这里也可使是其它版本也可,此教程演示为11g),java环境,eclipse,oracle关于jdbc的jar包. 一,在scott用户下首先要有存储过程和存储方法 create or replace queryEmpIncome(eno in number) return number as psal emp.sal%type; pcomm emp.comm%type; begin select sal,comm into pasl,pcomm from
create or replace procedure p_test_loop as --定义一个游标,并将查询结果集赋值给它 CURSOR c1 IS select * from tbltest where dept='test'; begin --循环获取游标里的某个字段的值 for cardinfo in c1 loop p_testproc(cardinfo.cardid);--使用这个值做一些事情 end loop; end;
我们知道SQL SERVER建立链接服务器(Linked Server)可以选择的驱动程序非常多,最近发现使用ODBC 的 Microsoft OLE DB 驱动程序建立的链接服务器(Linked Server), 调用存储过程过程时,参数不能为NULL值. 否则就会报下面错误提示: 对应的英文错误提示为: EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL' Msg 7213, Level 16, State 1, Line 1 The attempt by th