connect and retrieve data in jupyter and db2 code example
Example 1: how to define a save method in ruby for sql databases
def save
sql = <<-SQL
INSERT INTO songs (name, album)
VALUES (?, ?)
SQL
DB[:conn].execute(sql, self.name, self.album)
@id = DB[:conn].execute("SELECT last_insert_rowid() FROM songs")[0][0]
end
Example 2: how to change the database in sqlplus
oracle_sid=hcltss