× 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.



Since you didn't post any code.  I'll take a few guesses.

The problem you are running into with numeric....

I'm guessing you are trying to string the numerics into the statement to
execute.  This will nt work because once you you the numerics inside the
quotes they are no longer numeric but character.  To use numerics in a
dynamic SQL statement you'll have to use placeholders the ? 

Example:
SQL$ = 'INSERT INTO MYLIB/MYFILE VALUES('mychar', ?, ?)';

Then your other questions to execute a string you must first PREPARE the
string:
C/EXEC SQL
C+  PREPARE String From :SQL$
C/END-EXEC

Then EXECUTE the statement (for the example above):
C/EXEC SQL
C+ EXECUTE String Using :mynumber1, :mynumber2
C/END-EXEC

The execute will replace the ? In your SQL statement with the values
contained in the mynumber1 & mynumber2 fields.

HTH...
 


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Matt Gross
Sent: Monday, August 14, 2006 9:11 AM
To: Post AS-400 Language Questions
Subject: SQLRPGLE 

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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.