0

I am looking at another person's SQL query, and they create the following object prior to the actual query:

@echo ${asOfDate||2017-08-04||Date||where noshow}$ ;

I have tried looking into the ${}$ notation, but with no results. What does this line do?

EDIT: Here is the original query:

SELECT
    ID1 ,
    ID2 ,
    SUM(The_var) AS The_var
FROM
    DB1
WHERE
    postingdate >= ${asOfDate||2017-07-01||Date||where noshow}$
GROUP BY
    1,2;
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Analyst Guy
  • 115
  • 13
  • 2
    What program do you use to open the file? It does not look like SQL. – Eric Aug 04 '17 at 15:35
  • 1
    This doesn't look like `tsql` - what is the full query & DBMS? – Siyual Aug 04 '17 at 15:36
  • 2
    This definitely won't execute in SSMS. I'm sure it's not `tsql`. In `tsql`, `@echo` is a variable local to the query, and must be declared. It's not a command. The dollar-sign braces part looks more like [Javascript template literals](https://stackoverflow.com/questions/35835362/what-does-dollar-sign-and-curly-braces-mean-in-a-string-in-javascript). – Ross Presser Aug 04 '17 at 15:39
  • I was under the impression that it was TSQL, but I could definitely be mistaken. I am using DB Visualizer to run the query. The portion of the query that uses this object is as follows: SELECT ID1 , ID2 , SUM(The_var) AS The_var FROM DB1 WHERE postingdate >= ${asOfDate||2017-07-01||Date||where noshow}$ GROUP BY 1,2 ) – Analyst Guy Aug 04 '17 at 15:42
  • 5
    Googling says thats a syntax/feature specific to dbvisualizer: http://confluence.dbvis.com/display/UG10/Using+DbVisualizer+Variables – Alex K. Aug 04 '17 at 15:52
  • Thanks! What was your google search? I don't know how I didn't encounter this. – Analyst Guy Aug 04 '17 at 15:56
  • 1
    Was the 5th hit for *DBVisualizer "@echo"* – Alex K. Aug 04 '17 at 15:58
  • 1
    `@echo` is a batch file command. But the batch file could be automating sql code for execution by another tool (like dbvisualizer) that would understand the `${ ... }$` syntax. – Joel Coehoorn Aug 04 '17 at 17:02
  • @AlexK. you should promote that to an answer. – Ross Presser Oct 12 '17 at 17:25

0 Answers0