Solved

powerbuilder datawindow identity fields

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Alternative to codeshare.io 23 1,061
System.out.println to console instead to Jboss log file 12 629
Notepad++ search not working 6 1,185
Eclipse for PHP 1 95
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
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 connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

920 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

11 Experts available now in Live!

Get 1:1 Help Now