Solved

powerbuilder datawindow identity fields

Posted on 2009-05-06
4
1,904 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse giving error when test program exits 6 143
java class in read only mode in eclipse 2 163
Eclipse XML hightlightning 5 58
Eclipse Neon and jdk 1.8.0 11 254
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…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

790 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