我 在oracle中创建了一个存储过程:
PROCEDURE string_opp(input_string IN varchar2,output_string OUT varchar2)
Run Code Online (Sandbox Code Playgroud)
现在问题是如何执行此存储过程并检索输出参数.我已经在sql developer中执行了:
SET SERVEROUTPUT ON
DECLARE
outputString VARCHAR;
BEGIN
EXEC string_opp('input String',:outputString);
END;
Run Code Online (Sandbox Code Playgroud)
当我尝试这个我没有得到任何东西时,有人可以帮助我吗?
我有一组表名,比方说150。每个表都有一mail_id
列,现在我要mail_id
在所有表中搜索一个。为此,我编写了一个Plsql块。当我遍历一组表时,某些表不存在,因此引发了异常。我有异常处理块来处理该异常。现在我想循环整个表,即使它引发异常?任何的想法?实际上,我的块没有处理该特定异常!
declare
my_mail_id varchar2(50):='xyaksj@jsm.com';
tmp_table varchar2(125);
type varchar_collector is table of varchar2(255);
var varchar_collector;
table_does_not_exist exception;
PRAGMA EXCEPTION_INIT(table_does_not_exist, -00942);
begin
for cntr in (select table_name from user_tables)
loop
tmp_table:=cntr.table_name;
dbms_output.put_line(tmp_table);
for mail in (select email_address from tmp_table where lower(email_address) like '%my_mail_id%' )
loop
dbms_output.put_line(tmp_table);
end loop;
end loop;
exception
when no_data_found then
dbms_output.put_line('email address not found');
WHEN table_does_not_exist then
dbms_output.put_line('table dose not exists');
WHEN OTHERS THEN
--raise_application_error(-20101, 'Expecting at least 1000 tables');
IF (SQLCODE = -942) …
Run Code Online (Sandbox Code Playgroud) 我需要在dbms_output语句中包含单引号.我试过这个:
dbms_output.put_line('\''first_name||'\'');
Run Code Online (Sandbox Code Playgroud)
这里first_name是variable
; 我需要在单引号内显示这个.
目前我正在使用oracle 11g中的类型对象.在这个我有DB对象如下:
表
CREATE TABLE students
(rollno NUMBER(15) primary key, s_Name VARCHAR2(20), Marks type_1
);
Run Code Online (Sandbox Code Playgroud)类型对象规范是
CREATE OR REPLACE type type_1
AS
object
(
sub_1 NUMBER,
sub_2 NUMBER,
sub_3 NUMBER,
member FUNCTION total
RETURN NUMBER,
member FUNCTION e_result
RETURN VARCHAR2);
Run Code Online (Sandbox Code Playgroud)它的身体
CREATE OR REPLACE type body type_1
AS
member FUNCTION total
RETURN NUMBER
IS
BEGIN
RETURN (sub_1+sub_2+sub_3);
END;
member FUNCTION e_result
RETURN VARCHAR2
IS
DECLARE
temp NUMBER;
BEGIN
temp :=sub_1+sub_2+sub_3;
IF(temp>50) THEN
RETURN ('pass');
ELSE
RETURN ('fail');
END IF;
END; …
Run Code Online (Sandbox Code Playgroud)嗨,朋友们,我可以使用脚本当前运行的目录中的文件创建一个 zip 文件,现在我想从各个目录创建 zip 文件,有人可以帮助我吗?我的代码是;
use IO::Compress::Zip qw(:all);
zip [ glob("inventory_report_for_neus.xls") ] => "my.zip"
or die "Cannot create zip file: $ZipError" ;
Run Code Online (Sandbox Code Playgroud)
这将生成包含特定文件的 zip 文件,但是
use IO::Compress::Zip qw(:all);
zip [ glob("..\\inventory_report_for_neus.xls") ] => "my.zip"
or die "Cannot create zip file: $ZipError" ;
Run Code Online (Sandbox Code Playgroud)
这也是生成zip文件,但里面没有文件!
我需要在JFrame
标题栏中添加图像,任何人都可以告诉我这样做的方法吗?