LIST data type in CREATE TABLE declaration SOLVED (due to Bastiaan)
Jean-Marc Voegeli
jmvoegeli at bluewin.ch
Tue Jan 19 02:37:02 EST 2010
Hello Bastiaan,
Thank you for your answer.
It works very well and I do not have to use the DML file system of Omnis any more as a work around.
-----
> Inserting data into this table btw, is just the opposite, if your data
> in Omnis is a proper Omnis list, and your column in your database is a
> binary column, and you issue an SQL command with bindings, the list gets
> converted to a binary and store properly:
> ----
> calculate lvList.$line as lvList.$add(123,pvDataList).$line
> begin statement
> sta: insert into MyTable (MyIDColumn, MyListColumn) values
> (@[lvList.ID], @[lvList.MyListColumn])
> end statement
> do lvStatementObj.$execdirect()
-----
That is what I did :
I have a base object which add a new record to the database by doing iDataList.$add() and when user confirmed it does a 'Do iDataList.$doinserts()' else it calls the iDataList.$undoinserts() method.
-----
I asked myself how to do two things different at the same times :
1) adding the other fields of the schema by $doinserts()
2) adding the list column by doing @[lvList]
and after doing iDataList.$doinserts() ?
and would that not add another record with only the list column not empty ?
-----
There is a statement object buried into the sql list.
When I log on, a statement object is created and put into the list : iDataList.$statementobject
-----
When I want to put value into the database I must do
1) iDataList.$doinserts() then
2)
Do iDataList.$statementobject.$prepare('INSERT INTO Preferences (p_ChoixChapitres) VALUES (@[vListeDesChoix])') Returns lvOK
If (lvOK)
Do iDataList.$statementobject.$execute() Returns lvOK
End If
and when I want to update that list I must do :
1) iDataList.$doupdates() then
2)
Do iDataList.$statementobject.$prepare('UPDATE Preferences SET p_ChoixChapitres = @[vListeDesChoix]') Returns vOK
If (vOK)
Do iDataList.$statementobject.$execute() Returns vOK
End If
and everything went smoothly due to Bastiaan.
Thank you very very much indeed.
Best regards
PS : I did not quite understood how to complement the iDataList.$undoinserts() method so I waited after the user click "confirm" to change the list column.
Jean-Marc VOEGELI
Tél.: 022/784.34.80
Fax : 022/784.23.40
Natel : 079/416.35.34
eMail : jmvoegeli at bluewin.ch
More information about the omnisdev-en
mailing list