This discussion is archived
2 Replies Latest reply: Dec 4, 2007 8:52 AM by 600287 RSS

how 2 pass xml to sendToStage proc

600287 Newbie
Currently Being Moderated
I think I may have a syntax error somewhere. I keep getting Invalid SQL statement when trying to execute the following:
execute edge.edg_utl.sendToEdge(
type => 102
,subType => 1
,id => ''
,siteName => ''
,deviceName => 'LabPrinter1'
,data => '<?xml version="1.0" standalone="no"?><!DOCTYPE labels SYSTEM "label.dtd"><labels FORMAT="E:SAMPLE2.ZPL" QUANTITY="1" PRINTERNAME="Printer 1" JOBNAME="LBL101"><label><variable name='''XML1'''>000000000000000000002124</variable><variable name='''var_BarProductID'''>ProdID2124</variable></label></labels>'
,time => current_timestamp
,sourceName => ''
,correlId => ''
)

I'm trying to use 3 single quotes around the variables XML1 and var_BarProductID because the original xml had single quotes. The data parm is actually the xml all on one line. Am I even supposed to be passing in xml or is there some other way I should do this? Do I have a syntax error somewhere? Any ideas anyone?

Thanks.
  • 1. Re: how 2 pass xml to sendToStage proc
    Marcelinho Newbie
    Currently Being Moderated
    Use real double quotes " in the XML instead of single, double or triple single?
  • 2. Re: how 2 pass xml to sendToStage proc
    600287 Newbie
    Currently Being Moderated
    I got it to work by replacing single quotes with chr(39). And, it also seems that I needed to supply an Id and a SiteName.

    Here's my working sql call:
    **THE FOLLOWING IS A SINGLE LINE**
    execute edg_utl.sendToEdge(102,1,'122','MySite','jwLabPrinter','<?xml version="1.0" standalone="no"?><!DOCTYPE labels SYSTEM "label.dtd"><labels FORMAT="E:SAMPLE2.ZPL" QUANTITY="1" PRINTERNAME="Printer 1" JOBNAME="LBL101"><label><variable name='||chr(39)||'XML1'||chr(39)||'>000000000000000000002129</variable><variable name='||chr(39)||'var_BarProductID'||chr(39)||'>Rush2129</variable></label></labels>',current_timestamp,'', '')