datawindow row update properties


1. I am using PB 9.0.1. I have designed one datawindow using SQL Select datasource and attached the table directly to the datawindow. I am calling this datawindow in a window where i am saving data(all records) of datawindow to another table. i.e. source and destination is different for the datawindow.

In the Rows --> Update Properties option in the datawindow painter i have set the procedure in tables to update dropdown as a keyword 'Stored_proc' and i have specified the columns that are to be sent as parameters to the procedure. I have also set the primary key column for updation. I am calling the actual procedure in the code. The problem is it is not saving data to the table specified in the store procedure. It is not giving any error so i am not getting whether it is calling the procedure or not. Is there any other way for this. Also how can i design a datawindow without making a database connection through database profile? i.e. i don't want to establish the database connection design time. I am establishing it runtime but still i want ot desing datwindow.
How to use native database connectivity method in PB?

Please suggest what is wrong here. What extra settings i have to do here. Is the way i am following ok? Pls. help ASAP as i am new to PB.

2. Also can anybody pls. tell me the method or steps to perform search or update(insert/delete) operations on a datawindow runtime whose datasource is external.
How to make the field in a datawindow having external datasource enabled? I have set the tab order for the fields but still it is not getting enabled like it doesn't get focused when i tab to it. Also sometimes even it did not display the field also.
Initially i want all the datawindow fields blank. I will input values runtime and then i want to update those values to the table. How can i achieve this if i took the datasource as SQL Select or External for the datawindow?

Please relpy ASAP.


Who is Participating?
Hmm, lots of different questions here...

For stored procedure based updates, use the Rows --> Stored Procedure Update... to specify the update properties and then just use dw.Update in code.  There is no need to manually call the procedure.  What's not giving an error?  If it's the stored procedure call in code that is erroring, are you checking SQLCA.SQLCode, and other properties?

A database connection is required when using the datawindow painter.  There is nothing you can do about that.

An external datawindow acts the same as any other datawindow except that Retrieve() and Update() calls fail since there is no datasource.  You can still Find(), InsertRow(), DeleteRow(), etc. just like any other data.  For persistence, you'll need to handle populating and saving the data yourself.
Hi mayuri25,

You made a lot of questions here, what I guess from first reading is that you have a single DW in a window where you are retrieving data from a table (the one you attached directly in SQL Select ) or is blank (if you build it as external), next you add rows and you want to insert them not the first table but in other table using the stored procedure you place in Update property of DW.

If this is what you want I don't know if it will work, but I can give you a turn around.

Build a 2nd datawindow and attach the destination table directy in SQL Select.
In your button script where you are trying to update put a clode like this:

Integer li
DataStore lds_destination

lds_destination Create DataStore
lds_destination.DataObject = 'dw_your_2nd_datawindow'   // put the name of your 2nd DW

// dw_1 is the DW placed in your window, it has your 1st table or an External DW
for li = 1 to dw_1.RowCount()


   // we are going to copy manually all fields from DW_1 to your DW with destiantion table, i.e    Name, Salary, Days of work
   lds_destination.Object.Name[ li ]  = dw_1.Object.Name[ li ]
   lds_destination.Object.Salary[ li ]  = dw_1.Object.Salary[ li ]
   lds_destination.Object.DaysOfWork[ li ]  = dw_1.Object.DaysOfWork[ li ]

netx li

// Now to insert this rows into destination table simply call update

I hope this helps

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.