我用的是Oracle数据库,用Dbexpress控件连接数据库。存储过程在ORACLE的SQL PLUS运行没有错误,可是在DLEPHI环境下运行的时候却报错误“必须说明标识符get_guestid",其中get_guestid是存储过程的名字。我在Delphi的SQLStoredProc中,已经设置了SqlConnection和StoredProcName。请问如何解决这个错误”必须说明标识符get_guestid“?拜托大家帮帮忙啊。以下是存储过程的代码
CREATE OR REPLACE PROCEDURE "CHENYONG"."GET_GUESTID" (ReturnId
out varchar2)
as
temp_date chenyong.new_roomguestid.date1%type;
temp_count chenyong.new_roomguestid.count1%type;
temp_GuestId varchar2(14);
begin
SELECT chenyong.new_roomguestid.date1,chenyong.new_roomguestid.count1 into temp_date,temp_count FROM chenyong.new_roomguestid;
if (to_date(temp_date)!=to_date(sysdate)) then
UPDATE chenyong.new_roomguestid SET chenyong.new_roomguestid.count1 = 1,chenyong.new_roomguestid.date1=to_date(sysdate);
else
UPDATE chenyong.new_roomguestid SET chenyong.new_roomguestid.count1=(count1+ 1);
end if;
SELECT chenyong.new_roomguestid.date1, chenyong.new_roomguestid.count1 into temp_date, temp_count FROM chenyong.new_roomguestid;
temp_GuestId:='KF'||to_char(to_date(sysdate),'YYYYMMDD')||lpad(temp_count,4,'0');
ReturnId:=temp_GuestId;
end get_guestid;
CREATE OR REPLACE PROCEDURE "CHENYONG"."GET_GUESTID" (ReturnId
out varchar2)
as
temp_date chenyong.new_roomguestid.date1%type;
temp_count chenyong.new_roomguestid.count1%type;
temp_GuestId varchar2(14);
begin
SELECT chenyong.new_roomguestid.date1,chenyong.new_roomguestid.count1 into temp_date,temp_count FROM chenyong.new_roomguestid;
if (to_date(temp_date)!=to_date(sysdate)) then
UPDATE chenyong.new_roomguestid SET chenyong.new_roomguestid.count1 = 1,chenyong.new_roomguestid.date1=to_date(sysdate);
else
UPDATE chenyong.new_roomguestid SET chenyong.new_roomguestid.count1=(count1+ 1);
end if;
SELECT chenyong.new_roomguestid.date1, chenyong.new_roomguestid.count1 into temp_date, temp_count FROM chenyong.new_roomguestid;
temp_GuestId:='KF'||to_char(to_date(sysdate),'YYYYMMDD')||lpad(temp_count,4,'0');
ReturnId:=temp_GuestId;
end get_guestid;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货