Michael Gates
unread,Jul 20, 2012, 7:31:09 PM7/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rhino-t...@googlegroups.com
I'm very new to this library and am trying to understand the Boo DSL. When I run the following code, I get "Null enumerator detected, are you trying to read from the first operation in the process?"
code:
import FileHelpers
[DelimitedRecord("|")]
public class LoyaltyRow:
public Name as string
public Loyalty as string
operation import_from_db:
input "SourceDatabase", Command = """
SELECT
FirstName, LastName, LoyaltyNumber
FROM LoyaltyTable
"""
operation transform_names:
for row in rows:
row.Name = row.FirstName + " " + row.LastName
row.Loyalty = row.LoyaltyNumber.ToString()
yield row
operation export_file:
engine = Rhino.Etl.Core.Files.FluentFile.For[of LoyaltyRow]()
file = engine.To("DatabaseExport.txt")
for row in rows:
record = row.ToObject[of LoyaltyRow]()
file.Write(record)
yield row
file.Dispose()
process Test:
import_from_db()
transform_names()
export_file()