× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello! I have a question on the data returned from an SQL query using node
(express and jade).

Let's say I have this in my route file:

var sql = 'select CMEMAIL, CMLNAME, CMFNAME from bvscomp.cstmstpf where
UCASE(CMEMAIL) like UCASE(\'%' + email + '%\')';

db.init();
db.conn(DBname);
db.exec(sql, function(rs) {
res.render('customerList', {customerList: rs});
});
db.close();

The Jade template looks like this:

table
tr
th(align="left") Last Name
th(align="left") First Name
th(align="left") eMail Address
each customer in customerList
tr
td(align="left")

a(href='/viewCustomer/'+customer.CMEMAIL)&attributes({'data-id':customer.CMEMAIL})=
customer.CMEMAIL
td(align="left")= customer.CMLNAME
td(align="left")= customer.CMFNAME


Now, I can't figure out what isn't (or if it should be) "trimming" the
blanks off the end of the each result. Is that a setting in the SQL query,
or in jade?

What's returned is
<a href="/viewCustomer/joeblow@xxxxxx


" data-id="joeblow@xxxxxx


">
joeblow@xxxxxx
</a>

See all the blanks after each email? They're only blanks but I assume that
it's not good to have them there even though things display ok.

Thanks!

Brad
www.bvstools.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.