[Stackoverflow] [Progress OpenEdge ABL] A ton of single quotes in an SQL statement?

Status
Not open for further replies.
M

Mike Payne

Guest
I'm really struggling to make sense of an SQL query they are using at the job where I was just hired. The person who originally wrote it is no longer here so I can't ask for an explanation.

Code:
    SET @Openquery=''SELECT * FROM OPENQUERY(IFOPENEDGEDB,''''''
SET @TSQL=''SELECT  orderno, ordersuf, cono, whse, transtype, ordertype, enterdt, custno, shipto, lineno,
        qtyord, shipprod, reqprod, proddesc, unit, price, stkqtyship, prodcost, prodcat, arpvendno,
        orderaltno, netamt, icspecrecno, statustype, glcost, vendno, pdrecno, commcost, discpct,
        qtyship, taxablefl, linealtno, promofl, disccd, pricetype, qtyrel, netord, stkqtyord,
        slsrepin, slsrepout, commtype, invoicedt, returnfl, returnty, qtyreturn, transproc, canceldt,
        priceorigcd, priceoverfl, prodline, transdt, transtm, taxamount, pricecostty, operinit,
        corechgty, corecharge, botype, bono, specnstype, reqshipdt, prevqtyshp, transdttmz, xrefprodty
FROM    PUB.oeel
WHERE transdttmz >= '''''''''' + CONVERT(VARCHAR(50), @LastUpdatedUtc) + '''''''''''''')'';

I don't understand why the first line doesn't have a semicolon to terminate the SET command. I do not understand why multiple single quotes appear so often. What the hell does '''''''''''' mean? What could that do? Any help would be appreciated. This query is to bring information over from an OpenEdge database they are using for their ERP system. Don't get me started on that nightmare. Thanks for your help.

Continue reading...
 
Status
Not open for further replies.
Top