Forum Stats

  • 3,768,641 Users
  • 2,252,827 Discussions
  • 7,874,667 Comments

Discussions

When extract XML, passing a dynamic path

MartinB
MartinB Member Posts: 3 Green Ribbon

Hello everyone,

I'm trying to extract some values of a XML file, but to do so I want to be set Dynamically.

So I have a proc which has parameters like the path and when I read the File I want the value. Here is what I'm trying to do :

  path_file := q'{'}'||path_file||q'{'}';

  SELECT stepnumber, balise INTO stepnumber, valeur

  FROM XMLTABLE('/SPS-RESULTS/TEST-RESULTS'

    PASSING XMLTYPE(BFILENAME('MYXML', filename),NLS_CHARSET_ID('UTF-8'))

  COLUMNS

    stepnumber number(2) PATH 'STEP_PW/StepNumber',

    balise number(20,6) PATH path_file

  );


The problem is when I set the path like that 'STEP_PAW/StepNumber', it's ok, but for the variable 'path_file' I have an error ORA-01780: string literal required

And I can't do that either :

balise number(20,6) PATH q'#'#'||path_file||q'#'#'

Is someone know how to fix this issue ?

Thanks,

Martin

Tagged: