Search code examples
oracle-databasegrailsgrails-ormgrails-domain-class

How to save a string too large for a column?


I have this Domain Class:

class Jobs {

String query

static constraints = {
    query(maxSize: 63760)
    query type: "text"
}

 static mapping = {
//And I tried all this:
// sqlType: "char", length:63760
// query sqlType: DbSupport.bigStringType
// table 'HYPJobs'
//query sqlType: "text"
//query(nullable: true, maxSize: 64000)
// query type:'materialized_clob',sqlType: "clob"
}

}

but When I run it I still having this error:

ORA-12899: value too large for column "Myproject"."JOBS"."QUERY" (actual: 1395, maximum: 255)

Anyone ???


Solution

  • This should work

    class Jobs {
    
      String query
    
      static constraints = {
        query maxSize: 63760 // remove this unless you really want to limit the size to 63760
      }
    
      static mapping = {
        query type: 'text'
      }
    }