set linesize  132
set long    10240
--
column "Filename" format A32
column "Camera" format A20
column "Height"   format 99999
column "Width"    format 99999
column "Exposure"   format A20
--
set echo on
--
select object_value
  from IMAGE_METADATA_TABLE m, RESOURCE_VIEW r
 where m.RESID = r.RESID
   and equals_path(res,'/home/%USER%/ImageLibrary/Concorde.jpg') = 1
/
pause
--
select FILENAME, MANUFACTURER, MODEL, HEIGHT, WIDTH, TIMING || ' @ F' || APETURE EXPOSURE
  from IMAGE_METADATA_TABLE m, RESOURCE_VIEW r,
       xmlTable
       (
          xmlNamespaces
          (
             'http://xmlns.oracle.com/xdb/XDBResource.xsd' as "res"
          ),
          '$r/res:Resource'
          passing RES as "r"
          COLUMNS
          FILENAME VARCHAR2(64) path 'res:DisplayName'
       ) res,
       xmlTable
       (
          xmlNamespaces
          (
             'http://xmlns.oracle.com/demo/imageMetadata' as "img",
             'http://xmlns.oracle.com/ord/meta/exif' as "exif"
          ),
          '$m/img:imageMetadata/exif:exifMetadata'
          passing OBJECT_VALUE as "m"
          COLUMNS
          MANUFACTURER   varchar2(32) path 'exif:TiffIfd/exif:Make',
          MODEL          varchar2(32) path 'exif:TiffIfd/exif:Model',
          HEIGHT            number(6) path 'exif:ExifIfd/exif:PixelXDimension',
          WIDTH             number(6) path 'exif:ExifIfd/exif:PixelYDimension',
          TIMING          varchar2(4) path 'exif:ExifIfd/exif:ExposureTime',
          APETURE        varchar2(16) path 'exif:ExifIfd/exif:FNumber'
       ) img       
 where m.RESID = r.RESID
   and under_path(res,'/home/%USER%/ImageLibrary') = 1
 order by HEIGHT * WIDTH
/
--
quit
