这是创建的一些表及索引
已连接。
SQL> create table customer_info_tab(
  2  customer_id interger primary key,
  3  name varchar2(24) not null,
  4  address varchar2(60) null,
  5  code varchar2(24) null,
  6  profession varchar2(24) null,
  7  company varchar2(24) null,
  8  email varchar2(24) null,
  9  phone varchar2(24) null,
 10  mobile varchar2(24) null,
 11  meet_time date null,
 12  memo varchar2(1000) null);
customer_id interger primary key,
            *
第 2 行出现错误:
ORA-00902: 无效数据类型
SQL> create table customer_info_tab(
  2  customer_id integer primary key,
  3  name varchar2(24) not null,
  4  address varchar2(60) null,
  5  code varchar2(24) null,
  6  profession varchar2(24) null,
  7  company varchar2(24) null,
  8  email varchar2(24) null,
  9  phone varchar2(24) null,
 10  mobile varchar2(24) null,
 11  meet_time date null,
 12  memo varchar2(1000) null);表已创建。SQL> create index customer_meet_timeindex
  2  on customer_info_tab(meet_time);索引已创建。SQL> create table contract_info_tab(
  2  contract_id integer primary key,
  3  customer_name varchar2(24) not null,
  4  contract_name varchar2(60) not null,
  5  status varchar2(6) not null
  6  check(status in('未开始','开始','完成')),
  7  contract_date date null,
  8  executive varchar2(60) null,
  9  money float null,
 10  memo varchar2(1000) null);表已创建。SQL> create index contract_dateindex
  2  on contract_info_tab(contract_date);索引已创建。SQL> create sequence seq_customer_id increment by 1 start with 10000
  2  nomaxvalue nominvalue nocycle;序列已创建。SQL> create sequence seq_contract_id increment by 1 start with 1
  2  nomaxvalue nominvalue nocycle;序列已创建。这是存储过程:
create procedure add_customer_info_tab(
param1 in customer_info_tab.customer_id%type,
param2 in customer_info_tab.name%type,
param3 in customer_info_tab.address%type,
param4 in customer_info_tab.code%type,
param5 in customer_info_tab.profession%type,
param6 in customer_info_tab.company%type,
param7 in customer_info_tab.email%type,
param8 in customer_info_tab.phone%type,
param9 in customer_info_tab.mobile%type,
param10in customer_info_tab.meet_time%type,
param11 in customer_info_tab.memo%type,
)as
begin
delete from customer_info_tab where customer_id=param1;
insert into customer_info_tab(
customer_id,name,address,code,profession,company,email,phone,mobile,
time,memo)
values(param1,param2,param3,param4,param5,param6,param7,param8,param9,param
10,param11);
end
/
结果提示有编译错误,到底哪里有错啊???

解决方案 »

  1.   

     2 customer_id interger primary key,--->integer
      

  2.   

    interger   没这个 类型 
      

  3.   

    create procedure add_customer_info_tab(
    param1 in customer_info_tab.customer_id%type,
    param2 in customer_info_tab.name%type,
    param3 in customer_info_tab.address%type,
    param4 in customer_info_tab.code%type,
    param5 in customer_info_tab.profession%type,
    param6 in customer_info_tab.company%type,
    param7 in customer_info_tab.email%type,
    param8 in customer_info_tab.phone%type,
    param9 in customer_info_tab.mobile%type,
    param10in customer_info_tab.meet_time%type,
    param11 in customer_info_tab.memo%type,---去掉
    )as
    begin
    delete from customer_info_tab where customer_id=param1;
    insert into customer_info_tab(
    customer_id,name,address,code,profession,company,email,phone,mobile,
    time,memo)---应是meet_time
    values(param1,param2,param3,param4,param5,param6,param7,param8,param9,param
    10,param11);
    end
    /
      

  4.   

    create procedure add_customer_info_tab(
    param1 in customer_info_tab.customer_id%type,
    param2 in customer_info_tab.name%type,
    param3 in customer_info_tab.address%type,
    param4 in customer_info_tab.code%type,
    param5 in customer_info_tab.profession%type,
    param6 in customer_info_tab.company%type,
    param7 in customer_info_tab.email%type,
    param8 in customer_info_tab.phone%type,
    param9 in customer_info_tab.mobile%type,
    param10in customer_info_tab.meet_time%type,
    param11 in customer_info_tab.memo%type,---去掉)as
    begin
    delete from customer_info_tab where customer_id=param1;
    insert into customer_info_tab(
    customer_id,name,address,code,profession,company,email,phone,mobile,
    time,memo)---应是meet_time
    values(param1,param2,param3,param4,param5,param6,param7,param8,param9,param
    10,param11);
    end
    /
      

  5.   

    SQL> edi
    已写入 file afiedt.buf  1  create or replace procedure add_customer_info_tab(
      2  param1 in customer_info_tab.customer_id%type,
      3  param2 in customer_info_tab.name%type,
      4  param3 in customer_info_tab.address%type,
      5  param4 in customer_info_tab.code%type,
      6  param5 in customer_info_tab.profession%type,
      7  param6 in customer_info_tab.company%type,
      8  param7 in customer_info_tab.email%type,
      9  param8 in customer_info_tab.phone%type,
     10  param9 in customer_info_tab.mobile%type,
     11  param10 in customer_info_tab.meet_time%type,
     12  param11 in customer_info_tab.memo%type
     13  )
     14  as
     15  begin
     16  delete from customer_info_tab where customer_id=param1;
     17  insert into customer_info_tab(customer_id,name,address,code,profession,company,email,
     18  phone,mobile,meet_time,memo)
     19  values(param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11);
     20  commit;
     21* end;
    SQL> /过程已创建。
    --meet_time 你的为time 写的时候注意下 建表的时候尽量用number 不要integer--param11 in customer_info_tab.memo%type 你的多了个逗
    --你的param11 in customer_info_tab.memo%type,
    --在里面加个commit
      

  6.   

    先谢过了。commit 不是提交的意思吗。是不是每次都写存储过程都要加这个??
      

  7.   


    insert,delete,update 用commit;
      

  8.   

    我没有加commit也有用,还有就是加了commit,end前咋还要加个*呢,有什么作用呢??感觉这东西真麻烦,规则这么多,以后真的要向各位所说的要细心了!!!谢谢大家的回帖