Jump to content
  • 0

CONTAINS or wildcard queries in API fetch


Viroun

Question

Hi there, 

For a custom search form, i need to make a caspio API fetch with a criterion query like :   

q.where=Full_Name CONTAINS 'foo' 

or something with a wildcard like

q.where=Full_Name='*foo*'  or  

q.where=Full_Name='*%foo%'

I've tried them all but this doesn't seem to work

Any help would be appreciated ! 

Thanks

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello @Viroun,

Please use LIKE operator https://www.w3schools.com/sql/sql_like.asp

It works with wildcards in case you need to search for some pattern.


For example: Full_Name LIKE '%Doe%'



5LTLUrk.png

This is the request URL example for the method used in the screenshot above:
EiESUMf.png

 

As for the CONTAINS predicate, it is used for a different purpose. CONTAINS SQL checks to see if one string is a substring of another string. For Microsoft SQL Server and similar systems, CONTAINS lets you do full-text term pattern-matching queries on your tables.

And it is not supported on Caspio Tables, since the Table must be full-text indexed to use it.

I hope that you just need to search for a specific pattern, so the LIKE operator should help. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...