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 » Help required with INSERT statment

Post new topic  Reply to topic
 Help required with INSERT statment « View previous topic :: View next topic » 
Author Message
raghav_138
PostPosted: Mon Aug 24, 2009 9:56 pm    Post subject: Help required with INSERT statment Reply with quote

Newbie

Joined: 04 Aug 2009
Posts: 9

Hello,

I am trying to use the below insert statement to insert data into database

INSERT INTO Database.Sample(ID,Name) values(INPUT);

Where INPUT is a character variable that contains the value 'OR','UORU'

When I run this statement I see that it’s throwing an exception saying number of values inserted are different from the number of columns inside the table

Could some one help me how to store values in a variable and directly pass those values?

In my requirement all my values come dynamically and i want to use them as they come by storing them inside a variable and passing the variable to the insert statement
Back to top
View user's profile Send private message
nagarjun_vv
PostPosted: Mon Aug 24, 2009 10:54 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Jun 2008
Posts: 33

you are having 2 columns but u r inserting only one variable(even it has 2 values)

If input is an array use values(input[1],input[2]) or go for 2 different variables.
Back to top
View user's profile Send private message Send e-mail
raghav_138
PostPosted: Tue Aug 25, 2009 4:28 am    Post subject: Reply with quote

Newbie

Joined: 04 Aug 2009
Posts: 9

But how about if I want to pass it as a string
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Aug 25, 2009 5:03 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

raghav_138 wrote:
But how about if I want to pass it as a string


Pass what in as a string? both columns?

Why are you not specifying two values in the insert statement as previsouly mentioned?
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 » Help required with INSERT statment
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.