Deleting data to Caché by using ODBC connection from Appeon PowerBuilder
In my previous articles I demonstrated the steps to connect, retrieve and save data to Caché from Appeon PowerBuilder by using ODBC.
In this article I will demonstrated how to Delete data from Caché with Appeon PowerBuilder (https://www.appeon.com/products/powerbuilder) by using ODBC
I am using Company.cls from Samples-Data (https://github.com/intersystems/Samples-Data/tree/master/cls/Sample)
So Let's start:
Step 1 : First of all we need to establish a connection (https://community.intersystems.com/post/connecting-cach%C3%A9-appeon-pow...)
Step 2 : We need to create datawindow object which will link to Company class.
From File menu select New and select Freeform datawindow object from DataWindow Tab
Step 3 : Select SQL Select from data source list
Step 4 : Select sample.company from Tables list
Step 5 : Select desired columns from column list and press Return
Step 6 : This will open a design view. Save the datawindow as d_company_entry after desired adjustments
Step 7 : Make sure to de-select id column from undated columns list and select id from Identity column list as id will be generated automatically from Caché
Step 8 : In the window control add datawindow object(d_company_entry) which we already created to datawindow control
Step 9 : Add Retrieval Arguments to retrieve the data based on ID, for this we will add (From menu Design > Retrieval Aurguments) in our datawindow control
Step 10: Add newly added parameter in where clause
Step 11 : Retrieve the data based on ID by using datawindow control function Retrieve(ID)
Step 12 : Delete record by using datawindow control deleterow() function, This is same like %DeleteID class method
That's it. ID 21 is deleted
Thanks