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



Hi

added code no error

record is written but RPG program can't read it


----- Original Message -----
From: "Alan Campin" <alan0307d@xxxxxxxxx>
To: "midrange-l" <midrange-l@xxxxxxxxxxxxxxxxxx>
Sent: Wednesday, June 19, 2019 4:08:18 PM
Subject: Re: SQL

Number one mistake new people always make with SQL. You must check
SqlState after each SQL operation except a declare and maybe close cursor. .

Not doing so is basically suicide. Sooner or later and mostly sooner, you
are going to blow your brains out.

dcl-c SQL_STATE_OK '00000';
dcl-c SQL_STATE_NO_ROW '02000';

// Insert operation.
If SqlState <> SQL_STATE_OK;
// Throw an error.
EndIf;

Add that code and see what you see.


On Wed, Jun 19, 2019, 3:55 PM dave_peters@xxxxxxxxx <dave_peters@xxxxxxxxx>
wrote:

Hi

use strpdm
chose work with objects
select file use option 18 to create DFU

here is the program BLD003RP SQLRPGLE

Demp e ds extname(sfl001pf)

/Free

exec sql
set option
commit = *none;

exec sql
insert into sfl001pf VALUES
( 0419440,
'Slovabz',
'Dave',
'E',
'Red',
'13945 56 ave',
'Surrey',
'BC');

*Inlr = *On;

/End-Free



----- Original Message -----
From: "Justin Taylor" <JUSTIN@xxxxxxxxxxxxx>
To: "midrange-l" <midrange-l@xxxxxxxxxxxxxxxxxx>
Sent: Wednesday, June 19, 2019 3:09:41 PM
Subject: RE: SQL

What's "option 18"?

Is it an SQLRPGLE program that did the insert? Does it use commitment
control? If so, did you do a commit after the insert? If it's SQLRPGLE,
do a DSPPGM command against it. On the module page (3 for me), do a
"Display description" against your module. You want " DB2 for IBM i module
attributes:", which is down several pages.




-----Original Message-----
From: dave_peters@xxxxxxxxx [mailto:dave_peters@xxxxxxxxx]
Sent: Wednesday, June 19, 2019 4:38 PM
To: midrange-l <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: SQL

Hi

wrote simple program to insert a record into an external file using SQL,
works fine can see the record using option 18 on file, but can not read it
with RPG program using external file or SQL

Dave


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.