Skip to content

Commit 25cbf98

Browse files
committed
Add page size info to doc; add INDEX on WQ
1 parent 8b731b0 commit 25cbf98

File tree

8 files changed

+23
-5
lines changed

8 files changed

+23
-5
lines changed

bin/aix/convH

0 Bytes
Binary file not shown.

bin/aix/mqsmfcsv

663 Bytes
Binary file not shown.

bin/linux/mqsmfcsv

52 Bytes
Binary file not shown.

bin/win/mqsmfcsv.exe

1 KB
Binary file not shown.

mqsmfcsv.doc

-4.5 KB
Binary file not shown.

src/mqsmf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ extern void printWTAS (wtas *);
152152
extern void printWTID (wtid *, unsigned char *);
153153

154154
extern void openDDL (char *);
155-
extern void closeDDL (void);
155+
extern void closeDDL (char *);
156156
extern void printDDL (char *,int, int);
157+
extern void setIndex (char *);
157158

158159

159160
/*******************************************************/
@@ -381,6 +382,7 @@ extern char *strCfStatType (int v);
381382
#define SMFPRINTSTART(n,p,l) \
382383
int offsetH=0; \
383384
int offsetD=0; \
385+
char *tableName = n; \
384386
if (debugLevel >=1 ) printDEBUG(n,p,(l));\
385387
if (first) { \
386388
fp = fopencsv(n,&newFile);\
@@ -400,7 +402,7 @@ extern char *strCfStatType (int v);
400402
fprintf(fp,"\n"); \
401403
} \
402404
if(first && sqlMode) \
403-
closeDDL(); \
405+
closeDDL(tableName); \
404406
first=FALSE; \
405407
fprintf(fp,"%s",dataline);\
406408
fprintf(fp,"\n")

src/printWQ.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void printWQ(wq *p)
3838
ADDSTRB ("Correlation" ,p->correl, 16);
3939
ADDSTREN("Open_Name",p->objname,48);
4040
ADDSTREN("Base_Name",p->basename,48);
41+
setIndex("Base_Name");
4142
ADDTIME ("Open" ,p->opentime);
4243
ADDTIME ("Close" ,p->clostime);
4344

src/smfDDL.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
static FILE *fp = NULL;
1919
char *comma = "";
2020

21+
char *primaryKey = NULL;
22+
2123
#define COL_HEAD_LEN (64)
2224

2325
static char *format(char *);
2426

2527
void openDDL(char *name)
2628
{
2729
BOOL newFile;
30+
31+
primaryKey = NULL;
2832
if (!fp)
2933
{
3034
fp = fopenext("MQTABLES","ddl", &newFile);
@@ -38,21 +42,32 @@ void openDDL(char *name)
3842
comma = " "; /* Start with it blank */
3943
}
4044

41-
void closeDDL(void)
45+
void closeDDL(char *name)
4246
{
4347
if (fp)
4448
{
45-
fprintf(fp,");\n\n");
49+
fprintf(fp,");\n");
50+
if (primaryKey) {
51+
fprintf(fp,"CREATE INDEX %s ON MQSMF.%s(%s);\n",primaryKey,name,primaryKey);
52+
}
53+
fprintf(fp,"\n");
4654
fflush(fp);
4755
}
4856
return;
4957
}
5058

59+
void setIndex(char *key)
60+
{
61+
primaryKey = key;
62+
return;
63+
}
64+
65+
5166
void printDDL(char *name, int type, int len)
5267
{
5368
char *p;
5469
char *p2;
55-
char nameCopy[COL_HEAD_LEN]; /* Cannot modify fixed strings, have to copy input*/
70+
char nameCopy[COL_HEAD_LEN] = {0}; /* Cannot modify fixed strings, have to copy input*/
5671

5772
if (!fp)
5873
return;

0 commit comments

Comments
 (0)