Files
MBS/WEBSERVICES/test/actfoto.4gl
T

43 lines
1.1 KiB
Plaintext

IMPORT os
MAIN
CALL actfoto()
END MAIN
FUNCTION actfoto()
DEFINE codn,codgrupo,codtipo,codsec,xcodid INT,
ximagen BYTE,
rutafile STRING,
filename VARCHAR(40)
CONNECT TO "smarmotech" USER 'jsoto' USING 'lmmjvsd2014'
DECLARE buscar CURSOR FOR
SELECT a.codid FROM iptb00002 a WHERE a.status_t IS NULL AND a.cod_n BETWEEN 24 AND 64 AND a.codid=3740
AND a.imagen IS null
ORDER BY a.codid
LET filename = 'tables1ra.jpg'
LET rutafile = 'c:\\\users\\\jsoto\\\pictures\\'
LET rutafile = rutafile CLIPPED,filename CLIPPED
LOCATE ximagen IN MEMORY
DISPLAY "FILE ",rutafile
IF os.Path.exists(rutafile) THEN
DISPLAY "existe"
ELSE
DISPLAY "NO EXISTE"
END IF
CALL ximagen.readFile(rutafile)
IF ximagen IS NULL THEN
DISPLAY "ES NULA "
END IF
DISPLAY "imagen ",ximagen
# FOREACH buscar INTO xcodid
# DISPLAY " A ACTUALIZAR EL CODID ",xcodid,ximagen
UPDATE iptb00002 SET imagen = ximagen WHERE iptb00002.codid =3740
# DISPLAY "ACTUALICE EL CODID ",xcodid
# END FOREACH
END FUNCTION