# Error: SQLite3::TooBigException: String or BLOB exceeded size limit

**URL:** <https://www.ruby-forum.com/t/error-sqlite3-string-or-blob-exceeded-size-limit/182313>\
**Category:** Rails\
**Created:** [January 26, 2010, 2:02pm UTC](https://www.ruby-forum.com/t/error-sqlite3-string-or-blob-exceeded-size-limit/182313 "2010-01-26T14:02:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lasse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/96bed5/32.png) [@Lasse](https://www.ruby-forum.com/u/Lasse)\
**Post date:** [January 26, 2010, 2:02pm UTC](https://www.ruby-forum.com/t/error-sqlite3-string-or-blob-exceeded-size-limit/182313/1 "2010-01-26T14:02:54Z")

</div>

I get an error message when i try to upload content to my database.  
Is there something wrong with my loop?

titles =\> array contains about 200 titles  
links =\> array contains about 200 links

titles.zip(links).each do |title, link|  
if title.to\_s.include? “Groep 3”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 3’, :method =\>  
‘Taal  
op Maat’)  
elsif title.to\_s.include? “Groep 4”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 4’, :method =\>  
‘Taal  
op Maat’)  
elsif title.to\_s.include? “Groep 5”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 5’, :method =\>  
‘Taal  
op Maat’)  
elsif title.to\_s.include? “Groep 6”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 6’, :method =\>  
‘Taal  
op Maat’)  
elsif title.to\_s.include? “Groep 7”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 7’, :method =\>  
‘Taal  
op Maat’)  
elsif title.to\_s.include? “Groep 8”  
@list = List.new(:title =\> title, :link =\> link,  
:publisher =\> ‘Malmberg’, :group =\> ‘Groep 8’, :method =\>  
‘Taal  
op Maat’)  
end  
end

* * *

Error:  
SQLite3::TooBigException: String or BLOB exceeded size limit: INSERT  
INTO “lists” (“title”, “link”, “publisher”, “group”, “method”,  
“created\_at”, “updated\_at”) VALUES('— &id2582 !ruby/  
object:REXML::Text  
entity\_filter:  
normalized:  
parent: &id004 !ruby/object:REXML::Element  
attributes: !map:REXML::Attributes {}

children:

- \*id2582  
context: &id001 {}

elements: !ruby/object:REXML::Elements  
element: \*id004  
expanded\_name: title  
ignore\_whitespace\_nodes: false  
name: title  
namespace: “”  
parent: &id003 !ruby/object:REXML::Element  
attributes: !map:REXML::Attributes  
href: [http://www.wrts.nl/api/lists/24743885](http://www.wrts.nl/api/lists/24743885)  
children:  
- !ruby/object:REXML::Text  
entity\_filter:  
normalized:  
parent: \*id003  
raw: true  
string: "\n "  
unnormalized:  
- &id002 !ruby/object:REXML::Element  
attributes: !map:REXML::Attributes {}

```
  children:
  - !ruby/object:REXML::Text
    entity_filter:
    normalized:
    parent: *id002
    raw: true
    string: "24743885"
    unnormalized:
  context: *id001
  elements: !ruby/object:REXML::Elements
    element: *id002
  expanded_name: id
  ignore_whitespace_nodes: false
  name: id
  namespace: ""
  parent: *id003
  prefix: ""
  whitespace: true
- !ruby/object:REXML::Text
  entity_filter:
  normalized:
  parent: *id003
  raw: true
  string: "\n "
  unnormalized:
- *id004
- !ruby/object:REXML::Text
  entity_filter:
  normalized:
  parent: *id003
  raw: true
  string: "\n "
  unnormalized:
- &id005 !ruby/object:REXML::Element
  attributes: !map:REXML::Attributes {}

```

…

```
      children:
      - *id2580
      - !ruby/object:REXML::Text
        entity_filter:
        normalized:
        parent: *id2581
        raw: true
        string: |

        unnormalized:
      context: *id001
      elements: !ruby/object:REXML::Elements
        element: *id2581
      entity_expansion_count: 0
      expanded_name: UNDEFINED
      ignore_whitespace_nodes: false
      name: UNDEFINED
      namespace: ""
      parent:
      prefix: ""
      whitespace: true
    prefix: ""
    whitespace: true
  prefix: ""
  whitespace: true
prefix: ""
whitespace: true

```

prefix: “”  
whitespace: true  
raw: true  
string: Taal Actief Groep 8 woordpakket 1  
unnormalized:  
', ‘[http://www.wrts.nl/lijst/overnemen/24743885](http://www.wrts.nl/lijst/overnemen/24743885)’, ‘Malmberg’, ‘Groep  
8’, ‘Taal op Maat’, ‘2010-01-26 12:56:28’, ‘2010-01-26 12:56:28’)

---

<div class="post-metadata">

**Author:** ![Lasse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/96bed5/32.png) [@Lasse](https://www.ruby-forum.com/u/Lasse)\
**Post date:** [January 26, 2010, 2:15pm UTC](https://www.ruby-forum.com/t/error-sqlite3-string-or-blob-exceeded-size-limit/182313/2 "2010-01-26T14:15:11Z")

</div>

On Jan 26, 1:01 pm, Lasse [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I get an error message when i try to upload content to my database.  
> Is there something wrong with my loop?

It’s saying that you’re trying to insert more data than that column  
can contain. It does look rather weird that you’re trying to insert  
what looks like a ruby object representing an xml fragment though.

Fred

---

<div class="post-metadata">

**Author:** ![Lasse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/96bed5/32.png) [@Lasse](https://www.ruby-forum.com/u/Lasse)\
**Post date:** [January 26, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/error-sqlite3-string-or-blob-exceeded-size-limit/182313/3 "2010-01-26T14:19:17Z")

</div>

This is how the arrays where created. It’s data recieved out of a  
HTTP. Response

#send request to WRTS API  
Net::HTTP.start(‘www.wrts.nl’) {|http|  
req = Net::HTTP::Get.new(‘/api/lists’)  
req.basic\_auth login, password  
response = http.request(req)  
@xml\_data = (response.body)}  
#Parse Response  
doc = REXML::Document.new(@xml\_data)  
titles = REXML::XPath.match( doc, “/list-index//list/title/text()” )  
ids = REXML::XPath.match( doc, “/list-index//list/id/text()” )  
titles.to\_s  
#convert id into link  
links = ids.map do |id|  
“[http://www.wrts.nl/lijst/overnemen/#{id}](http://www.wrts.nl/lijst/overnemen/#%7Bid%7D)”  
end
