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



1) We sit on 7.3 and when it comes to PTF for db2 we did installed
many ptf's few weeks ago.
2) Unfortunaly it does not work original myTables DS as the target

What I do is I'm using CRTSQLRPGI command and there I can specify
that final obj is srvpgm so I thought that I can call this process
"compilation". I don't create module and then later create srvpgm from
it (or maybe CRTSQLRPGI is doing it somehow in the middle).
śr., 29 sie 2018 o 14:52 Jon Paris <jon.paris@xxxxxxxxxxxxxx> napisał(a):

Questions for you.

1) What release are you on? And are you up-to-date on database PTFs. Many restrictions on usage of a DS in this manner have been released over the years.

2) Does it work if you use the original myTable DS as the target?


P.S. There is nothing "special" about a service program - that will not be the cause. You say "during srvpgm compilation" but that is not possible - there is no such ability built-in to the system. You are compiling a module - the system has no idea that you will eventually put it in a service program.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Aug 29, 2018, at 8:32 AM, Filip Drzewiecki <zaboleqqq@xxxxxxxxx> wrote:

Hello,

I have an SQL table with long names. Based on below article I've tried
to declare Data Structure based on this table so I can select all
columns to my Data stucture in service program. Problem is that
I always get Error "XXX is not defined or no usable" during srvpgm
compilation where XXX is the name of DS which is based on another DS
with extname and alias. Even if I use main DS(the one with extname)
error is the same. I thought that adding alias will fix problem with
long names. When I declared the same DS but I've specified all fields
explicitly, compilation was successful.

http://www.rpgpgm.com/2018/05/how-to-sql-tables-long-names-in-rpg.html

Dcl-Ds myTable extname('tableName':*ALL) qualified alias;
End-Ds;

Dcl-ds myTable_X likeds myTable);

Exec SQL
select * into : myTable_X from tableName where ID= :UserId;

This on is failing. SQL always return one row of data. After I change
DS and declare all fields (70...) myself, it starts to compile. I
really don't know why. Any idea? Maybe this can't be done with srvpgm?
I handle nulls in table by using ALWNULL(*INPUTONLY).

Best Regards
Filip
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.