In my previous articles I have given idea about multiple databases like PostgreSQL, Oracle etc. In this article I would like to give you introduction about totally new database named Progress Database which is used in Open Edge technologies. There are very less people who knows about the progress database as this is very old technology. The Progress is different than other SQL database management systems. You can also call Progress database queries as open edge queries rather than progress queries.
The Progress Query or Open Edge Query is the query which directly runs on progress database to perform any read or write operations on database.
Progress Database with real examples :
We need to take care of following main database operations :
1.Retrieve Records from database – Also called as Select Operation.
2.Update Records from Database – Also called as Update Operation.
3.Insert Records in database – Also called as Insert Operation.
4.Delete Records from Database – Also called as Delete Operation.
The progress syntaxes are bit different than regular SQL syntaxes. In this section I would like to give you different syntax for progress with its real life examples.
1.Retrieving data from table :
The Select operation is key operation in SQL to retrieve data from database. We are using direct select statement and user is habitual to use the Select syntax in SQL. But in Progress database the syntax is different. Each progress query will start with ‘For Each’ statement.
A.Syntax for Retrieving records from table for Progress Database :
For Each Table_name no-lock :
Display Table_name.
Example 1 : Display all data from the table.
Consider that there is a ‘Customer’ table and you need to fetch all values from customer table in progress.
For Each Customer no-lock:
Display Customer.
The above query will fetch all records in the table.
B.Syntax for Retrieving column-wise records from table for Progress Database :
For Each Table_name no-lock :
Display column1,column2…column ‘N’.
Example 2 : Display column-wise data from the table.
Consider that there is a ‘Customer’ table and you need to fetch some columns from the table.
For Each Customer no-lock:
Display Customer_id Customer_Name Address.
The above query will fetch Customer_id,Customer_Name and Address from Customer table.
C.Syntax for filtering the records from specified table for Progress Database :
For Each Table_name no-lock
Where column_name = Value to be filterted :
Display column1,column2…column ‘N’.
Example 3 : Display column-wise data from the table with Filter.
Consider that there is a ‘Customer’ table and you need to fetch Customer data for all Customers who’s Customer_id is 100.
For Each Customer no-lock
Where Customer_id=100 :
Display Customer_id Customer_Name Address.
The above query will fetch Customer_id,Customer_Name and Address from Customer table where Customer_id is 100.
D. Syntax for using AND/OR conditions for Progress Database :
For Each Table_name no-lock
Where column_name 1= Value to be filterted
AND/OR
column_name 2 = value to be filtered :
Display column1,column2…column ‘N’.
Example 4 : Display 4column-wise data from the table with Filter.
Consider that there is a ‘Customer’ table and you need to fetch Customer data for all Customers who’s Customer_id is 100 and Name=Amit.
For Each Customer no-lock
Where Customer_id=100
AND Customer_Name=’Amit’
Display Customer_id Customer_Name Address.
The above query will fetch Customer_id,Customer_Name and Address from Customer table where Customer_id is 100.
E.Syntax for using Sorting in Progress database :
You all know that in SQL we are using order by keyword to sort the data. In progress if we need to sort the records you need to use descending keyword.
For Each Table_name no-lock
By Column1 Descending :
Display column1,column2…column ‘N’.
Example 5 : Display the data in customer in descending format with customer_id.
Consider that there is a ‘Customer’ table and you need to fetch Customer data with Customer_id in descending order.
For Each Customer no-lock
by Customer_id Descending :
Display Customer_id Customer_Name Address.
The above query will fetch the records in descending order with customer_id from Customer table.
If user wants to fetch the data in ascending order just use by clause in Progress query.
Query for the same :
For Each Customer no-lock
by Customer_id :
Display Customer_id Customer_Name Address.
The above query will fetch the records in ascending order as we are using only by keyword in it.
2.Updating data from table :
In this section I would like to give some heads-up about updating the data in progress with real examples. I just would like to give you the comparison between update statement in SQL and Progress database.
A. Syntax for Updating the data in Progress :
For Each Table_name Exclusive-lock
where column1 = Value1.
Assign column_name= Value_to _be_updated.
End.
Real Life Example :
If user wants to update the records from table named Customer kindly use following query,
For Each Customer Exclusive-lock.
where customer_id > 500
Assign Product=’Laptop’.
End.
The above statement will update the Customer table where customer _id is greater than 500 and assign the Product value as ‘Laptop’.
3.Deleting data from table :
In this section I would like to give some heads-up about deleting the data in progress with real examples. I just would like to give you the comparison between delete statement in SQL and Progress database.
A. Syntax for Deleting the data in Progress :
For Each Table_name Exclusive-lock
where column1 = Value1.
Delete table_name.
End.
Real Life Example :
If user wants to delete the records from table named Customer kindly use following query,
For Each Customer Exclusive-lock.
where customer_id > 500.
Delete Customer.
End.
The above statement will delete the Customer table records where customer _id is greater than 500.
These are most basic operations we are doing in Progress database. I hope you like this article. If you like this article or if you have any suggestions with the same kindly comment in to comments section.
Thanks for this interesting info.
Is there a way to find out who has modify/write/change access to a database? In an Oracle database one would do an investigation based on below queries
SELECT * FROM DBA_USERS
SELECT * FROM DBA_SYS_PRIVS
SELECT * FROM DBA_TAB_PRIVS
SELECT * FROM DBA_ROLE_PRIVS
SELECT * FROM DBA_PROFILES
Hi Paul,
Yes … We can have few system tables in progress as well. I will provide information in next articles.