35: def execute
36:
37: @bindvars.collect! do |var|
38: if var.is_a? DBI::Binary then
39: oid = @db.__blob_create(PGconn::INV_WRITE)
40: @db.__blob_write(oid, var.to_s)
41: oid
42: else
43: var
44: end
45: end
46:
47: internal_prepare
48:
49: if not @db['AutoCommit'] then
50:
51: @db.start_transaction unless @db.in_transaction?
52: end
53:
54: if @db["pg_native_binding"]
55: pg_result = @db._exec_prepared(@stmt_name, *@bindvars)
56: else
57: pg_result = @db._exec_prepared(@stmt_name)
58: end
59:
60: @result = DBI::DBD::Pg::Tuples.new(@db, pg_result)
61: rescue PGError, RuntimeError => err
62: raise DBI::ProgrammingError.new(err.message)
63: end