|
-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On Behalf Of Daniel Keith
Sent: Thursday, July 19, 2001 1:35 PM
To: rpg400-l@midrange.com
Subject: RPG Embedded SQL - problem with CONCATHey fellow programmers & genius,I have this problem the CONCAT in my embedded SQL. I am stringing three fields together. That works fine. The problem is when I try to test against the field I am building. Am I able to do this or am I just wrong on the syntax?Please help.My error code is a -514. When I cut and paste the statement from debug and run interactively I get an error that states that the field DATE can't be found. The exact statement is "Column DATE not in specified tables" which is true because I am creating it. If I remove the test it runs without errors.The following is what I cut from debug which is much more readable:SELECT rdbrr, rditem, rdpack ,rdbttl, rdcase, imwgal, impcse ,
DIGITS(rdject) CONCAT DIGITS(rdjeyr) CONCAT DIGITS(rdjemo) AS date
FROM rrrdmast, icmsmp WHERE rditem = imitem AND rdpack = impack AND
rdbrr = 38 AND ((date >= "200101") or (date <= "200106"))The following is what I cut directly from my program:c eval sql_string2 = 'SELECT rdbrr, rditem, rdpack -*
c ,rdbttl, rdcase, imwgal, impcse, -
c DIGITS(rdject) CONCAT DIGITS(rdjeyr) CONCAT -
c DIGITS(rdjemo) AS date - &nb! sp;
c FROM rrrdmast, icmsmp -
c WHERE rditem = imitem AND rdpack = impack -
c AND rdbrr = ' + %editc(mwwhse:'X') + *
c &n! bsp; ' AND ((date >= "' + beg_date + '") or -
c (date <= "' + end_date + '"))'
c/exec sql &nb! sp;
c+ PREPARE p2 FROM : sql_string2
C/end-exec &nb! sp; & nbsp;
c/exec sql
c+ DECLARE data2 CURSOR FOR p2
C/end-exec &! nbsp;
c/exec sql
C+ OPEN data2 &n! bsp;
C/end-exec
C Dow sqlcod = 0
C/exec sql &n! bsp;
C+ FETCH data2 INTO :sql_input2
C/end-exec &nb! sp;Thanks in Advance:
Daniel A. KeithPS I wasn't sure if this was to be in midrange-l or rpg-l.
Get your FREE download of MSN Explorer at http://explorer.msn.com
+--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.