Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SQL expression examples – PB Docs 2021 – PowerBuilder Library

SQL expression examples – PB Docs 2021

SQL expression examples

The first six examples in this section all refer to a grid
that contains three columns from the employee table: emp_id,
dept_id, and salary.

Example 1

The expression <50000 in the Criteria row in the salary
column in the grid retrieves information for employees whose
salaries are less than $50,000.

defin30.gif

The SELECT statement that PowerBuilder creates is:

Example 2

The expression 100 in the Criteria row in the DeptId column in
the grid retrieves information for employees who belong to
department 100.

defin31.gif

The SELECT statement that PowerBuilder creates is:

Example 3

The expression >300 in the Criteria row in the EmpId column
and the expression <50000 in the Criteria row in the Salary
column in the grid retrieve information for any employee whose
employee ID is greater than 300 and whose salary is less than
$50,000.

defin32.gif

The SELECT statement that PowerBuilder creates is:

Example 4

The expressions 100 in the Criteria row and >300 in the Or
row for the DeptId column, together with the expression <50000 in
the Criteria row in the Salary column, retrieve information for
employees who belong to:

  • Department 100 and have a salary less than $50,000

    or

  • A department whose ID is greater than 300, no matter what
    their salaries

defin33.gif

The SELECT statement that PowerBuilder creates is:

Example 5

The expression IN(100,200) in the Criteria row in the DeptId
column in the grid retrieves information for employees who are in
department 100 or 200.

defin34.gif

The SELECT statement that PowerBuilder creates is:

Example 6

This example shows the use of the word AND in the Or criteria
row. In the Criteria row, >=500 is in the EmpId column and
>=30000 is in the Salary column. In the Or row, AND <=1000 is
in the EmpId column and AND <=50000 is in the Salary column.
These criteria retrieve information for employees who have an
employee ID from 500 to 1000 and a salary from $30,000 to
$50,000.

defin35.gif

The SELECT statement that PowerBuilder creates is:

Example 7

In a grid with three columns: emp_last_name, emp_first_name,
and salary, the expressions LIKE C% in the Criteria row and LIKE G%
in the Or row in the emp_last_name column retrieve information for
employees who have last names that begin with C or G.

defin36.gif

The SELECT statement that PowerBuilder creates is:

Providing SQL functionality to
users

You can allow your users to specify selection criteria in a
DataWindow object using these techniques at runtime:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x