|
Here's what I ended up with.. not as bad as I thought:
db.init();
db.conn(DBname);
db.prepare(sql);
db.bindParam([
['%' + email + '%', db.SQL_PARAM_INPUT, 0],
]);
db.execute();
var rs = [];
do {
var rc = db.fetch(function callback(row) {
rs.push(row);
});
} while(rc != db.SQL_NO_DATA_FOUND);
res.render('customerList', {customerList: rs});
Brad
www.bvstools.com
On Mon, Apr 4, 2016 at 10:50 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:
that's what I thought... thanks, Aaron. I'm used to my eRPG templates
where you can call them multiple times.
I guess I'd need to build the array/result set myself.
On Mon, Apr 4, 2016 at 10:25 AM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:
I am not sure you can call out to a Jade template multiple times. Or
rather, I've not done it that way so I can't speak to that approach.
Aaron Bartell
litmis.com - Services for open source on IBM i
On Mon, Apr 4, 2016 at 9:51 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:
Ok, so I wasn't going crazy. :)question.
I will try to remember to make a comment. But, here's a "theory"
the
would it be better for me to take each row from the result and build
result set in node (as a whole, like exec() returns) and pass thatentire
result set to my jade template, or loop in node and write out the dataone
row at a time to my jade template that way.doing
Is there a "standard" for this type of processing?
Brad
www.bvstools.com
On Mon, Apr 4, 2016 at 9:35 AM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:
Not sure if there is reasoning from IBM behind that, but I agree, itwould
be better (and more efficient) to get the entire result set. I wouldmake
a comment on the bottom of that documentation page. IBM has been
in mygood at collaborating with the community on developerWorks (which,
wrote:opinion, makes progress happen a lot faster than doing PMRs or DCRs).
Aaron Bartell
litmis.com - Services for open source on IBM i
On Mon, Apr 4, 2016 at 9:30 AM, Bradley Stone <bvstone@xxxxxxxxx>
once
If I'm reading the docs correctly:
1.3.15. execute
*Description:*
Runs a statement that was successfully prepared using *prepare*()
orof
multiple times. The statement is processed with the current values
anyof
application variables that were bound to parameter markers by
*bindParam*().
*Syntax 1:*
execute()
*Syntax 2:*
execute(function *Callback*(*OutParamList*))
*Parameters **Callback*(*OutParamList*):
*Callback *is a callback function to process the output parameters
theparameters.
parameter markers. *OutParamList *is a list of the output
Itfetch()
is
in the java script array format.
*Comments:*
* If the statement also return a result set, user can issue the
throwstatementfunction to retrieve the data row by row.
I believe This is saying that when using execute on a prepared
vs
exec on an SQL statement the rows NEEDS be processed one at a time.
bummer.. returning the entire result set made things so easy to
recordsintodone. I
a jade template. :) Now I'm going to need to change how that's
was wondering what was better practice, looping your result set
mailingin
the node.js or letting your template handle it...--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailinglist--
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
list--
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.