Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2015
    Posts
    10

    Unanswered: syntax error near unexpected token `('

    total2: line 1: syntax error near unexpected token `('
    total2: line 1: `db2 "select COALESCE(prod_type, 'TOTAL') as "Prod Type", cast(to_char(count(prod_type),'99,999') as char(10)) as "Customer(#)" from dm.ref_to_date_prod_pilot group by Prod_type with ROLLUP order by Prod_type" >> todate-prod.out2'

    I ran the above select statement alone using 'db2 -tvf <file>', it ran successfully.
    However, with the same query after adding db2 "select ...." in a unix file and executed it using 'sh +x <script>', I got syntax error near expected token. `('

    Does anyone know why? Please advise.

    Thanks,
    Zach

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    as \"Prod Type\"
    ...
    as \"Customer(#)\"
    Regards,
    Mark.

  3. #3
    Join Date
    Dec 2015
    Posts
    10
    Quote Originally Posted by mark.b View Post
    as \"Prod Type\"
    ...
    as \"Customer(#)\"
    Thank you so much!
    Zach

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •