WEB开发网
开发学院数据库MySQL 如何在MySQL&Oracle下创建自动递增字段 阅读

如何在MySQL&Oracle下创建自动递增字段

 2007-11-11 16:58:28 来源:WEB开发网   
核心提示: 连接到:Oracle(大型网站数据库平台)9i Enterprise Edition Release 9.2.0.1.0 - ProductionWith the Partitioning, OLAP and Oracle(大型网站数据库平台) Data Mining optionsJServer Release 9

连接到:Oracle(大型网站数据库平台)9i Enterprise Edition Release 9.2.0.1.0 - ProductionWith the Partitioning, OLAP and Oracle(大型网站数据库平台) Data Mining optionsJServer Release 9.2.0.1.0 - Production

SQL> create or replace procedure get_news(  2  aid in varchar2,atitle in varchar2)  3  as  4  begin  5  select * from cf_news  6  end;  7  /

警告: 创建的过程带有编译错误。

SQL> create or replace procedure get_news(  2  aid in varchar2 ,atitle in varchar2)  3  as  4  beging  5  /

警告: 创建的过程带有编译错误。

SQL> create or replace procedure get_news(  2  aid in varchar2)  3  as  4  begin  5  select * from cf_news;  6  end;  7  /

警告: 创建的过程带有编译错误。

SQL> create or replace procedure get_news  2  as  3  begin  4  select * from cf_news;  5  end;  6  /

警告: 创建的过程带有编译错误。

SQL> show errors;PROCEDURE GET_NEWS 出现错误:

LINE/COL ERROR-------- -----------------------------------------------------------------4/1    PLS-00428: 在此 SELECT 语句中缺少 INTO 子句SQL> create or replace procedure get_news  2  as  3  aa number;  4  begin  5  select count(*) into aa from cf_news;  6  end;  7  /

过程已创建。

SQL> create or replace procedure get_news  2  as  3  aa number;  4  begin  5  select count(*) into aa from cf_news;  6  dbms_outpub.put_line('aa='||aa);  7  end;  8  /

警告: 创建的过程带有编译错误。

SQL> show errors;PROCEDURE GET_NEWS 出现错误:

LINE/COL ERROR-------- -----------------------------------------------------------------6/1    PLS-00201: 必须说明标识符 'DBMS_OUTPUB.PUT_LINE'6/1    PL/SQL: Statement ignoredSQL> create or replace procedure get_news  2  as  3  aa number;  4  begin  5  select count(*) into aa from cf_news;  6  dbms_output.put_line('aa='||aa);  7  end;  8  /

过程已创建。

SQL> set serverout on;SQL> execute get_news;aa=3

PL/SQL 过程已成功完成。

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:如何 MySQL Oracle

编辑录入:coldstar [复制链接] [打 印]
赞助商链接