sijms / go-ora

Pure go oracle client
MIT License
767 stars 168 forks source link

UDT with CLOB. out param. ORA-65502: cannot access temporary LOB data #561

Closed dened3 closed 1 month ago

dened3 commented 1 month ago

HI Maybe I don't know how to use it ((

// Oracle Type create or replace type Tfile as object ( file_id number(20), file_body clob ) // Go code func testFile(db *sql.DB) { type TypeFile struct { File_id int udt:"FILE_ID" File_body string udt:"FILE_BODY" } err := go_ora.RegisterType(db, "TFILE", "", TypeFile{}) if err != nil { fmt.Println("err RegisterType TypeFile:", err) } var vfile TypeFile , err = db.Exec( declare v_file Tfile := Tfile(1, '12'); begin for i in 1..1000 loop dbms_lob.append(v_file.file_body, 'dsjfkjsdlkfjsdlkfjdslkjflkdsjflksdjflksdjflksf'); end loop; :file_out := v_file; end;, sql.Named("file_out", go_ora.Out{Dest: &v_file}), ) if err != nil { fmt.Println("err test:", err) return } fmt.Println("v_file:", v_file) }

func main() { db := connect() defer db.Close() testFile(db) } // Output err test: ORA-65502: cannot access temporary LOB data

dened3 commented 1 month ago

cant repro with another text