Author |
Message
|
kt76 |
Posted: Wed Feb 25, 2004 5:10 am Post subject: Storing value in db |
|
|
Acolyte
Joined: 18 Jan 2004 Posts: 52
|
I am storing a particluar value in a db col which i concat
Set data = InputRoot.MRM.x||InputRoot.MRM.y
Insert into db.data(Msg) values(data);
When i retrieve this back from db, i get a error
:Trying to assign or use a list as a scalar
Set data = The(Select Msg from Db.data where...)
Can anyone let me know how this can be achieved. |
|
Back to top |
|
 |
fazz |
Posted: Wed Feb 25, 2004 5:19 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
You could try returning the data into a modifiable tree.
e.g.
Set LocalEnvironment.Variables.Data[] = THE (SELECT ITEM Msg FROM Database.data where.......) |
|
Back to top |
|
 |
Missam |
Posted: Wed Feb 25, 2004 6:39 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
You can not store
Code: |
Set data = The(Select Msg from Db.data where...)
|
value in a scalar field(data) if the query returns more than one value(Msg)
try doing as fazz sugested |
|
Back to top |
|
 |
kt76 |
Posted: Wed Feb 25, 2004 7:39 am Post subject: |
|
|
Acolyte
Joined: 18 Jan 2004 Posts: 52
|
Thanks it worked.
But Im surprsied why we need to take this value in a array[].
Is it coz im concating 2 values and saving in the database |
|
Back to top |
|
 |
Missam |
Posted: Wed Feb 25, 2004 7:45 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Quote: |
But Im surprsied why we need to take this value in a array[].
Is it coz im concating 2 values and saving in the database
|
The Answer for your question is no.
Check whether your Database Table has more than one row Existing |
|
Back to top |
|
 |
fazz |
Posted: Wed Feb 25, 2004 9:13 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
It should not matter if the database has more than one row as you are using the 'THE' keyword, which only returns one row.
I think if you use the 'ITEM' keyword as well it should work.
This is because without the 'ITEM' keyword it is trying to assign the column name to your variable then the value.
i.e. data.Msg = value |
|
Back to top |
|
 |
|