Home » U++ Library support » U++ SQL » SQL Insert Statement without a value[SOLVED]
SQL Insert Statement without a value[SOLVED] [message #3139] |
Mon, 08 May 2006 23:17 |
Justin
Messages: 57 Registered: March 2006 Location: Orange County California
|
Member |
|
|
Hi Guys,
I am trying the following insert command and it is working. However, this command does not work if the fields are empty. Is there a simple way for this to work without having to validate each field and create some type of NULL value?
sql*Insert(NC_SUPPORT)("name", ~supportform.edtName)("company", ~supportform.edtCompany)
("email", ~supportform.edtEmail)("status", ~supportform.lstStatus)
("phone", ~supportform.edtPhone)("country", ~supportform.lstCountry)
("product", ~supportform.lstProduct)("units", ~supportform.edtUnits);
[Updated on: Tue, 09 May 2006 01:44] Report message to a moderator
|
|
|
Re: SQL Insert Statement without a value [message #3140 is a reply to message #3139] |
Mon, 08 May 2006 23:26 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Justin wrote on Mon, 08 May 2006 17:17 | Hi Guys,
I am trying the following insert command and it is working. However, this command does not work if the fields are empty. Is there a simple way for this to work without having to validate each field and create some type of NULL value?
sql*Insert(NC_SUPPORT)("name", ~supportform.edtName)("company", ~supportform.edtCompany)
("email", ~supportform.edtEmail)("status", ~supportform.lstStatus)
("phone", ~supportform.edtPhone)("country", ~supportform.lstCountry)
("product", ~supportform.lstProduct)("units", ~supportform.edtUnits);
|
I am a little bit surprised it works at all Normal way would be to define column lists as
SqlId COMPANY("COMPANY");
Insert(NC_SUPPORT)(COMPANY, value);
As presented, it would yield string representation in columns list (maybe it is OK with some SQL dialects..)
Now about Nulls - well, empty fields should produce Null. You can easily check/debug most of SqlExp problems by activating SQL trace - that will .log SQL commands going to RDBMS and also error messages reported.
Mirek
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 20 15:48:42 CEST 2024
Total time taken to generate the page: 0.01488 seconds
|