qs = Question.find_by_sql "select X.* from ots_schema.questions," + "XMLTABLE (\'$d/question\' passing document as \"d\" " + "COLUMNS question_text VARCHAR(200)" + "PATH \'question_text\') as X"
qs.first.question_text.lstrip => "Which of the following is the correct syntax to set the DB2COMM variable to TCPIP?\n "
If DB2 was had a good DB2 driver and a ActivePureXML (or something adapter) it would so f*ckin rock. Just look at the sample. And the dynamic nature of ruby would enable the flexibility of xml documents.
Please IBM please. DB2 for mac and decent support on Ruby. Don’t make me write things like this no more:
# Once again fixing IBM_DB bugs the ugly way # with_scope anyone? add_index :'ots_schema.users', :login
t.column :document, :xml