aspose file tools*
The moose likes JDBC and the fly likes pattern matching in sql query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pattern matching in sql query" Watch "pattern matching in sql query" New topic
Author

pattern matching in sql query

shashi bhushans
Greenhorn

Joined: May 12, 2011
Posts: 17
In DETAILS_MASTER_ASSET table ASSET_ID column is there. In ASSET_ID values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001.
I want what query ll come after like statement. I wrote query like this "SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like Next wat ll come
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

you need to elaborate clearly what is input and what is output , you are expecting


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

That depends what pattern you are searching for. Can you explain?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
shashi bhushans
Greenhorn

Joined: May 12, 2011
Posts: 17
i used Ajax in my projects similar to Google search. in Google when you type starting letters, remaining letters will drop down. like that i used in my projects . output is coming. in asset_id column values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001. when i type 1 in text field it is displaying all values from asset_id column.. if i type 1 it should display which are all starts from 1.
query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like ? after like some pattern matching should be there.
asset_id is varchar data type
Deyana Vasileva
Greenhorn

Joined: Nov 20, 2008
Posts: 1
shashi bhushans wrote:i used Ajax in my projects similar to Google search. in Google when you type starting letters, remaining letters will drop down. like that i used in my projects . output is coming. in asset_id column values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001. when i type 1 in text field it is displaying all values from asset_id column.. if i type 1 it should display which are all starts from 1.
query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like ? after like some pattern matching should be there.
asset_id is varchar data type



Try with

query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like "<typedString>%"

denitu
 
wood burning stoves
 
subject: pattern matching in sql query