Board index » delphi » Initialising Integer Values with zero instead of null in trigger
Craig Cookesley
![]() Delphi Developer |
Craig Cookesley
![]() Delphi Developer |
Initialising Integer Values with zero instead of null in trigger2006-05-31 08:45:59 AM delphi17 Hi I would like to create a common SP or UDF which I can call after insert to initialise all integer values to zero instead of null. Any examples or help would be greatly appreciated. Kind regards Craig |
Wayne Niddery [TeamB]
![]() Delphi Developer |
2006-05-31 10:18:42 AM
Re:Initialising Integer Values with zero instead of null in trigger
Craig Cookesley writes:
Quote
create table xxx ( somefield integer default 0 not null, {...} ) As far as I know there is no way to write a universal SP (or UDF) that can do this for any arbitrary table because field names cannot be treated as parameters in an SQL statement. -- Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com) RADBooks: www.logicfundamentals.com/RADBooks.html "The moment the idea is admitted into society that property is not as sacred as the laws of God and there is not a force of law and public justice to protect it, anarchy and tyranny commence." - John Adams |
Craig Cookesley
![]() Delphi Developer |
2006-05-31 12:43:47 PM
Re:Initialising Integer Values with zero instead of null in trigger
Thanks Wayne
I found that I can setup a domain with a default value of zero and set the fields to the domain Craig "Craig Cookesley" <XXXX@XXXXX.COM>writes QuoteHi |
Martijn Tonies
![]() Delphi Developer |
2006-05-31 03:10:30 PM
Re:Initialising Integer Values with zero instead of null in triggerQuote
example, NULL will be inserted (or attempted to insert on "required" columns). -- Martijn Tonies Database Workbench - development tool for InterBase and more! Upscene Productions www.upscene.com My thoughts: blog.upscene.com/martijn/ Database development questions? Check the forum! www.databasedevelopmentforum.com |
Bill Todd
![]() Delphi Developer |
2006-05-31 09:51:17 PM
Re:Initialising Integer Values with zero instead of null in trigger
Martijn Tonies writes:
Quote> trigger. -- Bill Todd (TeamB) |
Craig Cookesley
![]() Delphi Developer |
2006-06-09 08:23:43 PM
Re:Initialising Integer Values with zero instead of null in trigger
thankyou, you saved me some value time
Craig "Martijn Tonies" <XXXX@XXXXX.COM>writes Quote> |