OnDemand Users Group

Support Forums => ODWEK, Java and REST APIs => Topic started by: Karthikkumark on November 27, 2013, 09:56:38 AM

Title: Sample sql
Post by: Karthikkumark on November 27, 2013, 09:56:38 AM
Hi All,

Can anyone help me how to frame the sql for odwek.

Thanks,
Karthik k
Title: Re: Sample sql
Post by: kbsiva on December 04, 2013, 04:46:45 PM
Karthik - Not sure if I understand your question.
Title: Re: Sample sql
Post by: Karthikkumark on December 06, 2013, 05:11:11 AM
Hi Siva,

In odwek, we can get the result set by pass the sql.

method : odfolder.search(sql);

Shall i know the how to frame the sql. or please provide me the sample sql string.

I pass like this but i am getting error.

sql = "when policy number like %"

where
policy number is display name.
like operator( i also used the equalent int value)
% search value.

Thanks,
Karthik k
Title: Re: Sample sql
Post by: Justin Derrick on December 07, 2013, 05:25:25 PM
sql uses 'where' not 'when', and field names can't have spaces in them, and anything after the 'like' parameter must be in single quotes...

If you want to learn more about SQL, consider downloading and installing DB2 Express-C.

-JD.

Title: Re: Sample sql
Post by: RHPharr on December 20, 2013, 02:19:06 PM
folder.setApplGroupForSearchWithSQL(appGrp);
searchResults = new ArrayList<ODHit>();
searchResults.addAll(folder.search("where doc_name like '" + docName + "%'"));