Solved

powerbuilder datawindow identity fields

Posted on 2009-05-06
4
1,872 Views
Last Modified: 2013-12-26
i am using a datawidow to deal with a table which contains a identity field. i dont care to show this field on the screen but i want this field to auto-increment its value by one when i insert a new record to the database. How can i deal with this field in design time? And what about the update properties of the datawindow?

if i dont include it in the sql statement ( i believe this is the right thing to do) will this field increase its value by one every time i add a new record? In case that i would like to display this field in the screen but not update it thru keyboard what should i do?

i would like something else too. (not concerning identity fields). suppose we execute the command dw_1.update() . can we get at run time the exact command that powerbuilder sends to the database? Suppose this datawindow has a field named xx with tab order 10. how can i change it to 0 in run time?

i am using pb 11.5 and sql server 2000

0
Comment
Question by:basilhs_s
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
diasroshan earned 500 total points
ID: 24313683
Hi,

You can include the identity column in the SQL of your datawindow.
In the update properties, dont select the identity column in the updateable columns section.
So now u can display the column aswell.

DW_1.GetSQLPreview ( )
This will give u the sql sent to the database.
Also, have a look in PB Help at SQLPreview Event of DW.

At runtime to change the taborder,
dw_1.Object.emp_name.TabSequence = 0
or,
dw_1.Modify("emp_name.TabSequence = 0")

Cheers,
Rosh
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 24313865
Hi,

Also, forgot to mention,
In update properties, there is a dropdown to select the identity column.Please select your identity column from there.

In the above post i have asked not to select the identity column in the updateable columns section. Try selecting it and see if its giving any noteable issues.

Cheers,
Rosh
0
 

Author Comment

by:basilhs_s
ID: 24318796
thanks for the reply. it seems that its correct. i ll check it tomorrow morning
0
 

Author Closing Comment

by:basilhs_s
ID: 31578356
thanks very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now