Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SqlArray and default value of some field
SqlArray and default value of some field [message #33350] Wed, 27 July 2011 08:44 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

This post is connected with this one
http://www.ultimatepp.org/forum/index.php?t=msg&th=6105& amp; amp; amp;start=0&
and to the test case "SqlArray2.zip" provided by Sergey. I start a new topic as it is not specific of DropList and I am having problem even with OptionButton.

I have a SqlArray in which there are columns with DropList previuosly populated with some data. What I want is to let appear some default value in DropList. This default value should go in the database in case the user NOT modify its content.
In the Sergey test case the DropList is correctly populated:
		SQL * Select(SqlAll()).From(COUNTRY_T);
		while(SQL.Fetch()) {
			country.Add(SQL[0],SQL[1]);
		}

and then initialized to some default value
		
		country <<= "Russia";


When I insert a record the DropList seems lazy and does NOT show its supposed default and remains empty. If the user accept the row without to select an item the field remain empty.
I tried even
         country.SetIndex(1);

to wake up the lazy DropList but without success.
So I tried to modify the SCHEMA with the row
	INT_    (COUNTRY) SQLDEFAULT(12)

where '12' is the key code of value 'Russia'. Again the droplist remain empty and the database column too after accepting the row.
It seems the SQLDEFAULT does not work in sqlite3... if I have understood what it is intend for.

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

Thanks,
Luigi

[Updated on: Wed, 27 July 2011 08:50]

Report message to a moderator

 
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: Sat May 04 21:04:18 CEST 2024

Total time taken to generate the page: 0.05592 seconds