How to pass single quotes in SQL to tdload (easy loader) sourceselectstmt job variable

Tools & Utilities
Enthusiast

How to pass single quotes in SQL to tdload (easy loader) sourceselectstmt job variable

SourceSelectStmt in jobvars requires the SQL statement to be enclosed in single quotes.

How do I pass any sql statement which also has a literal that needs to be enclosed in single quotes e.g., date or char fields. 

 

SourceSelectStmt = 'Sel * from my_table where LD_DT=DATE '2019-07-10' ;'
1 REPLY 1
Highlighted
Ambassador

Re: How to pass single quotes in SQL to tdload (easy loader) sourceselectstmt job variable

Like you do in SQL, you double the single quote:

SourceSelectStmt = 'Sel * from my_table where LD_DT=DATE ''2019-07-10'' ;'