U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » SqlArray and default value of some field
Re: SqlArray and default value of some field [message #33388 is a reply to message #33385] Sun, 31 July 2011 09:03 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
forlano wrote on Sat, 30 July 2011 16:19

mirek wrote on Sat, 30 July 2011 19:04

forlano wrote on Wed, 27 July 2011 02:44



Any hint about setting a default value in SqlArray with embedded Ctrl?



ArrayCtrl::IdInfo::InsertValue / ArrayCtrl::Column::InsertValue.

Mirek


Thank you,

the line

master.AddColumn(COUNTRY,"Country").SetConvert(Single<CountryConvert >()).Edit(country).InsertValue(12);

solved all the problems at once.
However i still wonder what SQLDEFAULT is intended to, or if I misused it. I believed it should take care of the default value.
Anyway one correct solution is enough Smile



It does - on database schema level!

Inserting row into SqlArray is not the same thing as inserting it to DB.

If you would have issued statement

SQL * Insert

and omit the value for which you have defined SQLDEFAULT, database would fill it for you.

However, SqlArray in default mode does not even do SQL Insert befero you send the row into DB by hitting Enter. So it has to have a different set of default values, defined at SqlArray (/ArrayCtrl) level...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SQLITE] New version (3.7.0) introduces write-ahead logging.
Next Topic: sqlite and GridCtrl
Goto Forum:
  


Current Time: Mon Sep 07 02:13:05 GMT+2 2026

Total time taken to generate the page: 0.02136 seconds