EXECUTE syntax
Friday, 8 June 2018 · 2 messages
BE
Ben Engbers8 Jun 2018 10:15 #
Hi,
I want to use my R-client to insert csv in a database.
These lines works:
csv_add_run <- 'RUN "./DataScience/RBaseX/CSVexample.xq"'
Session$command(csv_add_run)
When I take the content from CSVexample.xq and incorporate that into a EXECUTE command, I get this:
csv_add_exe <- 'EXECUTE "let $root :=
'/home/bengbers/DataScience/RBaseX/Examples/Parse/;)'; for $path in
file:children($root)[ends-with(., '.csv')] return db:add('CSV_test',
$path, 'CSV_API', map { 'parser': 'csv', 'csvparser': map { 'header':
'yes', 'separator': ';' }) "'Session$command(csv_add_exe)
Stopped at , 1/9:
Unknown command: 'EXECUTE. Did you mean 'EXECUTE'?
My question is how to define the input for the EXECUTE-command?
Cheers,
Ben
CG
Christian Grün8 Jun 2018 12:06 #
Hi Ben,
If you want to execute XQuery expressions, the XQUERY should do the job.
I agree that the error output is somewhat confusing. This is just a guess, but maybe it indicates that there is still a little bug in the R client? Did you compare the behavior with any other of our clients?
Cheers,
Christian
Quoted text · Ben Engbers · 31 lines
On Fri, Jun 8, 2018 at 10:15 AM Ben Engbers <Ben.Engbers at be-logical.nl> wrote: > > Hi, > > I want to use my R-client to insert csv in a database. > > These lines works: > > csv_add_run <- 'RUN "./DataScience/RBaseX/CSVexample.xq"' > Session$command(csv_add_run) > > When I take the content from CSVexample.xq and incorporate that into a > EXECUTE command, I get this: > > csv_add_exe <- 'EXECUTE "let $root := > '/home/bengbers/DataScience/RBaseX/Examples/Parse/;)'; for $path in > file:children($root)[ends-with(., '.csv')] return db:add('CSV_test', > $path, 'CSV_API', map { 'parser': 'csv', 'csvparser': map { 'header': > 'yes', 'separator': ';' }) "' > > Session$command(csv_add_exe) > > Stopped at , 1/9: > Unknown command: 'EXECUTE. Did you mean 'EXECUTE'? > > > My question is how to define the input for the EXECUTE-command? > > Cheers, > Ben >
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery