title: Amazon Data Pipeline: How to use a script argument in a SqlActivity?
body: <p>When trying to use a Script Argument in the sqlActivity:</p>
  
  <pre><code> {
  "id" : "ActivityId_3zboU",
    "schedule" : { "ref" : "DefaultSchedule" },
    "scriptUri" : "s3://location_of_script/unload.sql",
    "name" : "unload",
    "runsOn" : { "ref" : "Ec2Instance" },
    "scriptArgument" : [ "'s3://location_of_unload/#format(minusDays(@scheduledStartTime,1),'YYYY/MM/dd/hhmm/')}'", "'aws_access_key_id=????;aws_secret_access_key=*******'" ],
    "type" : "SqlActivity",
    "dependsOn" : { "ref" : "ActivityId_YY69k" },
    "database" : { "ref" : "RedshiftCluster" }
  }
  </code></pre>
  
  <p>where the unload.sql script contains:</p>
  
  <pre><code> unload ('
      select *
      from tbl1 
   ')  
   to ?
   credentials  ?
   delimiter ',' GZIP;
  </code></pre>
  
  <p>or :</p>
  
  <pre><code> unload ('
      select *
      from tbl1 
   ')  
   to ?::VARCHAR(255)
   credentials  ?::VARCHAR(255) 
   delimiter ',' GZIP;
  </code></pre>
  
  <p>process fails:    </p>
  
  <pre><code>syntax error at or near "$1" Position
  </code></pre>
  
  <p>Any idea what i'm doing wrong?</p>