Mr. Rao
oProd := oCn:Call( "proc001" ) // does not work in remote server, only in local mode
///-----------
oProd := oCn:Execute( "CALL proc001" ) // works, but the dates of the returns in array
I´m use MariaDb and Harbour
Thanks
Mr. Rao
oProd := oCn:Call( "proc001" ) // does not work in remote server, only in local mode
///-----------
oProd := oCn:Execute( "CALL proc001" ) // works, but the dates of the returns in array
I´m use MariaDb and Harbour
Thanks
Any Idea???
Please see my response in your other thread.
Even for normal queries like "SELECT ..."
oCn:RowSet(..) or oCn:Query(...) returns a RowSet object
oCn:Execute( query ) returns an array of the same data
if you immediately follow with another call oCn:Execute() without parameters, it returns the structure of the previous query as an array
oCn := maria_Connect( ......... )
oCn:lShowErrors := .t.
? oCn:cServerInfo
? oCn:OS
? oCn:IsProcedure( "proc001" )
xbrowser oCn:ListProcedures()
oProd := oCn:Call( "proc001" )
oProd := oCn:CallSP( "proc001" )
aProd := oCn:Execute( "CALL proc001" )
aProd := oCn:Execute( "CALL proc001()" )oCn := maria_Connect( ......... )
oCn:lShowErrors := .t.
? oCn:cServerInfo
? oCn:OS
? oCn:IsProcedure( "proc001" )
xbrowser oCn:ListProcedures()
oProd := oCn:Call( "proc001" )
oProd := oCn:CallSP( "proc001" )
aProd := oCn:Execute( "CALL proc001" )
aProd := oCn:Execute( "CALL proc001()" )? oCn:cServerInfo 5.5.5.-10.5.6. MariaDb
? oCn:OS Win64
? oCn:IsProcedure( "proc001" ) .t.
xbrowser oCn:ListProcedures() ok
oProd := oCn:Call( "proc001" )
?, VALTYPE(oProd) 0
? oProd:producto PRUEBA DE DATOS
oProd := oCn:CallSP( "proc001" )
? VALTYPE(oProd) 0
? oProd:producto PRUEBA DE DATOS
aProd := oCn:Execute( "CALL proc001" )
? VALTYPE(oProd) 0
? oProd:producto PRUEBA DE DATOS
aProd := oCn:Execute( "CALL proc001()" )
? VALTYPE(oProd) O
? oProd:producto PRUEBA DE DATOS
*******************************************************
Function CargaStoreProc(oCn)
local cProc, oDatos
cProc := "SELECT specific_name FROM information_schema.routines WHERE specific_name = 'proc001'"
oDatos := oCn:Query(cProc)
? oDatos:RecCount()
If oDatos:RecCount() = 0 // no existe el procedure y lo creamos
cProc := "CREATE PROCEDURE inversiones2bhs.proc001() "
cProc += "SELECT productos.cod_producto, productos.producto, productos.precio_venta1, productos.unidad, productos.saldo, productos.cod_proveedor, productos.cod_marca, productos.cod_grupo, productos.codbar1,
productos.codbar2, productos.observaciones, proveedor.razon_social, marca.detalle AS marca, grupo.detalle AS grupo "
cProc += "FROM productos "
cProc += "LEFT JOIN proveedor ON productos.cod_proveedor = proveedor.ruc_dni "
cProc += "LEFT JOIN marca ON productos.cod_marca = marca.codigo "
cProc += "LEFT JOIN grupo ON productos.cod_grupo = grupo.codigo "
cProc += "ORDER BY productos.producto"
oCn:Execute(cProc)
if oCn:nError != 0 // // //
Return(.f.)
EndIf
Endif
Return(.t.)Please run the same queries on cloud server.
Is the user database name on cloud server also is inversiones2bhs ?
function CargaStoreProc( oCn )
local cSql
local lRet := .t.
if !oCn:IsProcedure( "proc001" )
TEXT INTO cSql
CREATE PROCEDURE proc001()
BEGIN
SELECT productos.cod_producto, productos.producto, productos.precio_venta1,
productos.unidad, productos.saldo, productos.cod_proveedor,
productos.cod_marca, productos.cod_grupo, productos.codbar1,
productos.codbar2, productos.observaciones, proveedor.razon_social,
marca.detalle AS marca, grupo.detalle AS grupo "
FROM productos
LEFT JOIN proveedor ON productos.cod_proveedor = proveedor.ruc_dni
LEFT JOIN marca ON productos.cod_marca = marca.codigo
LEFT JOIN grupo ON productos.cod_grupo = grupo.codigo
ORDER BY productos.producto
END
ENDTEXT
oCn:Execute( cSql )
lRet := ( oCn:nError == 0 )
endif
return lRetfunction CargaStoreProc( oCn )
local cSql
local lRet := .t.
if !oCn:IsProcedure( "proc001" )
TEXT INTO cSql
CREATE PROCEDURE proc001()
BEGIN
SELECT productos.cod_producto, productos.producto, productos.precio_venta1,
productos.unidad, productos.saldo, productos.cod_proveedor,
productos.cod_marca, productos.cod_grupo, productos.codbar1,
productos.codbar2, productos.observaciones, proveedor.razon_social,
marca.detalle AS marca, grupo.detalle AS grupo
FROM productos
LEFT JOIN proveedor ON productos.cod_proveedor = proveedor.ruc_dni
LEFT JOIN marca ON productos.cod_marca = marca.codigo
LEFT JOIN grupo ON productos.cod_grupo = grupo.codigo
ORDER BY productos.producto
END
ENDTEXT
oCn:Execute( cSql )
lRet := ( oCn:nError == 0 )
endif
return lRet//local mode. local lan
CargaStoreProc(oCn)
? oCn:cServerInfo 5.5.5-10.5.6-MariaDB
? oCn:OS Win64
? oCn:IsProcedure( "proc001" ) .t.
xbrowser oCn:ListProcedures() LIst View with "proc001" in register
oProd := oCn:Call( "proc001" )
? VALTYPE(oProd) O
? oProd:producto ACEITE VEGETAL
oProd := oCn:CallSP( "proc001" )
? VALTYPE(oProd) O
? oProd:producto ACEITE VEGETAL
aProd := oCn:Execute( "CALL proc001" )
? VALTYPE(oProd) O
? oProd:producto ACEITE VEGETAL
aProd := oCn:Execute( "CALL proc001()" )
? VALTYPE(oProd) O
? oProd:producto ACEITE VEGETAL
all OK
//remote mode. in cloud // cpanel
CargaStoreProc(oCn)
? oCn:cServerInfo 5.6.41-84.1
? oCn:OS Linux
? oCn:IsProcedure( "proc001" ) .f.
xbrowser oCn:ListProcedures() empty
oProd := oCn:Call( "proc001" )
? VALTYPE(oProd) U
? oProd:producto errorThat means the procedure could not be created on the cloud server.
Please check if your cloud server permits you to create procedures,triggers,etc on the server.
Some cloud servers do not permit.
Please also check this.
You are creating procedures with databasename included. Please check if that name is correct.
Recommended to create without including database name, so that the procedure is created in the current db.
Thanks for your advice Mr. Rao