IBM Support

Syntax to use a wildcard with a LIKE operator in a SQL SELECT statement

Troubleshooting


Problem

What is the syntax to use a wildcard with a LIKE operator in a SQL SELECT statement in IBM Rational(R) Robot (SQA Basic Language)?

Resolving The Problem


What is the syntax to use a wildcard with a LIKE operator in a SQL SELECT statement? The SQL SELECT statement can then be used in the Query argument in the SQLRequest command in SQABasic?


The '%' is the wildcard used with LIKE.

An example of a query using this is:
SELECT userID FROM term WHERE userID LIKE '17%'

This command will return all userID's in the table term that start with 17:
UserID:
17
170
17001
etc...

LIKE is a powerful character string comparison operator that allows for the selection of only rows that are "like" what is specified. The percent sign "%" can be used as a wild card to match any possible character that might appear before or after the characters specified.



[{"Product":{"code":"SSSHDX","label":"Rational Robot"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2001a;2001a.04.00;2002;2002.05.00;2002 Release 2;2002.05.20","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

116815627

Document Information

Modified date:
16 June 2018

UID

swg21136450