Author |
Message
|
new_to_wmb8 |
Posted: Mon Jul 15, 2013 6:10 am Post subject: Unable to Insert in Database Table |
|
|
 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 |
|
 |
mqjeff |
Posted: Mon Jul 15, 2013 6:20 am Post subject: |
|
|
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 |
|
 |
new_to_wmb8 |
Posted: Mon Jul 15, 2013 6:33 am Post subject: |
|
|
 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 |
|
 |
lancelotlinc |
Posted: Mon Jul 15, 2013 6:41 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jul 15, 2013 6:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
new_to_wmb8 |
Posted: Mon Jul 15, 2013 6:50 am Post subject: |
|
|
 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 |
|
 |
lancelotlinc |
Posted: Mon Jul 15, 2013 7:09 am Post subject: |
|
|
 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 |
|
 |
new_to_wmb8 |
Posted: Tue Jul 16, 2013 9:33 pm Post subject: |
|
|
 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 |
|
 |
new_to_wmb8 |
Posted: Sun Aug 04, 2013 8:52 pm Post subject: |
|
|
 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 |
|
 |
smdavies99 |
Posted: Sun Aug 04, 2013 10:56 pm Post subject: |
|
|
 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 |
|
 |
kunal07 |
Posted: Sun Aug 04, 2013 11:05 pm Post subject: |
|
|
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 |
|
 |
dogorsy |
Posted: Sun Aug 04, 2013 11:08 pm Post subject: |
|
|
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 |
|
 |
kunal07 |
Posted: Sun Aug 04, 2013 11:18 pm Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
ok  |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Aug 05, 2013 12:12 am Post subject: |
|
|
 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 |
|
 |
|