Message from discussion
Use prepared statement - problem
Path: g2news2.google.com!postnews.google.com!j32g2000yqh.googlegroups.com!not-for-mail
From: Eddie Hartman <eddiehart...@gmail.com>
Newsgroups: ibm.software.network.directory-integrator
Subject: Re: Use prepared statement - problem
Date: Thu, 2 Jul 2009 02:10:50 -0700 (PDT)
Organization: http://groups.google.com
Lines: 72
Message-ID: <be4b8bde-5c35-4b27-9f8f-1c2b800ec1ed@j32g2000yqh.googlegroups.com>
References: <c84e7df0-70ee-4628-be0c-d8071d67687d@18g2000yqa.googlegroups.com>
<4fe41370-9e31-4ece-ba16-6136545e5133@c36g2000yqn.googlegroups.com>
NNTP-Posting-Host: 80.202.134.131
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1246525853 11025 127.0.0.1 (2 Jul 2009 09:10:53 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 2 Jul 2009 09:10:53 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: j32g2000yqh.googlegroups.com; posting-host=80.202.134.131;
posting-account=qnul-QoAAABdHj6_i007LJwda636XmGO
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us)
AppleWebKit/530.18 (KHTML, like Gecko) Version/4.0.1 Safari/530.18,gzip(gfe),gzip(gfe)
Take a look at the FlowDiagrams, particularly the page on Lookup Mode:
http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDI.=
doc_7.0/TDI_7.0_FlowDiagrams.pdf
The left sidebar tells you how to code your On Multiple Found Hook.
A simpler solution is to use a Connector Loop with your Lookup
Connector attached. Then you get the following:
1. Components you drop under this loop are cycled through, once for
each entry found by your Lookup Connector.
2. You get a Connector Parameters Map tab where you can map in
the SQL you want to use. This makes it easy to use JavaScript
or Expression mapping to compute this SQL string using values
in Work Attributes or script variables.
And if you are using a Loop and setting the SQL SELECT yourself, I
would
use Iterator mode instead of Lookup. These two modes are almost
identical,
apart from a couple of major differences:
a1). Iterator mode leaves the result set on the server,
returning a single
entry with its getNextEntry() call for each cycle.
b1). Lookup mode fetches the result set in memory. To prevent
memory problems, this is limited to max 10 entries &
configured in
the AssemblyLine Settings tab -- called "Config" in TDI
6, and
behind the AssemblyLine's "Options" button in TDI 7.
This can be
set at the individual Connector level in TDI 7 through
the
"More" button to the right of the Inherit From Parent
button.
a2). Iterator mode uses Config parameters to perform its
search.
b2). Lookup mode uses Link Criteria. The advantage here is that
the
search is done during AL cycling, while Iterator mode
does this
at initialization. However, since the Loop lets you map
in the
Config parameters and set the Initialization option to
only Select,
you get the same flexibility for Iterator mode.
3. You can step through this in the Debugger!!! (you knew I had to
mention the Debugger as well :)
-Eddie
On Jul 2, 10:38=A0am, "kolev.kg" <kolev...@gmail.com> wrote:
> I assume you have put this statement in a lookup connector, correct?
>
> If so then it is normal to get such an error if your link criteria is
> not bound to a unique constraint, i.e. you are querying for something
> that can be present in multiple records at the same time. In your case
> you have 3 records which "end_date" field is NULL. When you get
> multiple entries returned the AL gives you the opportunity to further
> filter the records or to put them all in the resultant entry before
> doing the input map. Since the AL does not know what exactly you might
> want to be done you have been given the ability to specify your
> intentions using a hook - "On Multiple Entries" to be precise. In that
> hook you could cycle throughout all the entries that matched your
> criteria using a script.
>
> Best Regards,
> Kaloyan Kolev.