Lasse
2010-Jan-26  13:01 UTC
Error: SQLite3::TooBigException: String or BLOB exceeded size limit
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
    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'',
''Malmberg'', ''Groep
8'', ''Taal op Maat'', ''2010-01-26
12:56:28'', ''2010-01-26 12:56:28'')
-- 
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Jan-26  13:13 UTC
Re: Error: SQLite3::TooBigException: String or BLOB exceeded size limit
On Jan 26, 1:01 pm, Lasse <lasseca...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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> 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 > 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'', ''Malmberg'', ''Groep > 8'', ''Taal op Maat'', ''2010-01-26 12:56:28'', ''2010-01-26 12:56:28'')-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lasse
2010-Jan-26  13:18 UTC
Re: Error: SQLite3::TooBigException: String or BLOB exceeded size limit
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}"
		end
-- 
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.