Forum Discussion

MAZUELAS's avatar
MAZUELAS
New Member
4 years ago

Conexión OBDC Firebird

Hola, cuando conecto una SQL a través de OBDC contra Firebird me arroja un error que no se como solucionar. ¿Alguien tiene una respuesta?. Muchas gracias.

 

DataSource.Error: ODBC: ERROR [HY000] [ODBC Firebird Driver][Firebird]invalid request BLR at offset 799
function F_UDF_FLOAT_ROUND_DEC is not defined
module name or entrypoint could not be found
Detalles:
DataSourceKind=Odbc
OdbcErrors=[Table]

 

Esta es mi consulta:

select distinct cli.Codigo as CodCliente, doc.tipo, doc.regimeniva, (Lin.Cantidad * Lin.CantidadPadre) as cantidadreal, F_UDF_FLOAT_ROUND_DEC((Lin.Cantidad * Lin.Precio)/iif(doc.tipo=4, 1.21/iif(doc.regimeniva='R', 1.052, 1),1) * (100 - F_UDF_CALCULAR_DESCUENTO(lin.descuentos || ';' || coalesce(Doc.Descuentos,0) || ';' || coalesce(Doc.DescuentosPP,0))) / 100, 2) as Importe, Art.Codigo as CodArticulo, iif(Art.CuentaPrecioCoste = 0, 0, F_UDF_FLOAT_ROUND_DEC((Art.SumaPrecioCoste / Art.CuentaPrecioCoste), 2)) as CosteMedio, Doc.Fecha, Doc.Codigo, Doc.Descuentos, FEnv.Descripcion as FormaEnvio, DocOrig.Serie as OrigenSerie, Doc.Serie, Doc.Numero, Doc.codalmacen, Doc.codagente, Doc.portes, Doc.portestipo, Pro.Codigo as Proveedor, Pro.razonsocial, Doc.codestacion as Estacion, cli.nombrecomercial, cli.codtipoestablecimiento, cli.codtarifa, Doc.gastosvarios,

from doclin Lin

inner join doccab doc on doc.Codigo = Lin.CodDocumento

inner join cliente cli on cli.Codigo = doc.CodCliente

left join Articulo art on art.Codigo = Lin.CodArticulo

left join Proveed pro on pro.Codigo = art.ProveedDefecto

left join tipo FEnv on FEnv.Tipo = 3 and FEnv.Codigo = doc.CodFormaEnvio

left join doccab docorig on docorig.Codigo = lin.CodDocumentoOrigen

left join carvalor daCli1 on daCli1.CodClase = 3 and daCli1.CodCaract = 3 and daCli1.CodObjeto = CAST(doc.CodCliente AS CHAR(40))

left join carvalor daCli2 on daCli2.CodClase = 3 and daCli2.CodCaract = 6 and daCli2.CodObjeto = CAST(doc.CodCliente AS CHAR(40))

left join carvalor daCli3 on daCli3.CodClase = 3 and daCli3.CodCaract = 10 and daCli3.CodObjeto = CAST(doc.CodCliente AS CHAR(40))

left join carvalor daCli4 on daCli4.CodClase = 3 and daCli4.CodCaract = 22 and daCli4.CodObjeto = CAST(doc.CodCliente AS CHAR(40))

left join carvalor daCli5 on daCli5.CodClase = 3 and daCli5.CodCaract = 24 and daCli5.CodObjeto = CAST(doc.CodCliente AS CHAR(40))


left join DocDestino on DocDestino.CodDocumentoDestino = doc.Codigo

left join DocCab as docO on docO.CODIGO = DocDestino.CODDOCUMENTO

where (Lin.Nivel = 1) and

((doc.tipo = 2) or (doc.Tipo = 4) or ((doc.Tipo = 3) and (coalesce(docO.Tipo, 0) in (0,1,4))))

order by Cli.Codigo, Art.Codigo, 5

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MAZUELAS,

     

    Here is a solution posted in a similar thread, please kindly refer to:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MAZUELAS ,

     

    Any updates?

     

    Best Regards,
    Eyelyn Qin