再次询问PL/SQL的问题

[复制链接]
查看11 | 回复3 | 2012-5-15 15:24:11 | 显示全部楼层 |阅读模式
1:问题:直接在SQLPLUS运行正常,UNIX下用SHELL运行无任何输出,执行INQUIRE也无提示。好象无PIRNT语句。
2:环境:SCO UNIX下的ORACLE 7.3.4
3:程序:INQUIRE.SH
##创建表格STUDENTS略。。。。。
sqlplus USEID/USEPWD@/oracle/app/oracle/product/8.1.7/test
Table created.

1 row created.

Commit complete.

Procedure created.

PL/SQL procedure successfully completed.

PPP
--------------------------------
ewewew
SQL>
回复

使用道具 举报

千问 | 2012-5-15 15:24:11 | 显示全部楼层
"afiedt.buf" 11 lines, 248 characters
1create or replace procedure inquire(stu_no in students.no%type,
2stu_name out students.name%type )
3is
4BEGIN
5select name into stu_name from students where no=stu_no;
6END;
7commit;
8var inq_name char(10);
9exec inquire('02',:inq_name);
10* print inq_name;
SQL> /
Warning: Procedure created with compilation errors.
回复

使用道具 举报

千问 | 2012-5-15 15:24:11 | 显示全部楼层
try this.
create or replace procedure inquire(stu_no in students.no%type,stu_name out students.name%type )
is
BEGIN
select name into stu_name from students where no=stu_no;
END;
/
var inq_name char(10);
exec inquire('02',:inq_name);
print inq_name;
回复

使用道具 举报

千问 | 2012-5-15 15:24:11 | 显示全部楼层
我会在晚上答复。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行