Execute store procedure with ruby-plsql

Dear all

I got error in execute the store procedure using ruby-plsql.
=> “Error in cuid_detail table insertion!ORA-01461: can bind a LONG
value only for insert into a LONG column”

Below is my code, please help. Thanks x 99999999

test = {:adapter => “jdbc”,
:driver => “oracle.jdbc.driver.OracleDriver”,
:url => “jdbc:oracle:thin:@hostname:12345:SID”,
:username => “foo”,
:password => “bar”}

class CUIDDB < ActiveRecord::Base
end

CUIDDB.establish_connection(test)
plsql.connection = CUIDDB.connection.raw_connection.connection

cursor = plsql.connection.parse <<-EOS
BEGIN
PROC_CUID_INSERT_CUID_DETAIL(:login_id, :cuid, :hkid, :name,
:create_system, :create_hospital, :raiserror_text, :result);
END;
EOS

cursor.bind_param(’:login_id’,‘BBC338’,String)
cursor.bind_param(’:cuid’,’’,String, 12, ‘IN/OUT’)
cursor.bind_param(’:hkid’,‘P5954804’,String)
cursor.bind_param(’:name’,‘TESTING, TEST ZOOO’, String)
cursor.bind_param(’:create_system’,‘LIS’,String)
cursor.bind_param(’:create_hospital’,‘QMH’,String)
cursor.bind_param(’:raiserror_text’,nil,String,150,‘IN/OUT’)
cursor.bind_param(’:result’,nil,Fixnum,1,‘OUT’)
cursor.exec

puts cursor[’:raiserror_text’].strip
=> “Error in cuid_detail table insertion!ORA-01461: can bind a LONG
value only for insert into a LONG column”

But I have no porblem to run this vis SQLPLUS

SQL> desc PROC_CUID_INSERT_CUID_DETAIL
PROCEDURE PROC_CUID_INSERT_CUID_DETAIL
Argument Name Type In/Out Default?


LOGIN_ID VARCHAR2 IN DEFAULT
CUID CHAR IN/OUT
HKID CHAR IN DEFAULT
NAME CHAR IN DEFAULT
CREATE_SYSTEM CHAR IN DEFAULT
CREATE_HOSPITAL CHAR IN DEFAULT
RAISERROR_TEXT CHAR IN/OUT
RESULT NUMBER(38) OUT

set serveroutput on;
var login_id varchar2(40);
var cuid char(12);
var hkid varchar2(12);
var name char(48);
var create_system char(12);
var create_hospital char(15);
var raiserror_text char(150);
var result number;
exec :login_id := ‘BBC338’;
exec :cuid := ‘’;
exec :hkid := ‘A1234563’;
exec :name := ‘TESTING, TEST ZOOO’;
exec :create_system := ‘LIS’;
exec :create_hospital := ‘QMH’;
exec proc_cuid_insert_cuid_detail(:login_id, :cuid, :hkid, :name,
:create_system, :create_hospital, :raiserror_text, :result);

Please help me.

Many thanks
Valentino

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs