How to pass a custom Object to a Stored Procedure function?
hi I have the following function.
CREATE FUNCTION "tblpacientesinsertar"("paciente" OBJECT) RETURN STRING
AS LANGUAGE JAVA
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.
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: http://www.cubrid.org/wiki_apis/entry/cubrid-oids, http://www.cubrid.org/questions/235437, http://www.cubrid.org/manual/841/en/JDBC%20Programming-Using%20OIDs%20and%20Collections.