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




Thank you very much. My program working. I have used index file like
logical file.

Czarek

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Rodriguez
Sent: Monday, October 08, 2007 8:33 PM
To: RpgMidrange
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




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.