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 » Unable to Insert in Database Table

Post new topic  Reply to topic
 Unable to Insert in Database Table « View previous topic :: View next topic » 
Author Message
new_to_wmb8
PostPosted: Mon Jul 15, 2013 6:10 am    Post subject: Unable to Insert in Database Table Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Hi All,
i have small issue, please help me out.
i am trying to insert into databse table thru esql,
Code:

INSERT INTO Database.Test.dbo."Temp Emp" (EmpNo,EmpName) VALUES (98745,Test);


it is giving error, cannot find table name "dbo.Temp", i think bcoz of table name is having space " Temp Emp" this error is coming.
when i am using like "Test_WMB" it is working.

any one can help ...how can this work for Table Name " Temp Emp". Database is sql server 2008. plz
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jul 15, 2013 6:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

ESQL is not SQL.

You need to form your ESQl INSERT statement according to the rules of ESLQ, not the rules of your SQL database environment.
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Mon Jul 15, 2013 6:33 am    Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

so how can do this.
i am getting below error when i am doing like this,

Code:
INSERT INTO Database."Test Emp" (EmpNo) VALUES (1234);

ERROR in MQinput node : Text:CHARACTER:[unixODBC][IBM][ODBC SQL Server Driver][SQL Server]Invalid object name 'Test'.

Plz help [/code]
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Jul 15, 2013 6:41 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

There are some really cool database samples:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.samples.routing.doc%2Fdoc%2FextendingDatabase.htm
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Jul 15, 2013 6:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ak05050_.htm
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Mon Jul 15, 2013 6:50 am    Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Thanks for link, but all the sample have database name which does not have space like for me "Temp Emp" and there is no sample for SQL server.

Please help me on this, how can insert on this table "Temp Emp" using ESQL.
for normanl table names it is working like for Test_WMB, Test, etc.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Jul 15, 2013 7:09 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

new_to_wmb8 wrote:
Thanks for link, but all the sample have database name which does not have space like for me "Temp Emp" and there is no sample for SQL server.

Please help me on this, how can insert on this table "Temp Emp" using ESQL.
for normanl table names it is working like for Test_WMB, Test, etc.


You really should solve this problem on your own. It's a great brain teaser.

Think about what rules T-SQL identifiers follow (spaces are allowed only in certain circumstances) and how to pass in a string of characters without using the ESQL interface.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
new_to_wmb8
PostPosted: Tue Jul 16, 2013 9:33 pm    Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Hi All,

The problem is resolved now using "PASSTHRU" Function in ESQL.
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Sun Aug 04, 2013 8:52 pm    Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Hello All,

I need some more help in this thread, as i said below m able to Inser/Update the table using Passthru Function.
So If Incomming message having one instance of data it is working fine, but the requirement is to handle multiple instances as well.
Is it possile to achive this, i had tried to use Cardinality but it updating/Inserting the values for 1st instance.
Plz give some input on this.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Aug 04, 2013 10:56 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Can you show us your update statement?

It is a little difficult to really understand your problem just from your explanation.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kunal07
PostPosted: Sun Aug 04, 2013 11:05 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

Yes,

Code:
PASSTHRU('UPDATE [Vendor Table] SET [Manufacturer Name]=[Vendor] WHERE [Manufacturer Name]= ?', ManufacturerName) ;

Code:
PASSTHRU ('INSERT INTO [Vendor Table]([Vendor], [Vendor Name], [Vendor Address], [Vendor Tel],[Vendor Fax], [FOB Point], [Country of Export], [Domestically Sourced], [Manufacturer Name]) VALUES (?,?,?,?,?,?,?,?,?)', Vendor, VendorName, VendorAddr, VendorTel, VendorFax, FOBPoint, CountryOfExport,  DomesticallySourced, ManufacturerName );


for 1st input Instance it is working, i want it will update multiple Input Instances in one query
Back to top
View user's profile Send private message
dogorsy
PostPosted: Sun Aug 04, 2013 11:08 pm    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

new_to_wmb8 wrote:
Hello All,

I need some more help in this thread, as i said below m able to Inser/Update the table using Passthru Function.
So If Incomming message having one instance of data it is working fine, but the requirement is to handle multiple instances as well.
Is it possile to achive this, i had tried to use Cardinality but it updating/Inserting the values for 1st instance.
Plz give some input on this.


This is a completely different problem to the one described originally. If you have a different problem, you need to open a new thread. Your problems may be solved if you go and get some education. What you are asking are very simple programming techniques.
Back to top
View user's profile Send private message
kunal07
PostPosted: Sun Aug 04, 2013 11:18 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

ok
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Aug 05, 2013 12:12 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

kunal07 wrote:

for 1st input Instance it is working, i want it will update multiple Input Instances in one query


You code is for an INSERT. This is different from an UPDATE.

To UPDATE multiple rows in a table I'd notmally expect a 'WHERE' clause in the SQL unless you want to update ALL the rows in the table.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » Unable to Insert in Database Table
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.