-
Dateiübersicht aus Query
Hallo Zusammen,
kennt jemand eine Möglichkeit eine Übersicht aller in Queries verwendeten Dateien zu bekommen? Hintergrund ist eine Datenbankerweiterung, die in Folge auch eine Anpassung der Queries nötig macht.
Vielen Dank für Eure Mithilfe
-
Ja, es gibt ein kommerzielles Tool von der Firma Syntax (SSS-Software, Weyhe), was genau diese Infos liefert.
Ich glaube aber auch mal irgendwo ein Freeware-Tool gesehen zu haben. Ich frage dazu noch mal einen Kollegen. Wenn ich noch was rausfinde poste ich es hier.
Gruß
Jörg
-
Leider gibt es hierzu keine direkten Befehle. Der Weg ist etwas mühselig könnte aber folgendermaßen aussehen (SQL ist allerdings Voraussetzung):
Mittels DSPBOBJD alle *QRYDFN in eine Dateiliste ausgeben.
Für jeden Eintrag den Befehl RTVSQLSRC ausführen (dieser Befehl erstellt eine Quelle mit dem vollständige Select-Befehl).
Mittels Programm die Quellen dann analysieren und die Dateien aus der From-Klausel entnehmen.
-
Danke für den Tip.
Leider kann ich den Befehl RTVSQLSRC nicht einordnen.
-
Entschuldigung, der Befehl heißt:
QSYS/RTVQMQRY QMQRY(LIB/QUERY)
SRCFILE(SRCLIB/QSQLSRC)
ALWQRYDFN(*YES)
-
Das Freeware-Tool heißt RTVQRYF und ist ein kleines MI Programm, das für die Parameter qryName, qryLib eine Struktur aller Inputfiles und - soweit vorhanden - der Ausgabedatei zurückgibt. Hat in meinem Fall zuverlässig funktioniert. Leider habe ich die Adresse auch nicht mehr, kann aber bei Bedarf das Objekt zumailen.
Gruß
Torsten
-
hallo thorsten,
da wäre ich sehr dankbar für:
bertelduck@hotmail.com
-
Mit dem Befehl DSPPGMREF und Ausgabe in eine Datei erhalten Sie eine Übersicht aller in einem Programm verwendeten Objekte (Dateien, DATARA, DSPF, PRTF, ...) Dies gilt auch für Query- und DFU-Programme.
m.f.G.
Otto zehetner
-
das gilt zumindest ganz sicher nicht für Queries !!
MfG Günther
-
Ich bin auch an Freewareprogramm RTVQRYF interessiert! Wenn es nicht zuviel Mühe macht, bitte mir auch zusenden! swen.watzlawzyk@rehau.com
Gruß
Watzl
-
Hier der Source-Code für RTVQRYF:
*================================================= ===============
* This program creates MI program RTVQRYF in library QGPL. The =
* program can be moved from library QGPL to any library you =
* choose =
* =
* The source statements for the MI program are found in array =
* MI. Look at comments in the MI source for information on the =
* parameters you need to pass when calling the RTVQRYF utility. =
*================================================= ===============
E MI 1 285 80
I DS
I B 1 40#SRCLN
I I 'RTVQRYF QGPL' 5 24 #PGMLB
I 25 74 #TEXT
I I 'QMISRC QGPL' 75 94 #SRCFL
I I 'RTVQRYF' 95 104 #MBR
I 105 117 #CHGDT
I 105 105 #CENT
I 106 107 #YY
I 108 111 #MMDD
I 112 117 #HMS
I 118 137 #PRTFL
I B 138 1410#STRPG
I 142 151 #AUT
I 152 327 #OP
I B 328 3310#NOOPT
I DS
I 1 120TIMDAT
I 1 6 HHMMSS
I 7 10 MMDD
I 11 12 YY
C TIME TIMDAT
C MOVELMMDD DD 2
C MOVE MMDD MM 2
C MOVELMM MMDD
C MOVE DD MMDD
C MOVE '1' #CENT
C MOVE YY #YY
C MOVE MMDD #MMDD
C MOVE HHMMSS #HMS
C CALL 'QPRCRTPG'
C PARM MI
C PARM 21920 #SRCLN
C PARM #PGMLB
C PARM ' ' #TEXT
C PARM #SRCFL
C PARM #MBR
C PARM #CHGDT
C PARM ' ' #PRTFL
C PARM 0 #STRPG
C PARM '*USE' #AUT
C PARM ' ' #OP
C PARM 0 #NOOPT
C MOVE *ON *INLR
**
/*================================================= ==================*/
/* Program....... RTVQRYF */
/* Description... Retrieve list of files used by query */
/* --------------------------------------------------------------- */
/* Parameter description Type Length */
/* */
/* Query name (required) Character 10 */
/* Library containing query (Name required) Character 10 */
/* Input file list structure Character 1280 */
/* */
/* The 1280 byte file list structure is used */
/* to return the list of files used as input to */
/* the query. The strucure is a 32 element */
/* array of 40 bytes. The format is a 10 byte */
/* file name, 10 byte library name, 10 byte */
/* member name and 10 byte record format name. */
/* The member name could be returned as special */
/* value *FIRST, in which case you must */
/* retrieve specific member name information */
/* if needed. */
/* */
/* Output file structure Character 30 */
/* */
/* The 30 byte output file structure is used */
/* to return the output file of the query. */
/* The format is a 10 byte file name, 10 byte */
/* library name and 10 byte member name. The */
/* member name could be returned as special */
/* value *FIRST or *FILE, in which case you */
/* must retrieve the specific member name */
/* information if needed. If the query does */
/* not produce an output file, special value */
/* *NONE will be returned at the beginning */
/* of the structure. If the output file is */
/* the default QQRYOUT, special value *DFT */
/* will be returned at the beginning of */
/* the structure. */
/* */
/* Return code (0=Normal, 1=Abend) Character 1 */
/*================================================= ==================*/
ENTRY *(ENTRY_PLIST) EXT ;
/*================================================= ==================*/
/* Entry parameters */
/*================================================= ==================*/
DCL SPCPTR Query@
PARM ;
DCL DD Query
CHAR(10)
BAS(Query@) ;
DCL SPCPTR Query_Library@
PARM ;
DCL DD Query_Library
CHAR(10)
BAS(Query_Library@) ;
DCL SPCPTR Query_Input_Files@
PARM ;
DCL DD Query_Input_Files
CHAR(1280)
BAS(Query_Input_Files@) ;
DCL SPCPTR Query_Output_File@
PARM ;
DCL DD Query_Output_File
CHAR(30)
BAS(Query_Output_File@) ;
DCL SPCPTR Return_Code@
PARM ;
DCL DD Return_Code
CHAR(1)
BAS(Return_Code@) ;
DCL OL ENTRY_PLIST(Query@,
Query_Library@,
Query_Input_Files@,
Query_Output_File@,
Return_Code@)
PARM
EXT
MIN(5) ;
/*================================================= ==================*/
/* System pointers for library and query definition */
/*================================================= ==================*/
DCL SYSPTR Library# ;
DCL SYSPTR Query# ;
/*================================================= ==================*/
/* Query definition data */
/*================================================= ==================*/
DCL SPCPTR Query_Data@ ;
DCL SPCPTR Query_Number_Input_Files@ ;
DCL DD Query_Number_Input_Files
BIN(2)
BAS(Query_Number_Input_Files@) ;
/*================================================= ==================*/
/* Template for system pointer resolution */
/*================================================= ==================*/
DCL DD Object
CHAR(34) ;
DCL DD Object_Type
CHAR(2)
DEF(Object)
POS(1) ;
DCL DD Object_Name
CHAR(30)
DEF(Object)
POS(3) ;
DCL DD Object_Authority
CHAR(2)
DEF(Object)
POS(33)
INIT(X'0000') ;
/*================================================= ==================*/
/* Template for query definition input file */
/*================================================= ==================*/
DCL SPCPTR Query_Input_Files_Template@ ;
DCL DD Query_Input_Files_Template
CHAR(80)
BAS(Query_Input_Files_Template@) ;
DCL DD Query_Input_Files_Template_File_Name
CHAR(10)
DEF(Query_Input_Files_Template)
POS(3) ;
DCL DD Query_Input_Files_Template_Library_Name
CHAR(10)
DEF(Query_Input_Files_Template)
POS(15) ;
DCL DD Query_Input_Files_Template_Member_Name
CHAR(10)
DEF(Query_Input_Files_Template)
POS(27) ;
DCL DD Query_Input_Files_Template_Format_Name
CHAR(10)
DEF(Query_Input_Files_Template)
POS(39) ;
/*================================================= ==================*/
/* Template for query definition output file */
/*================================================= ==================*/
DCL SPCPTR Query_Output_File_Template@ ;
DCL DD Query_Output_File_Template
CHAR(112)
BAS(Query_Output_File_Template@) ;
DCL DD Query_Output_File_Template_File_Name
CHAR(10)
DEF(Query_Output_File_Template)
POS(5) ;
DCL DD Query_Output_File_Template_Library_Name
CHAR(10)
DEF(Query_Output_File_Template)
POS(17) ;
DCL DD Query_Output_File_Template_Member_Name
CHAR(10)
DEF(Query_Output_File_Template)
POS(29) ;
/*================================================= ==================*/
/* Work variables */
/*================================================= ==================*/
DCL DD Next_File_Offset
BIN(2)
AUTO ;
DCL DD Query_Number_Input_Files_Work
BIN(2) ;
DCL SPCPTR Query_Data_Offset@ ;
DCL DD Query_Data_Offset
BIN(4)
BAS(Query_Data_Offset@) ;
DCL SPCPTR Query_Output_Type@ ;
DCL DD Query_Output_Type
CHAR(1)
BAS(Query_Output_Type@) ;
/*================================================= ==================*/
/* Exception monitor */
/*================================================= ==================*/
DCL EXCM *
EXCID(H'0000')
BP(.Exit) ;
/*================================================= ==================*/
/* Default to error condition */
/*================================================= ==================*/
CPYBLA Return_Code,'1' ;
/*================================================= ==================*/
/* Initialize input files structure to blanks */
/*================================================= ==================*/
CPYBREP Query_Input_Files,' ' ;
/*================================================= ==================*/
/* Initialize output file name to blanks */
/*================================================= ==================*/
CPYBREP Query_Output_File,' ' ;
/*================================================= ==================*/
/* Resolve pointer to library */
/*================================================= ==================*/
CPYBLA Object_Type,X'0401' ;
CPYBLAP Object_Name,Query_Library,' ' ;
RSLVSP Library#,Object,*,* ;
/*================================================= ==================*/
/* Resolve pointer to query definition */
/*================================================= ==================*/
CPYBLA Object_Type,X'1911' ;
CPYBLAP Object_Name,Query,' ' ;
RSLVSP Query#,Object,Library#,* ;
/*================================================= ==================*/
/* Point to beginning of associated space for query definition */
/*================================================= ==================*/
SETSPPFP Query_Data@,Query# ;
/*================================================= ==================*/
/* Check for output file */
/*================================================= ==================*/
SETSPPO Query_Data@,260 ;
CPYBWP Query_Output_Type@,Query_Data@ ;
CMPBLA(B) Query_Output_Type,'3'/NEQ(.No_Output_File) ;
/*================================================= ==================*/
/* Retrieve offset to output file */
/*================================================= ==================*/
SETSPPO Query_Data@,380 ;
/*================================================= ==================*/
/* Point to beginning of output file template area */
/*================================================= ==================*/
CPYBWP Query_Data_Offset@,Query_Data@ ;
CMPBLA(B) Query_Data_Offset,
X'00000000'/EQ(.Dft_Output_File) ;
SETSPPO Query_Data@,Query_Data_Offset ;
CPYBWP Query_Output_File_Template@,Query_Data@ ;
CPYBLA Query_Output_File(1:10),
Query_Output_File_Template_File_Name ;
CPYBLA Query_Output_File(11:10),
Query_Output_File_Template_Library_Name ;
CPYBLA Query_Output_File(21:10),
Query_Output_File_Template_Member_Name ;
B .Get_Input_Files ;
/*================================================= ==================*/
/* Query does not have an outfile */
/*================================================= ==================*/
.No_Output_File: ;
CPYBLA Query_Output_File,'*NONE' ;
B .Get_Input_Files ;
/*================================================= ==================*/
/* Query uses default outfile */
/*================================================= ==================*/
.Dft_Output_File: ;
CPYBLA Query_Output_File,'*DFT' ;
/*================================================= ==================*/
/* Retrieve offset to number of files used as input to query */
/*================================================= ==================*/
.Get_Input_Files: ;
SETSPPO Query_Data@,558 ;
/*================================================= ==================*/
/* Retrieve number of files used as input to query */
/*================================================= ==================*/
CPYBWP Query_Number_Input_Files@,Query_Data@ ;
CPYNV Query_Number_Input_Files_Work,
Query_Number_Input_Files ;
/*================================================= ==================*/
/* Point to beginning of input file list */
/*================================================= ==================*/
/*================================================= ==================*/
.Dft_Output_File: ;
CPYBLA Query_Output_File,'*DFT' ;
/*================================================= ==================*/
/* Retrieve offset to number of files used as input to query */
/*================================================= ==================*/
.Get_Input_Files: ;
SETSPPO Query_Data@,558 ;
/*================================================= ==================*/
/* Retrieve number of files used as input to query */
/*================================================= ==================*/
CPYBWP Query_Number_Input_Files@,Query_Data@ ;
CPYNV Query_Number_Input_Files_Work,
Query_Number_Input_Files ;
/*================================================= ==================*/
/* Point to beginning of input file list */
/*================================================= ==================*/
SETSPPO Query_Data@,560 ;
/*================================================= ==================*/
/* Loop through list of input files */
/*================================================= ==================*/
CPYNV Next_File_Offset,1 ;
.Loop01: ;
CMPNV(B) Query_Number_Input_Files_Work,0/EQ(.End01) ;
CPYBWP Query_Input_Files_Template@,Query_Data@ ;
CPYBLA Query_Input_Files(Next_File_Offset:10),
Query_Input_Files_Template_File_Name ;
ADDN(S) Next_File_Offset,10 ;
CPYBLA Query_Input_Files(Next_File_Offset:10),
Query_Input_Files_Template_Library_Name ;
ADDN(S) Next_File_Offset,10 ;
CPYBLA Query_Input_Files(Next_File_Offset:10),
Query_Input_Files_Template_Member_Name ;
ADDN(S) Next_File_Offset,10 ;
CPYBLA Query_Input_Files(Next_File_Offset:10),
Query_Input_Files_Template_Format_Name ;
ADDN(S) Next_File_Offset,10 ;
SUBN(S) Query_Number_Input_Files_Work,1 ;
ADDSPP Query_Data@,Query_Data@,80 ;
B .Loop01 ;
.End01: ;
/*================================================= ==================*/
/* Set normal return code */
/*================================================= ==================*/
CPYBLA Return_Code,'0' ;
.Exit: ;
DEACTPG * ;
RTX * ;
/*================================================= ==================*/
/* End of program return */
/*================================================= ==================*/
/*'/*'/*"/*"*/; PEND;;;
-
Hi, ich jkann Dir ein absolutes Suptertool vorschlagen, daß ich bei der entwicklung unterstützt habe. Wird jetzt bei ********* unter Query-Optimizer angeboten. Deine Frage nach Dateien ist nur ein kleiner Punkt der Möglichkeiten. Ruf einfach mal ********* auf und schau Dir diese Tool an.
Viel Spaß
Max
Similar Threads
-
By Frank Ziegler in forum IBM i Hauptforum
Antworten: 14
Letzter Beitrag: 10-12-06, 10:21
-
By Kaufmann in forum IBM i Hauptforum
Antworten: 6
Letzter Beitrag: 29-11-06, 18:07
-
By Azubiiiiii in forum IBM i Hauptforum
Antworten: 6
Letzter Beitrag: 03-08-06, 09:44
-
By Hubert Brethauer in forum IBM i Hauptforum
Antworten: 6
Letzter Beitrag: 05-05-06, 12:37
-
By antonkuh in forum IBM i Hauptforum
Antworten: 1
Letzter Beitrag: 24-04-06, 10:37
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks