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 » Database error

Post new topic  Reply to topic
 Database error « View previous topic :: View next topic » 
Author Message
rkford11
PostPosted: Tue Jan 16, 2007 1:08 pm    Post subject: Database error Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

When i am executing the following ESQL

CREATE COMPUTE MODULE Test_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
DECLARE A INTEGER;
SET A = CARDINALITY(SELECT X.* FROM Database.Test."Test.Table1" AS X);
SET OutputRoot = InputRoot;
END;
END MODULE;

database is throwing me the following error

Database error: SQL State ''HY000''; Native Error Code '933'; Error Text ''[DataDirect][ODBC Oracle driver][Oracle]ORA-00933: SQL command not properly ended ''.

The error has the following diagnostic information: SQL State ''HY000'' SQL Native Error Code '933' SQL Error Text ''[DataDirect][ODBC Oracle driver][Oracle]ORA-00933: SQL command not properly ended ''.
We have our broker v6.0 running on windows 2003 and Oracle 10g is the application database. Please guide me through this.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 16, 2007 1:21 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I would use a passthru statement and have the database count the rows instead of pulling the entire table into broker memory, and then using cardinality to count the rows in the result set.

Also, I've been seeing this a lot - it's a very poor code practice to add your own stuff to CopyEntireMessage or CopyMessageHeaders. The person who has to maintain your code will never know to look there.

Add your own code directly to Main or create your own procedures.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Jan 16, 2007 1:24 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Not only that, but this code also calls bothCopyMessageHeaders and CopyEntireMessage, which is always a bad idea.
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
rkford11
PostPosted: Tue Jan 16, 2007 3:30 pm    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

mgk wrote:
Not only that, but this code also calls bothCopyMessageHeaders and CopyEntireMessage, which is always a bad idea.


Thanks Jeff and mgk. Passthru statement worked for me and i will make sure that i write the code in main or create my own procedure.
Back to top
View user's profile Send private message
vk
PostPosted: Tue Jan 16, 2007 8:21 pm    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

We faced the same issue. While accessing Oracle DB, do not use AS keyword for specifying database alias. The query should work if executed as follows -

SELECT COUNT(*) FROM Database.<SchemaName>.<TableName>

OR

SELECT K.* FROM Database.<SchemaName>.<TableName> K (No AS)

Regards,
VK.
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Jan 17, 2007 1:34 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
do not use AS keyword for specifying database alias


This is not quite correct. You must use the AS when using an ESQL SELECT (but ESQL will remove the AS when sending the final ODBC string to Oracle). However, you must not use it in a PASSTHRU when talking to Oracle because as you say Oracle does not like it.

regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » Database error
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.