Solved

powerbuilder datawindow identity fields

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

813 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

10 Experts available now in Live!

Get 1:1 Help Now