× 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: SQL Newbie
  • From: Jose Vega <jvega@xxxxxxxxx>
  • Date: Thu, 1 Feb 2001 13:59:13 -0800

Help!!
I am using embedded SQL to Create a table, going through RPG calculations
after a select statement, then moving my desired values into Host Variables
which I then am trying to insert into my newly created table. I have tested
these statements in ISQL with success which is why I am lost as to how come
it is not working in my RPG program. Any help would be greatly appreciated. 
I have looked up the following SQLcode/SQLstate errors:
-7708 &1 in &2 not valid for operation
55019 Table is in an invalid state for the operation. 
CODE:
DS
            1  2 Keysta
            3  3 Taxsta
         P  4 100Ordnum 
         P 11 160Cusnum 
           17 46 Cusnam
         P 47 552Taxamt

/EXEC SQL
CREATE TABLE ARPC008
  (KYSTT CHAR(2),
   TAXTS CHAR(1),
   ORDNO DEC(7,0), 
   CUSNO DEC(6,0),
   CUSNM CHAR(30),
   TAXTL DEC(9,2),
/END-EXEC

*GOES THROUGH Select statement, CALCULATIONS, POPULATES
DATA STRUCTURE WITH DESIRED VALUES.

(this is where I am popping up with the error code in ISdebug)
/EXEC SQL
INSERT INTO ARPC008
       (KYSTT,
        TESTS,
        ORDNO,
        CUSNO,
        CUSNM,
        TAXTL)
VALUES
      (:Keysta,
       :Taxsta,
       :Ordnum, 
       :Cusnum, 
       :Cusnam,
       :Taxamt)
/END-EXEC  


Confidentiality Notice:

The information contained and/or attached to this electronic mail is 
intended only for the person(s) or entity(ies) to which it is addressed and 
may contain confidential and/or legally privileged material.  Any use 
whatsoever of this information by persons other than the intended recipient 
is prohibited.  If you received this in error, please contact the sender 
and delete the material from your computer. 


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 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.