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 the csv records, one by one in the database table

Post new topic  Reply to topic
 Storing the csv records, one by one in the database table « View previous topic :: View next topic » 
Author Message
nk
PostPosted: Mon Sep 10, 2012 12:19 am    Post subject: Storing the csv records, one by one in the database table Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

I've csv file which contains records. I wanna read the record one by one from the csv file and need to store in the database. Here my problem is that how do i'll check for the end of record and put condition in the Esql code
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Sep 10, 2012 12:39 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Two questions:
1. What have you tried so far? No point in us telling you things that you already know
2. Why do you want to do this using ESQL? Is there some reason why the FileInput node does not meet your requirements?
Back to top
View user's profile Send private message
nk
PostPosted: Tue Sep 11, 2012 1:17 am    Post subject: Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

yes there is client requirement to do in ESQl .

Code:

IF EXISTS(InputRoot.MRM.Rail[]) THEN
INSERT INTO Database.XYZ.Rail ( Key,Org,E_Date,Seq,SegOrg,SegDest,Svc ) VALUES  ( Key,Org,E_Date,Seq,SegOrg,SegDest,Svc
);
            
yes there is client requirement to do in ESQl .
[code]
IF EXISTS(InputRoot.MRM.Rail[]) THEN
INSERT INTO Database.XYZ.Rail ( Key,Org,E_Date,Seq,SegOrg,SegDest,Svc ) VALUES  ( Key,Org,E_Date,Seq,SegOrg,SegDest,Svc
);
            
RETURN FALSE;
END IF;[/code]

The values are getting inserted in the database table but it's not executing anything after the "if". If you remove  [code]RETURN FALSE; [/code] all the code will get executed the same number of times of the record length.


Last edited by nk on Tue Sep 11, 2012 2:23 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Sep 11, 2012 1:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't understand how your last post relates to your original question. Please explain more clearly.
Back to top
View user's profile Send private message
nk
PostPosted: Tue Sep 11, 2012 3:02 am    Post subject: Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

I've written the code to store .csv file in the database table. It's now writing but any further code is not getting executed.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Tue Sep 11, 2012 3:09 am    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi nk,

I think you should consider again
Quote:
RETURN FALSE;
clause inside your condition.

--
Marko
Back to top
View user's profile Send private message Visit poster's website
nathanw
PostPosted: Tue Sep 11, 2012 3:14 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

or perhaps have the insert in a separate node and simple propogate each entry as an individual message to the insert node
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
nk
PostPosted: Tue Sep 11, 2012 4:25 am    Post subject: Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

Code:
RETURN FALSE;
is the culprit. I've to use only one compute node for the operation.
can i change any additional logic for further code execution or Is there any other method to logic to read from file ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 11, 2012 4:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

nk wrote:
Is there any other method to logic to read from file ?


Yes. Use a FileInput node. Ask the client why they want it done in ESQL; specifically what technical requirement they have & exactly why the FileInput node doesn't meet it.

Or are you looking at a client requirement that says "Produce code to read a csv file" and taking it very, very literally?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
nk
PostPosted: Tue Sep 11, 2012 5:06 am    Post subject: Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

I've been provided some doc in which all the req has been nentioned along with the pics of the flow.
My flow goes like this

FTE Input -> Flow Order ->Compute ->Flow Order- > MQ Output

IN the FTE node i need to set custom delimiter(0D0A) so that it takes record one by one.
Back to top
View user's profile Send private message
nathanw
PostPosted: Tue Sep 11, 2012 5:12 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

it is possible to make recomendations to improve the design

personally I would make the improvements and say this is a better solution
_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
nk
PostPosted: Wed Sep 12, 2012 11:50 pm    Post subject: Reply with quote

Novice

Joined: 05 Jul 2012
Posts: 19

thank you all.

we have changed the design . Now it's working.
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 the csv records, one by one in the 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.