cancel
Showing results for 
Search instead for 
Did you mean: 

PowerBuilder unsupported argument type in Oracle remote procedure

Former Member
0 Kudos

Help me please. Use PowerBuilder 11.5.1.

I have Oracle stored procedure

message  ( 

      out_error OUT INTEGER, 

      client_absid IN INTEGER, 

      document_subject IN VARCHAR, 

      document_text IN VARCHAR, 

      document_attachedfiles IN FILEINF_T, 

      p_client_abs IN VARCHAR  )   

FILEINF_T AS OBJECT ( 

      attachedfiles_name VARCHAR(255)  ,

      attachedfiles_val BLOB       

)

I use local external function for call it

SUBROUTINE message ( ref long out_error, long client_absid,  string document_subject,string document_text, readonly fileinf_t  document_attachedfiles[], string client_abs) RPCFUNC ALIAS FOR "message"

Structure in PB:

global type fileinf_t from structure 

     string        attachedfiles_name 

     blob      attachedfiles_val 

end type

In script:

FILEINF_T files[] 

FILEINF_T file 

file.attachedfiles_name = "test" 

files[1] = file 

.... 

this.message ( ref ll_return, pclient_absid, pdocument_subject,  pdocument_text,  files, pclient_abs)

I give error "Unsupported argument type in DLL function message at line 23 in function uf_ib_messagefile of object ub_ib6_transaction."

Why?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190719
Active Contributor
0 Kudos

PB doesn't support Oracle object types, so you're going to have to change the method itself ( or wrap it with another stored procedure) so that the arguments looks more like:

  1. message  (   
  2.       out_error OUT INTEGER,   
  3.       client_absid IN INTEGER,   
  4.       document_subject IN VARCHAR,   
  5.       document_text IN VARCHAR,   
  6.       attachedfiles_name VARCHAR ,  
  7.       attachedfiles_val BLOB  
  8.       p_client_abs IN VARCHAR  )     

Of course, PB has somewhat limited support for the blob as well.

I don't see any reference to an array of anything in the method though, why were you trying to pass an array?

Former Member
0 Kudos

Thanks for your answer.

     Developers comment that it list files.

former_member190719
Active Contributor
0 Kudos

Are you sure you have the code snippet correct then?  If it's an array, then it would more like:

  1. CREATE TYPE FILEINF_R AS OBJECT (   
  2.       attachedfiles_name VARCHAR(255)  ,  
  3.       attachedfiles_val BLOB         
  4.       ) 

  5. CREATE TYPE FILEINF_T AS TABLE OF FILEINF_R

If that is the case, you still have a problem.  Oracle doesn't support passing record types, much less arrays of record types.  Once again, you'd need to look at creating another function that handles procedures with arguments that PB does support.

former_member190719
Active Contributor
0 Kudos

Did this resolve your question?

If so, can you mark the question answered and indicate which responses you found helpful and/or correct.

If not, could you let us know what you still have questions about?

Former Member
0 Kudos

Hi Sergey;

  FWIW:  Looks like you needed to declare your first element in the structure  as an array  ...  attachedfiles_name [] - OR - remove the array statement from the RPC definition (readonly fileinf_t  document_attachedfiles[]) to make them consistent.

HTH

Regards ... Chris

Former Member
0 Kudos

Thanks for the reply.

I tried to add [] to the first element structure, removed [ ] from the RPC definition, but error is.