set serveroutput on size 100000
DECLARE
c utl_tcp.connection -- TCP/IP connection to the Web server
i number
j number
BEGIN
c := utl_tcp.open_connection('10.18.1.11', 51000) -- open connection
begin
loop
i := utl_tcp.available(c)
exit when i<=0
dbms_output.put_line('READ='||To_Char(i))
-- while i>0 loop
dbms_output.put(utl_tcp.get_text(c,i)) -- read result
--i :=i-1
-- end loop
end loop
exception
when others then null
end
dbms_output.put_line('')
i := utl_tcp.write_line(c, 'HELLO WORLD')
dbms_output.put_line('WRITE='||To_Char(i))
begin
j := 0
loop
i := utl_tcp.available(c)
if (i=0) then
j := j+1
if (j>=50) then
exit
else
for i in 0..1000 loop
null
end loop
end if
else
dbms_output.put_line('READ='||To_Char(i))
dbms_output.put(utl_tcp.get_text(c,i)) -- read result
end if
end loop
exception
when others then null
end
dbms_output.put_line('')
utl_tcp.close_connection(c)
end
pl/sql里,select语句必须接into
,不接into那就得返回一个游标出去,比如
create
or
replace
package
test_package
is
procedure
query_test(num
number,po_cursor
out
sys_refcursor)
end
test_package
create
or
replace
package
body
test_package
is
procedure
query_test(num
number,po_cursor
out
sys_refcursor)
is
begin
select
unitname,tradetype,workernumber
from
test
where
income=num
end
query_test
end
test_package
1.如果是Oracle 8i ,修改注册表HKLM\Software\Oracle,增加一个字符串值USE_SHARED_SOCKET = TRUE。2.如果是非Oracle 9i,打开%Oracle_Home%\bin\oracle.key文件,按里面的路径HKLM增加一个字符串值USE_SHARED_SOCKET = TRUE。
3.增加以后重启机子让注册表生效。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)