Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: How can I use the 'like' query with variable in table input

  1. #1
    Join Date
    Jul 2007
    Posts
    10

    Default How can I use the 'like' query with variable in table input

    First,I set a variable n='test'.
    Then I get some records from table input use this sql:
    select * from table where field like '?%'.
    It says that:
    Error setting value #1 [test] on prepared statement (String).
    What's wrong with it?

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    You can't do it like you do ... ? won't work withing quotes... it should be something as :

    select * from table where field like ? || '%'

    Not tested

  3. #3
    Join Date
    Jul 2007
    Posts
    10

    Default

    Quote Originally Posted by sboden View Post
    You can't do it like you do ... ? won't work withing quotes... it should be something as :

    select * from table where field like ? || '%'

    Not tested

    Thanks so much,it works fine now!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.