CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2000
    Posts
    76

    odbc select ..like ?

    Hi, , I spent long time but it does not work :
    PreparedStatement getSearchStmt;
    String getchilds = "select * from MP5_CONCEPT_DEPENDENCIES where PARENT_ID=?";
    getSearchStmt.setString(1,"'% + searchstring + %'");

    But it does not return nothing, I don't know if what I am doing is correct or not.
    Thanks


  2. #2
    Join Date
    Jul 1999
    Location
    Belarus, Minsk
    Posts
    44

    Re: odbc select ..like ?

    May be you should write your select statement like:

    "SELECT * from EMPLOYEE WHERE FIRST_NAME LIKE 'A%'

    This worked under MS SQL, ORACLE and Sybase.


  3. #3
    Join Date
    Oct 2000
    Location
    CA, USA
    Posts
    2

    Re: odbc select ..like ?

    The following should work:

    String getchilds = "select * from MP5_CONCEPT_DEPENDENCIES where PARENT_ID LIKE ?";
    getSearchStmt.setString(1, "'%" + searchstring + "%'");



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured