2

I'm making a web application in Grails, and I have this domain Class

String name
String query

static mapping = {        
    query type: "text"}

but when I bring the query from another query in Oracle, It returns a really huge String and I get this Error:

ORA-01461: can bind a LONG value only for insert into a LONG column

From the database that i get the information, the fiels is varchar(63760)

Any idea? thanks

Pablo Glez
  • 306
  • 1
  • 7
  • 20

2 Answers2

0

Try adding this to your mapping: sqlType: 'clob'. So you would have the following:

String name
String query

static mapping = {        
    query type: "text", sqlType: "clob"
}

Also, see this SO question.

Community
  • 1
  • 1
grantmcconnaughey
  • 10,130
  • 10
  • 37
  • 66
0

Grails allows to set maximum size which gets converted to mySQL size, so you can try this if it works in Oracle.

class Class {
String name;
String query;

static constraints = {
    query(maxSize: 2048000)
}

static mapping = {
    query type: "text"
}}
Sn.
  • 87
  • 2
  • 7