Question

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 ???

Was it helpful?

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'
  }
}

OTHER TIPS

From the error message, the actual table column is varchar2(255) and you're trying to insert a value with 1395 characters.

You will need to increase the column length in the DB if you want longer values. You can't go beyond 4k with a varchar2 column though (until 12c anyway); if you actually need values up to 64k then you'll need to make the column a clob instead. Just changing the declaration in Groovy (or wherever, I'm not sure where the varchar(63760) is!) won't affect the size of the column in the database itself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top