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



You can't use a SETLL as an SQL view has no index.

Charles


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of PAPWORTH Paul
Sent: Tuesday, October 09, 2007 3:17 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Using an SQL VIEW as a file (F Specs) in a RPG programme

Can I use a VIEW which contains a SELECT where FIELD = 'XXXX'
as a file in an RPG program and use a SETLL to position to
this value prior to a READ.

I've tried to do this but keep getting a compile error which
basically is saying that you cannot perform this operation on
a programme described file

Thanks in advance
-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de
rpg400-l-request@xxxxxxxxxxxx Envoyé : lundi 8 octobre 2007
20:39 À : rpg400-l@xxxxxxxxxxxx Objet : RPG400-L Digest, Vol
6, Issue 997

Send RPG400-L mailing list submissions to
rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more
specific than "Re: Contents of RPG400-L digest..."


*** NOTE: When replying to this digest message, PLEASE remove
all text unrelated to your reply and change the subject line
so it is meaningful.

Today's Topics:

1. AW: Create table & Create Phisical File (BirgittaHauser)
2. Re: Create table & Create Phisical File (Luis Rodriguez)


----------------------------------------------------------------------

message: 1
date: Mon, 8 Oct 2007 19:36:17 +0200
from: "BirgittaHauser" <Hauser@xxxxxxxxxxxxxxx>
subject: AW: Create table & Create Phisical File

Hi,

Neither an EVI nor a Binrary Radix Tree index can be
specified in SQL.
Because it's the optimizer that looks for the optimal access path.
You can specify a DDS described logical file in a SQL Select
statement, but the optimizer does not care about the key
specified in the logical file.
Before the optimizer searches for the perfect index, it
analyzes the SQL statement. If a DDS described logical file
is specified the optimizer looks into the file description
ant takes the infos about the selected fields, the joins and
select/omit clauses and rewrites the SQL statement with this
information but based on the underlying phyiscal files (or
SQL Tables).
After this step the optimizer searches through all access
paths (DDS described logical files and SQL index) to
determine the best access path.

Even though an index cannot be specified in an SQL statement,
it can be specified in the F-Spec and used like any other
(DDS-described) keyed logical file.

Mit freundlichen Gr??en / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the
stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek
Bok) "What is worse than training your staff and losing them?
Not training them and keeping them!"

-----Urspr?ngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Raul A. Jager W.
Gesendet: Monday, October 08, 2007 16:18
An: RPG programming on the AS400 / iSeries
Betreff: Re: Create table & Create Phisical File


Add the "FROM".
You can't select from an "EVI" index, but the others options
will allow the select, but the output will not necesarily
come ordered, unless you use "order by".

Wilt, Charles wrote:

You can't SELECT * IDXFILE

While the index IDXFILE is implemented as an i5/OS logical
file object,
and you can normally do a SELECT * FROM MYLF, when MYLF is a DDS
defined logical, the system does know there is a difference
between a
DDS logical and an SQL index.

When using SQL you should _always_ specify the actual physical
file/table (or a view) on the statement. To provide
ordering, add the
ORDER BY clause on your select statement.


HTH,
Charles




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Cezary Krzywda
Sent: Monday, October 08, 2007 10:39 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Table1 - PF
Next I prepare index using SQL

Create IDXFILE
CREATE INDEX Lib1/IDXFILE ON Lib1/Table1 (
S08FIR,OS08KLI,OS08GRPR,OS08IDX,OS08KODR,OS08DOS,OS08MT,OS08DATOD)

After that I run sql
Select * From IDXFILE

And I got errors
IDXFILE in Lib1 not table, view, or physical file.

Czarek

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
matt.haas@xxxxxxxxxxx
Sent: Monday, October 08, 2007 4:26 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Create table & Create Phisical File

What did you call the index? Is the library you specified
during the
create in you library list? What's the error you got?

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Cezary Krzywda
Sent: Monday, October 08, 2007 10:25 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

I have run
Select * From IDXFILE
And I had error ?
It seems that INDEX is not the same logical files .
I will try to use INDEX in RPG program Czarek


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
matt.haas@xxxxxxxxxxx
Sent: Monday, October 08, 2007 4:12 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Create table & Create Phisical File

When you create an index, it can be used just like a
logical file. All
you have to do is specify the name of the index you created
instead of
the base table name in your F specs.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Cezary Krzywda
Sent: Monday, October 08, 2007 10:10 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File


So
How Can I use Setll , SetGT .? Should I create index using CREATE
INDEX in SQL ? But the problem is How can I use this index in RPG ?


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles
Sent: Monday, October 08, 2007 4:00 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Unique?

Then you can't have a key on the SQL table.

Sorry, but that's just the way it works.

Is there no combination of current fields that are unique?

Even if KEY1,KEY2 aren't unique, if by adding KEY3 you can get a
unique key into the file, you can add
KEY3 without needing to change any existing programs.

The only other way would be to a an auto-incrementing field to the
file, but that would require recompiling all existing RPG programs.

HTH,

Charles



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Cezary Krzywda
Sent: Monday, October 08, 2007 9:57 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

But fields are not uniqual


Pozdrawiam

Cezary Krzywda
Analityk, Dzia? Informatyki/
ICT Analyst, ICT Onninen Sp. z o.o.
Tel. +48 42 6768 877,
Mobile +48 502 19 77 61
Fax. +48 42 6768 800
Teolin 18B, Gmina Nowosolna,
92-701 ??D?
Poland
cezary.krzywda@xxxxxxxxxx
www.onninen.pl


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles
Sent: Monday, October 08, 2007 3:49 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Specify a PRIMARY KEY constraint.

Note: a primary key's field(s) must be unique and not NULL.
You can't have an SQL defined table with a non-unique key


like you can


with a DDS physical.


HTH,
Charles




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Cezary Krzywda
Sent: Monday, October 08, 2007 6:59 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Create table & Create Phisical File

Hello

In DDS I can create key fields using record format "K"

How Can I do it using SQL Create Table ?



Regards

Czarek





--------------------------------------------------------------
----------
Onninen Spolka z o.o.
02-295 Warszawa
ul. Emaliowa 28
NIP: PL5261032852
Nr KRS: 0000036846
Sad Rejonowy dla m.st. Warszawy, XIII Wydzial Krajowego Rejestru
Sadowego Kapital zakladowy: 8.322.000,00 PLN www.onninen.pl

-------------------------------------------
Ta wiadomosc, mogaca zawierac poufne informacje,


przeznaczona jest


wylacznie dla jej adresata. Jakiekolwiek nieautoryzowane


przegladanie,


uzywanie, kopiowanie, przechowywanie, ujawnianie lub


przesylanie tej


wiadomosci i/lub jakichkolwiek jej zalacznikow, jest surowo
wzbronione. Jezeli otrzymali Panstwo te wiadomosc przez pomylke,
prosimy o odeslanie jej nadawcy a nastepnie zniszczenie


wiadomosci.


Opinie i inne informacje zawarte w tej wiadomosci, ktore


nie dotycza


prowadzonej przez Onninen Sp. z o.o. dzialalnosci, powinny byc
traktowane jako zarowno niepochodzace, jak i


nieautoryzowane przez


Onninen Sp. z o.o. Dziekujemy za wspolprace.
-------------------------------------------
This e-mail that may contain privileged and confidential


information


is intended only for the addressee. Any unauthorized review, use,
copying, storage, disclosure or distribution of this


e-mail and any


attachments is strictly prohibited. If you have received


this e-mail


by mistake, please return it to the sender and then destroy the
message.
Opinions or other information in this e-mail that do not


relate to the


official business of Onninen shall be understood to be


neither given


nor endorsed by Onninen. Thank you for your cooperation.
-------------------------------------------
--
This is the RPG programming on the AS400 / iSeries


(RPG400-L) mailing


list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,


please take a


moment to review the archives at


http://archive.midrange.com/rpg400-l.





This e-mail transmission contains information that is


intended to be


confidential and privileged. If you receive this e-mail


and you are


not a named addressee you are hereby notified that you are not
authorized to read, print, retain, copy or disseminate this
communication without the consent of the sender and that


doing so is


prohibited and may be unlawful. Please reply to the message
immediately by informing the sender that the message was


misdirected.


After replying, please delete and otherwise erase it and any
attachments from your computer system. Your assistance in


correcting


this error is appreciated.

--
This is the RPG programming on the AS400 / iSeries


(RPG400-L) mailing


list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,


please take a


moment to review the archives at


http://archive.midrange.com/rpg400-l.


--------------------------------------------------------------
----------
Onninen Sp??ka z o.o.
02-295 Warszawa
ul. Emaliowa 28
NIP: PL5261032852
Nr KRS: 0000036846
S?d Rejonowy dla m.st. Warszawy, XIII Wydzia? Krajowego Rejestru
S?dowego Kapita? zak?adowy: 8.322.000,00 PLN www.onninen.pl

-------------------------------------------
Ta wiadomo??, mog?ca zawiera? poufne informacje, przeznaczona jest
wy??cznie dla jej adresata. Jakiekolwiek nieautoryzowane


przegl?danie,


u?ywanie, kopiowanie, przechowywanie, ujawnianie lub


przesy?anie tej


wiadomo?ci i/lub jakichkolwiek jej za??cznik?w, jest surowo
wzbronione. Je?eli otrzymali Pa?stwo t? wiadomo?? przez pomy?k?,
prosimy o odes?anie jej nadawcy a nast?pnie zniszczenie wiadomo?ci.
Opinie i inne informacje zawarte w tej wiadomo?ci, kt?re


nie dotycz?


prowadzonej przez Onninen Sp. z o.o. dzia?alno?ci, powinny by?
traktowane jako zar?wno niepochodz?ce, jak i nieautoryzowane przez
Onninen Sp. z o.o. Dzi?kujemy za wsp??prac?.
-------------------------------------------
This e-mail that may contain privileged and confidential


information


is intended only for the addressee. Any unauthorized review, use,
copying, storage, disclosure or distribution of this
e-mail and any
attachments is strictly prohibited. If you have received


this e-mail


by mistake, please return it to the sender and then destroy the
message.
Opinions or other information in this e-mail that do not


relate to the


official business of Onninen shall be understood to be


neither given


nor endorsed by Onninen. Thank you for your cooperation.
-------------------------------------------

--
This is the RPG programming on the AS400 / iSeries


(RPG400-L) mailing


list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,


please take a


moment to review the archives at


http://archive.midrange.com/rpg400-l.





This e-mail transmission contains information that is
intended to be
confidential and privileged. If you receive this e-mail
and you are
not a named addressee you are hereby notified that you are not
authorized to read, print, retain, copy or disseminate this
communication without the consent of the sender and that
doing so is
prohibited and may be unlawful. Please reply to the message
immediately by informing the sender that the message was
misdirected.
After replying, please delete and otherwise erase it and any
attachments from your computer system. Your assistance in
correcting
this error is appreciated.

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

--------------------------------------------------------------
----------
Onninen Sp??ka z o.o.
02-295 Warszawa
ul. Emaliowa 28
NIP: PL5261032852
Nr KRS: 0000036846
S?d Rejonowy dla m.st. Warszawy, XIII Wydzia? Krajowego Rejestru
S?dowego Kapita? zak?adowy: 8.322.000,00 PLN www.onninen.pl

-------------------------------------------
Ta wiadomo??, mog?ca zawiera? poufne informacje, przeznaczona jest
wy??cznie dla jej adresata. Jakiekolwiek nieautoryzowane
przegl?danie,
u?ywanie, kopiowanie, przechowywanie, ujawnianie lub
przesy?anie tej
wiadomo?ci i/lub jakichkolwiek jej za??cznik?w, jest surowo
wzbronione. Je?eli otrzymali Pa?stwo t? wiadomo?? przez pomy?k?,
prosimy o odes?anie jej nadawcy a nast?pnie zniszczenie wiadomo?ci.
Opinie i inne informacje zawarte w tej wiadomo?ci, kt?re
nie dotycz?
prowadzonej przez Onninen Sp. z o.o. dzia?alno?ci, powinny by?
traktowane jako zar?wno niepochodz?ce, jak i nieautoryzowane przez
Onninen Sp. z o.o. Dzi?kujemy za wsp??prac?.
-------------------------------------------
This e-mail that may contain privileged and confidential
information
is intended only for the addressee. Any unauthorized review, use,
copying, storage, disclosure or distribution of this e-mail and any
attachments is strictly prohibited. If you have received
this e-mail
by mistake, please return it to the sender and then destroy the
message.
Opinions or other information in this e-mail that do not
relate to the
official business of Onninen shall be understood to be
neither given
nor endorsed by Onninen. Thank you for your cooperation.
-------------------------------------------

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


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

--------------------------------------------------------------
----------
Onninen Sp??ka z o.o.
02-295 Warszawa
ul. Emaliowa 28
NIP: PL5261032852
Nr KRS: 0000036846
S?d Rejonowy dla m.st. Warszawy, XIII Wydzia? Krajowego Rejestru
S?dowego Kapita? zak?adowy: 8.322.000,00 PLN www.onninen.pl

-------------------------------------------
Ta wiadomo??, mog?ca zawiera? poufne informacje, przeznaczona jest
wy??cznie dla jej adresata. Jakiekolwiek nieautoryzowane
przegl?danie,
u?ywanie, kopiowanie, przechowywanie, ujawnianie lub
przesy?anie tej
wiadomo?ci i/lub jakichkolwiek jej za??cznik?w, jest surowo
wzbronione. Je?eli otrzymali Pa?stwo t? wiadomo?? przez pomy?k?,
prosimy o odes?anie jej nadawcy a nast?pnie zniszczenie wiadomo?ci.
Opinie i inne informacje zawarte w tej wiadomo?ci, kt?re
nie dotycz?
prowadzonej przez Onninen Sp. z o.o. dzia?alno?ci, powinny by?
traktowane jako zar?wno niepochodz?ce, jak i nieautoryzowane przez
Onninen Sp. z o.o. Dzi?kujemy za wsp??prac?.
-------------------------------------------
This e-mail that may contain privileged and confidential
information
is intended only for the addressee. Any unauthorized review, use,
copying, storage, disclosure or distribution of this e-mail and any
attachments is strictly prohibited. If you have received
this e-mail
by mistake, please return it to the sender and then destroy the
message.
Opinions or other information in this e-mail that do not
relate to the
official business of Onninen shall be understood to be
neither given
nor endorsed by Onninen. Thank you for your cooperation.
-------------------------------------------

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


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

--------------------------------------------------------------
----------
Onninen Sp??ka z o.o.
02-295 Warszawa
ul. Emaliowa 28
NIP: PL5261032852
Nr KRS: 0000036846
S?d Rejonowy dla m.st. Warszawy, XIII Wydzia? Krajowego
Rejestru S?dowego
Kapita? zak?adowy: 8.322.000,00 PLN
www.onninen.pl

-------------------------------------------
Ta wiadomo??, mog?ca zawiera? poufne informacje, przeznaczona jest
wy??cznie dla jej adresata. Jakiekolwiek nieautoryzowane
przegl?danie,
u?ywanie, kopiowanie, przechowywanie, ujawnianie lub przesy?anie
tej wiadomo?ci i/lub jakichkolwiek jej za??cznik?w, jest surowo
wzbronione. Je?eli otrzymali Pa?stwo t? wiadomo?? przez pomy?k?,
prosimy o odes?anie jej nadawcy a nast?pnie zniszczenie wiadomo?ci.
Opinie i inne informacje zawarte w tej wiadomo?ci, kt?re
nie dotycz?
prowadzonej przez Onninen Sp. z o.o. dzia?alno?ci, powinny by?
traktowane jako zar?wno niepochodz?ce, jak i nieautoryzowane
przez Onninen Sp. z o.o. Dzi?kujemy za wsp??prac?.
-------------------------------------------
This e-mail that may contain privileged and confidential
information
is intended only for the addressee. Any unauthorized review, use,
copying, storage, disclosure or distribution of this e-mail and any
attachments is strictly prohibited. If you have received
this e-mail
by mistake, please return it to the sender and then destroy
the message.
Opinions or other information in this e-mail that do not relate
to the official business of Onninen shall be understood to be
neither given nor endorsed by Onninen. Thank you for your
cooperation.
-------------------------------------------

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






This e-mail transmission contains information that is intended to be
confidential and privileged. If you receive this e-mail and you are
not a named addressee you are hereby notified that you are not
authorized to read, print, retain, copy or disseminate this
communication without the consent of the sender and that doing so is
prohibited and may be unlawful. Please reply to the message
immediately by informing the sender that the message was
misdirected.
After replying, please delete and otherwise erase it and any
attachments from your computer system. Your assistance in
correcting
this error is appreciated.



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







------------------------------

message: 2
date: Mon, 8 Oct 2007 11:33:18 -0700 (PDT)
from: Luis Rodriguez <luis.rodriguez2@xxxxxxxxx>
subject: Re: Create table & Create Phisical File

Czarek,

A SQL index is not usable directly with a SELECT statement.
AFAIK, SELECT can only reference tables and views (LF being
a special type of view). If it makes the table or view
access faster, the DB engine will use the index although
you reference only the Table (or view).

That said, you can use a SQL index with any RPG program,
with the proper op codes (CHAIN, SETLL, etc) and it will
work the same as a "traditional" DDS-defined LF. In fact, a
SQL index has a better performance than a DDS LF.

Hope this helps,

Luis Rodriguez

--- rpg400-l-request@xxxxxxxxxxxx wrote:
----------------------------------------------------------------------

message: 1
date: Mon, 08 Oct 2007 11:18:14 -0300
from: "Raul A. Jager W." <raul@xxxxxxxxxx>
subject: Re: Create table & Create Phisical File

Add the "FROM".
You can't select from an "EVI" index, but the others
options will allow
the select, but the output will not necesarily come
ordered, unless you
use "order by".

Wilt, Charles wrote:

You can't SELECT * IDXFILE

While the index IDXFILE is implemented as an i5/OS
logical file object, and you can normally do a
SELECT * FROM MYLF, when MYLF is a DDS defined logical,
the system does know there is a difference
between a DDS logical and an SQL index.

When using SQL you should _always_ specify the actual
physical file/table (or a view) on the
statement. To provide ordering, add the ORDER BY clause
on your select statement.


HTH,
Charles




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cezary Krzywda
Sent: Monday, October 08, 2007 10:39 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Table1 - PF
Next I prepare index using SQL

Create IDXFILE
CREATE INDEX Lib1/IDXFILE ON Lib1/Table1 (


S08FIR,OS08KLI,OS08GRPR,OS08IDX,OS08KODR,OS08DOS,OS08MT,OS08DATOD)

After that I run sql
Select * From IDXFILE

And I got errors
IDXFILE in Lib1 not table, view, or physical file.

Czarek

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
matt.haas@xxxxxxxxxxx
Sent: Monday, October 08, 2007 4:26 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Create table & Create Phisical File

What did you call the index? Is the library you
specified
during the create in you library list? What's the error
you got?

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cezary Krzywda
Sent: Monday, October 08, 2007 10:25 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

I have run
Select * From IDXFILE
And I had error ?
It seems that INDEX is not the same logical files .
I will try to use INDEX in RPG program
Czarek


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
matt.haas@xxxxxxxxxxx
Sent: Monday, October 08, 2007 4:12 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Create table & Create Phisical File

When you create an index, it can be used just like a
logical
file. All you have to do is specify the name of the
index you
created instead of the base table name in your F specs.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cezary Krzywda
Sent: Monday, October 08, 2007 10:10 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File


So
How Can I use Setll , SetGT .? Should I create index
using
CREATE INDEX in SQL ? But the problem is How can I use
this
index in RPG ?


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Wilt, Charles
Sent: Monday, October 08, 2007 4:00 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Unique?

Then you can't have a key on the SQL table.

Sorry, but that's just the way it works.

Is there no combination of current fields that are
unique?

Even if KEY1,KEY2 aren't unique, if by adding KEY3 you
can
get a unique key into the file, you can add
KEY3 without needing to change any existing programs.

The only other way would be to a an auto-incrementing
field
to the file, but that would require recompiling all
existing
RPG programs.

HTH,

Charles



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cezary Krzywda
Sent: Monday, October 08, 2007 9:57 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

But fields are not uniqual


Pozdrawiam

Cezary Krzywda
Analityk, Dzia? Informatyki/
ICT Analyst, ICT Onninen Sp. z o.o.
Tel. +48 42 6768 877,
Mobile +48 502 19 77 61
Fax. +48 42 6768 800
Teolin 18B, Gmina Nowosolna,
92-701 ??D?
Poland
cezary.krzywda@xxxxxxxxxx
www.onninen.pl


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Wilt, Charles
Sent: Monday, October 08, 2007 3:49 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Create table & Create Phisical File

Specify a PRIMARY KEY constraint.

Note: a primary key's field(s) must be unique and not
NULL.
You can't have an SQL defined table with a non-unique
key


like you can


with a DDS physical.


HTH,
Charles




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cezary Krzywda
Sent: Monday, October 08, 2007 6:59 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Create table & Create Phisical File

Hello

In DDS I can create key fields using record format
"K"

How Can I do it using SQL Create Table ?



Regards

Czarek

<SNIP>

Luis Rodriguez

IBM Certified Systems Expert
eServer i5 iSeries Technical Solutions



______________________________________________________________
______________________
Take the Internet to Go: Yahoo!Go puts the Internet in your
pocket: mail, news, photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC


------------------------------

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



End of RPG400-L Digest, Vol 6, Issue 997
****************************************

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




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.