Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

(click on this box to dismiss)

How to pass a custom Object to a Stored Procedure function?

hi I have the following function.

CREATE FUNCTION "tblpacientesinsertar"("paciente" OBJECT) RETURN STRING
NAME 'TblPacientes.Insertar(cubrid.sql.CUBRIDOID) return java.lang.String'

I want to pass a custom object class, but I dont know if CUBRIDOID is the right type.

My custom type is public class BoPacientes.

My stored procedure is public static String Insertar(BoPacientes paciente).

C# code looks like:

public BoPacientes Insertar(BoPacientes objeto)
            .....//code code                        CUBRIDCommand com = new CUBRIDCommand();
                        com.Connection = con;
                        com.CommandText = "select tblpacientesinsertar(" + objeto + ")";
                        con.Open();       .......//some code logical       } 

The error I receive is:

Semantic: Dev9.DataAccess.Pacientes.BoPacientes is not defined.
select tblpacientesinsertar(Dev9.DataAccess.Pacientes.BoPacientes) 

I have a java object called BoPacientes.Class registered in CUBRID.

link comment (0)
asked 3 years ago
1 Answer

Custom functions can only work on CUBRID data types. This means that you cannot pass something other than what is specified here as an argument to a function. Aside from these data types, you can also use CUBRID objects. Each CUBRID table is a class and each row in that table is an object (an instance). You can pass these instances through OIDs. See the following for more information on OIDs:

link comment (0)
answered 3 years ago

You are either using a very old browser or a browser that is not supported.
In order to browse you need to have one of the following browsers:

Internet Explorer: Mozilla Firefox: Google Chrome: