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


  • Subject: Re: RPG Embedded SQL - problem with CONCAT
  • From: Carel Teijgeler <COTeijgeler@xxxxxxxxx>
  • Date: Thu, 19 Jul 2001 22:20:42 +0000

Daniel,

You will have to do the same CONCAT in the WHERE-clause.

Regards,

Carel Teijgeler


At 18:34 19-7-01, you wrote:

>Hey 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. Keith
>
>PS 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 +---
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.265 / Virus Database: 137 - Release Date: 18-7-01

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.