Laravel 4.2:ORA-01401:列的插入值太大(Illuminate \ Database \ QueryException)

时间:2015-05-09 07:50:15

标签: php oracle oracle11g eloquent oci8

我使用Laravel 4.2 Eloquent迁移以下架构,我收到以下错误。我不知道为什么会出现这个错误,因为我是Oracle新手。只有有人帮忙,我才能继续前进。

模式

Schema::create('APY_MASTER', function (Blueprint $table) {
        $table->increments('id');
        $table->bigInteger('PRAN', 12);
        $table->bigInteger('BACK_OFC_REF_NO', 17)->nullable();          
        //$table->foreign('user_id')->references('id')->on('dmms_users');

        $table->string('TITLE', 8);
        $table->string('SUBS_NAME', 90);
        $table->string('SUBS_FATR_NAME', 90)->nullable();

        $table->integer('NLAO_REG_NO', 7)->nullable();
        $table->string('NLCC_REG_NO', 10)->default('THIS IS A DUMMY');
        $table->string('GENDER', 1); 
        $table->date('DOB');           
        $table->string('PAN', 10)->nullable();
        $table->string('CORRES_ADDR', 90);
        $table->string('CORRES_ADDR_DT_TWN_CTY', 30);

        $table->string('CORRES_STATE', 2);
        $table->string('CORRES_CNTRY', 2);
        $table->integer('CORRES_ZIP', 6); 

        $table->string('AREA_LOC_TALUK', 30)->nullable();
        $table->string('LANDMARK', 30)->nullable();
        $table->bigInteger('TEL_NO', 13)->nullable();
        $table->bigInteger('MOB_NO', 13)->nullable();
        $table->string('EMAIL_ID', 80)->nullable();

        $table->string('SMS_FLAG', 1)->default('N');
        $table->string('MARITAL_STAT', 1);            
        $table->string('SPOUSE_NAME', 90)->nullable();
        $table->bigInteger('SPOUSE_ADAR', 12)->nullable();          
        $table->string('SUBS_BANK_ACNT_TYP', 20)->nullable();
        $table->string('SUBS_BANK_ACNT_NO', 20);

        $table->string('BNK_NAME', 30);
        $table->string('BNK_BRANCH', 30);
        $table->string('BNK_MICR', 9)->nullable();
        $table->string('BNK_IFS', 11)->nullable();
        $table->string('SUBS_ADAR', 12)->nullable();

        $table->string('N_E_SWAVALAMBAN', 1);
        $table->string('BEN_OF_OTR_SEC_SCHEME', 1);
        $table->integer('PNSN_AMT');
        $table->float('CONT_AMT');
        $table->integer('SI_DATE', 2);

        $table->date('APPLN_DATE');
        $table->string('PLACE_APPLN', 15);
        $table->string('TAX_PAYER', 1);
        $table->string('NOMINE_NAME', 90);
        $table->date('NOMINE_DOB');

        $table->bigInteger('NOMINE_ADAR', 12)->nullable();
        $table->string('REL_WT_SUB', 30);
        $table->string('NOMINE_MIN_MAJ', 1);
        $table->string('NOMINE_GUARD_NAME', 90);

        $table->timestamps();

错误

      [Illuminate\Database\QueryException]                                                                                                         
      Error Code    : 1401                                                                                                                         
      Error Message : ORA-01401: inserted value too large for column                                                                               
      Position      : 274                                                                                                                          
      Statement     : create table APY_MASTER ( id number(10,0) not null, PRAN number(19,0) not null, BACK_OFC_REF_NO number(19,0) null, TITLE va  
      rchar2(8) not null, SUBS_NAME varchar2(90) not null, SUBS_FATR_NAME varchar2(90) null, NLAO_REG_NO number(10,0) null, NLCC_REG_NO varchar2(  
      10) default 'THIS IS A DUMMY' not null, GENDER varchar2(1) not null, DOB date not null, PAN varchar2(10) null, CORRES_ADDR varchar2(90) not  
       null, CORRES_ADDR_DT_TWN_CTY varchar2(30) not null, CORRES_STATE varchar2(2) not null, CORRES_CNTRY varchar2(2) not null, CORRES_ZIP numbe  
      r(10,0) not null, AREA_LOC_TALUK varchar2(30) null, LANDMARK varchar2(30) null, TEL_NO number(19,0) null, MOB_NO number(19,0) null, EMAIL_I  
      D varchar2(80) null, SMS_FLAG varchar2(1) default 'N' not null, MARITAL_STAT varchar2(1) not null, SPOUSE_NAME varchar2(90) null, SPOUSE_AD  
      AR number(19,0) null, SUBS_BANK_ACNT_TYP varchar2(20) null, SUBS_BANK_ACNT_NO varchar2(20) not null, BNK_NAME varchar2(30) not null, BNK_BR  
      ANCH varchar2(30) not null, BNK_MICR varchar2(9) null, BNK_IFS varchar2(11) null, SUBS_ADAR varchar2(12) null, N_E_SWAVALAMBAN varchar2(1)   
      not null, BEN_OF_OTR_SEC_SCHEME varchar2(1) not null, PNSN_AMT number(10,0) not null, CONT_AMT number(8, 2) not null, SI_DATE number(10,0)   
      not null, APPLN_DATE date not null, PLACE_APPLN varchar2(15) not null, TAX_PAYER varchar2(1) not null, NOMINE_NAME varchar2(90) not null, N  
      OMINE_DOB date not null, NOMINE_ADAR number(19,0) null, REL_WT_SUB varchar2(30) not null, NOMINE_MIN_MAJ varchar2(1) not null, NOMINE_GUARD  
      _NAME varchar2(90) not null, created_at timestamp not null, updated_at timestamp not null, constraint apy_master_id_primary primary key ( i  
      d ) )                                                                                                                                        
      Bindings      : []                                                                                                                           
       (SQL: create table APY_MASTER ( id number(10,0) not null, PRAN number(19,0) not null, BACK_OFC_REF_NO number(19,0) null, TITLE varchar2(8)  
       not null, SUBS_NAME varchar2(90) not null, SUBS_FATR_NAME varchar2(90) null, NLAO_REG_NO number(10,0) null, NLCC_REG_NO varchar2(10) defau  
      lt 'THIS IS A DUMMY' not null, GENDER varchar2(1) not null, DOB date not null, PAN varchar2(10) null, CORRES_ADDR varchar2(90) not null, CO  
      RRES_ADDR_DT_TWN_CTY varchar2(30) not null, CORRES_STATE varchar2(2) not null, CORRES_CNTRY varchar2(2) not null, CORRES_ZIP number(10,0) n  
      ot null, AREA_LOC_TALUK varchar2(30) null, LANDMARK varchar2(30) null, TEL_NO number(19,0) null, MOB_NO number(19,0) null, EMAIL_ID varchar  
      2(80) null, SMS_FLAG varchar2(1) default 'N' not null, MARITAL_STAT varchar2(1) not null, SPOUSE_NAME varchar2(90) null, SPOUSE_ADAR number  
      (19,0) null, SUBS_BANK_ACNT_TYP varchar2(20) null, SUBS_BANK_ACNT_NO varchar2(20) not null, BNK_NAME varchar2(30) not null, BNK_BRANCH varc  
      har2(30) not null, BNK_MICR varchar2(9) null, BNK_IFS varchar2(11) null, SUBS_ADAR varchar2(12) null, N_E_SWAVALAMBAN varchar2(1) not null,  
       BEN_OF_OTR_SEC_SCHEME varchar2(1) not null, PNSN_AMT number(10,0) not null, CONT_AMT number(8, 2) not null, SI_DATE number(10,0) not null,  
       APPLN_DATE date not null, PLACE_APPLN varchar2(15) not null, TAX_PAYER varchar2(1) not null, NOMINE_NAME varchar2(90) not null, NOMINE_DOB  
       date not null, NOMINE_ADAR number(19,0) null, REL_WT_SUB varchar2(30) not null, NOMINE_MIN_MAJ varchar2(1) not null, NOMINE_GUARD_NAME var  
      char2(90) not null, created_at timestamp not null, updated_at timestamp not null, constraint apy_master_id_primary primary key ( id ) ))

感谢帮助

1 个答案:

答案 0 :(得分:1)

错误就在这一行:

$table->string('NLCC_REG_NO', 10)->default('THIS IS A DUMMY');

您可以定义长度 10 的字符串列,但使用 15 字符指定默认值。