ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Storing value in db

Post new topic  Reply to topic
 Storing value in db « View previous topic :: View next topic » 
Author Message
kt76
PostPosted: Wed Feb 25, 2004 5:10 am    Post subject: Storing value in db Reply with quote

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
View user's profile Send private message
fazz
PostPosted: Wed Feb 25, 2004 5:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Missam
PostPosted: Wed Feb 25, 2004 6:39 am    Post subject: Reply with quote

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
View user's profile Send private message
kt76
PostPosted: Wed Feb 25, 2004 7:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Missam
PostPosted: Wed Feb 25, 2004 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message
fazz
PostPosted: Wed Feb 25, 2004 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Storing value in db
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.