|
%Yes it should work. If you use alpha field, you sould add signle quote before and after the value, not with numeric. Eval sqlstms = 'select * from myfile where ' + 'alpha = ' + Quote + alphacriteria + Quote + 'and ' + 'numeric=' + %editc(numcriteria:'Z') ; where quote is defined like : D quote C '''' hope this help ----- Original Message ----- From: <Michael_Schutte@xxxxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Monday, August 14, 2006 4:24 PM Subject: Re: SQLRPGLE
%EditC should work... maybe you're just not using it right, make sure it's outside of the string. SQLString = 'Select * from file where number = ' + %EditC(hostnumber:'Z'); Then for executing it, please look into the SQL reference manual using the PREPARE statement. The manual can be found on the IBM website. Thanks. Try our New Country Benedicts -- Breakfast with a Bob Evans twist! Matt Gross <prrgg1@sbcglobal .net> To Sent by: Post AS-400 Language Questions rpg400-l-bounces@ <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 08/14/2006 10:10 SQLRPGLE AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> I am trying to build a string containing an SQL statement, which will be doing an INSERT INTO operation. I'm running into a problem when one of the fields will contain numeric data. The compile error is that "Operands are not compatible". I've tried a number of techniques to use the syntax with %NUM and
%EDITC,
but I'm still having problems. Any help/example appreciated. Also, on the EXEC SQL statement, how would I execute a string? Thanks, Matt -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.