def tblRefs
      sql = []
      @headers = %w{RefID ActualYear Title PubID Verbatim}
      @name_collection.ref_collection.collection.each_with_index do |r,i|
        # Assumes the 0 "null" pub id is there
        pub_id = @pub_collection[r.publication] ? @pub_collection[r.publication] : 0

        # Build a note based on "unused" properties
        note = [] 
        if r.properties
          r.properties.keys.each do |k|
            note.push "#{k}: #{r.properties[k]}" if r.properties[k] && r.properties.length > 0
          end 
        end
        note = note.join("; ") 
        note = @empty_quotes if note.length == 0

        cols = {
          RefID: r.id,
          ContainingRefID: 0,
          Title: (r.title.nil? ? @empty_quotes : r.title),
          PubID: pub_id,  
          Series: @empty_quotes,
          Volume: (r.volume ? r.volume : @empty_quotes),
          Issue:  (r.number ? r.number : @empty_quotes),
          RefPages: r.page_string, # always a strings
          ActualYear: (r.year ? r.year : @empty_quotes),
          StatedYear: @empty_quotes,
          AccessCode: 0,
          Flags: 0, 
          Note: note, 
          LastUpdate: @time,
          LinkID: 0,
          ModifiedBy: @authorized_user_id,
          CiteDataStatus: 0,
          Verbatim: (r.full_citation ? r.full_citation : @empty_quotes)
        }
        sql << sql_insert_statement('tblRefs', cols) 
      end
      sql.join("\n")
    end
def tblRefs
      sql = []
      @headers = %w{RefID ActualYear Title PubID Verbatim}
      @name_collection.ref_collection.collection.each_with_index do |r,i|
        # Assumes the 0 "null" pub id is there
        pub_id = @pub_collection[r.publication] ? @pub_collection[r.publication] : 0

        # Build a note based on "unused" properties
        note = [] 
        if r.properties
          r.properties.keys.each do |k|
            note.push "#{k}: #{r.properties[k]}" if r.properties[k] && r.properties.length > 0
          end 
        end
        note = note.join("; ") 
        note = @empty_quotes if note.length == 0

        cols = {
          RefID: r.id,
          ContainingRefID: 0,
          Title: (r.title.nil? ? @empty_quotes : r.title),
          PubID: pub_id,  
          Series: @empty_quotes,
          Volume: (r.volume ? r.volume : @empty_quotes),
          Issue:  (r.number ? r.number : @empty_quotes),
          RefPages: r.page_string, # always a strings
          ActualYear: (r.year ? r.year : @empty_quotes),
          StatedYear: @empty_quotes,
          AccessCode: 0,
          Flags: 0, 
          Note: note, 
          LastUpdate: @time,
          LinkID: 0,
          ModifiedBy: @authorized_user_id,
          CiteDataStatus: 0,
          Verbatim: (r.full_citation ? r.full_citation : @empty_quotes)
        }
        sql << sql_insert_statement('tblRefs', cols) 
      end
      sql.join("\n")
    end
Generate a tblRefs string.