代码如下:
declare :dcidnum number(20)
begin
insert into DATACHANGE(CTYPE,USERID,CROW,CONDCID,CTABLE,CSTATE,CTIME) values('1','001',0,-1,'','1',to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss'));
:dcidnum=select DCID from DATACHANGE where CTIME= to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss');
select :dcidnum;
end拜托各位大神解析...
declare :dcidnum number(20)
begin
insert into DATACHANGE(CTYPE,USERID,CROW,CONDCID,CTABLE,CSTATE,CTIME) values('1','001',0,-1,'','1',to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss'));
:dcidnum=select DCID from DATACHANGE where CTIME= to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss');
select :dcidnum;
end拜托各位大神解析...
begin
insert into DATACHANGE(CTYPE,USERID,CROW,CONDCID,CTABLE,CSTATE,CTIME) values('1','001',0,-1,'','1',to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss'));
select DCID INTO :dcidnum from DATACHANGE where CTIME= to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss');
end;
/
print dcidnum
dcidnum NUMBER(20);
BEGIN
INSERT INTO DATACHANGE(CTYPE,USERID,CROW,CONDCID,CTABLE,CSTATE,CTIME)
VALUES('1','001',0,-1,'','1',to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss'));
SELECT DCID INTO dcidnum FROM DATACHANGE WHERE CTIME= to_date('2012-4-11 17:26:39','yyyy-mm-dd hh24:mi:ss');
DBMS_OUTPUT.PUT_LINE(dcidnum);
END;