I've read a couple posts around here about auto-incremental values but I haven't had any luck. The statement below is what is used to insert the data in to the table when I click on the Save Button. Is there anyway I can skip setting the reportNumber field in the following statement because the reportNumber value in the WHERE clause is correct:
UPDATE reports SET [...], reportNumber = '' WHERE reportNumber = '100039'
I've tried leaving reportNumber blank which only makes it's value "" and I've tried changing it to a date picker so it inserts NULL but auto-increment fields can't be NULL so it gets changed to 0.
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Yet Another Auto-Increment Question
Re: Yet Another Auto-Increment Question
MrEngineer13,
I'm not sure of what you are trying to do.
So I have a few questions.
Firstly why do you want to use an auto-incrementing primary key? Although we support it, its not the way nuBuilder is designed to work and for a number of reasons its not usually a good idea.
Secondly are you trying to display reportNumber on the form and if so, is it because the user needs to know the value of reportNumber.
(if an object on a Form has the same name as a field in the table, nuBuilder will save the object to the record)
Steven
I'm not sure of what you are trying to do.
So I have a few questions.
Firstly why do you want to use an auto-incrementing primary key? Although we support it, its not the way nuBuilder is designed to work and for a number of reasons its not usually a good idea.
Secondly are you trying to display reportNumber on the form and if so, is it because the user needs to know the value of reportNumber.
(if an object on a Form has the same name as a field in the table, nuBuilder will save the object to the record)
Steven
-
- Posts: 3
- Joined: Mon Apr 30, 2012 2:38 pm
Re: Yet Another Auto-Increment Question
Steven,
Yes, the user needs to know the value of reportNumber so I was displaying it on the forum as a read-only text field but that would cause nuBuilder to save the blank value over the correct one (more a flaw in my own logic than with nuBuilder). What would be the best method for just displaying the value to the user?
Thanks,
Mr.E
Yes, the user needs to know the value of reportNumber so I was displaying it on the forum as a read-only text field but that would cause nuBuilder to save the blank value over the correct one (more a flaw in my own logic than with nuBuilder). What would be the best method for just displaying the value to the user?
Thanks,
Mr.E
Re: Yet Another Auto-Increment Question
Mr. E,
Use a Display object with different name and
for the SQL
Steven
Use a Display object with different name and
Code: Select all
SELECT reportNumber FROM your table WHERE reportNumber = '#id#'
Steven