Qdesign enhancement - Required Secondary file

Joe Boyle atla38 at dsl.pipex.com
Wed Jun 6 17:13:00 CDT 2007


I got so bored with getting quiz/qtp to process sql calls which relied on
program variables, that I resorted to using quiz to write a second quiz/qtp
with the literals contained in the program variables substituted explicitly
into the source code and then ran from source using go ! e.g below,

 

type do_puzzle_len4.qzs

 

EXE puzl_len4_1curs_p1

EXE puzl_len4_1curs_p2

USE puzl_len4_1curs_QZS.TXT

rev puzl_len4_1curs_p.txt nouse

 

type puzl_len4_1curs_p1.qzs

 

can cle

 

set rep lim 1

 

set veri err

 

define p_b1 char*8 = parm

define p_b2 char*8 = parm

define p_c1 char*8 = parm

define p_c2 char*8 = parm

define p_d1 char*8 = parm

define p_d2 char*8 = parm

define p_e1 char*8 = parm

define p_e2 char*8 = parm

 

 

define p_bl int*4 = size ( trunc (p_b1) + trunc ( p_b2 ) ) + 1

define p_cl int*4 =  size ( trunc (p_c1) + trunc ( p_c2 ) ) + 1

define p_dl int*4 =  size ( trunc (p_d1) + trunc ( p_d2 ) ) + 1

define p_el int*4 =  size ( trunc (p_e1) + trunc ( p_e2 ) ) + 1

 

 

set sub name puzl_len4_1curs_p keep

rep summ all

 

bui   puzl_len4_1curs_p1

 

 

can cle

 

set rep nolim

 

set veri err

 

SET PAG LEN 0 WID 110 IMAGES 1

 

set rep dev dis name puzl_len4_1curs_QZS SPACING 0

 

SET NOHEAD

 

ACC * puzl_len4_1curs_p ;link to f1

 

;sort on word of f1

 

DEFINE D_p_b1 CHAR* 10 = "'" + TRUNCATE (p_b1) + "'"

DEFINE D_p_b2 CHAR* 10 = "'" + TRUNCATE (p_b2) + "'"

 

DEFINE D_p_C1 CHAR* 10 = "'" + TRUNCATE (p_C1) + "'"

DEFINE D_p_C2 CHAR* 10 = "'" + TRUNCATE (p_C2) + "'"

 

DEFINE D_p_D1 CHAR* 10 = "'" + TRUNCATE (p_D1) + "'"

DEFINE D_p_D2 CHAR* 10 = "'" + TRUNCATE (p_D2) + "'"

 

DEFINE D_p_E1 CHAR* 10 = "'" + TRUNCATE (p_E1) + "'"

DEFINE D_p_E2 CHAR* 10 = "'" + TRUNCATE (p_E2) + "'"

 

 

rep &

"can cle" SKIP 2 &

"set rep nolim" SKIP 2 &

"set veri err" SKIP 2 &

"SET PAG LEN 0 WID 12 IMAGES 8 " SKIP 2 &

"set rep dev dis name puzl_len4_1curs_p" SKIP 2 &

"sql in  sqlex2 declare f1 cursor for  select a.word from word_list a where
word_length = 4 &" SKIP  &

"and exists &" SKIP  &

"(select b.word from word_list b where b.word_length = " p_bL " & " SKIP  &

"and b.word = " D_p_b1 " || substring ( a.word from 1 for 1 ) || " D_p_b2 "
) &" SKIP  &

"and exists &" SKIP  &

"(select C.word from word_list C where C.word_length = " p_CL " & " SKIP  &

"and C.word = " D_p_C1 " || substring ( a.word from 2 for 1 ) || " D_p_C2 "
) &" SKIP  &

"and exists &" SKIP  &

"(select D.word from word_list D where D.word_length = " p_DL " & " SKIP  &

"and D.word = " D_p_D1 " || substring ( a.word from 3 for 1 ) || " D_p_D2 "
) &" SKIP  &

"and exists &" SKIP  &

"(select E.word from word_list E where E.word_length = " p_EL " & " SKIP  &

"and E.word = " D_p_E1 " || substring ( a.word from 4 for 1 ) || " D_p_E2 "
) " SKIP  &

"ACC F1" SKIP 2 &

"DEFINE D-WORD CHAR * 10 = WORD OF F1" SKIP 2 &

"SORT ON D-WORD" SKIP 2 &

"REP D-WORD" SKIP 2 &

"GO" SKIP 2

 

bui puzl_len4_1curs_p2

 

Admittedly I was working from home at the time, and profoundly bored; any
guesses at to what this does ?

 

  _____  

From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
Darren Reely - Lists
Sent: 06 June 2007 22:30
To: Deskin, Bob
Cc: powerh-l at lists.sowder.com
Subject: Re: Qdesign enhancement - Required Secondary file

 

 

On Jun 6, 2007, at 12:51 PM, Deskin, Bob wrote:





I understand that you'd like to use a common set of functions, but we were
there first :-)

 

LOL.

 





Seriously, are there SQL functions that don't have PowerHouse equivalents?
Keep in mind that we're not using pure SQL but a Cognos version of it. Our
middleware must allow the functions and then passes them on to the database.

 

Oracle's DECODE() comes to mind. In one case I had to use UNION to 'TRICK'
Quick into the result I was looking for. The cost & time of the transaction
was much higher as a result.

 





I'd like to make sure I understand the passed in values request. Can you
elaborate?

 

To not have to rewrite a screen twice, several screens I've maintained or
written over the last several years have the ability to have a value(s)
passed to them that automatically fetches the data when the passed values
have content.

 

The case is that from a menu or other screen, the user may want to use a
common screen. Calling from a menu we would not likely have a lookup value,
but the user can supply one on the called screen. Calling from another data
screen with content displayed, we could call the second screen with a value
and have the data immediately displayed (and limited to that data). The
second screen in question may just be a view only screen or a full fledged
editing screen. That part isn't relevant.

 

In the input request procedure we would have some code something like this.

 

if NOT passedValue IS NULL ::<<Another pet peeve, IS NOT NULL should be
proper here.

then let path = 1

else

request ...

 

Then of course we need custom find procedures.

 





As for the left hand functions, that's because of the way our parser was
designed (>25 years ago). A few years ago, we looked at it again but found
that it got confused if we allowed expressions on the left. And at this
point, we don't want to introduce something new at that fundamental a level
and risk stability.

CSV is still on the table but don't hold your breath. One of the reasons for
the dearth of QUIZ enhancements is the prevalence of reporting options from
relational databases. Also, we are constrained by the architecture.

 

Sounds to me like the architecture needs an update. ;)

 

The left hand function problem is a pain in the rare. Powerhouse is the only
language I'm aware of with this limitation.

 

CSV is on my mind because of my experience with it this past year.

 

Here is a thought. If Cognos is not going to add to Quiz, they should give
free developer licenses for ReportNet to their payed up clients. Start
encouraging them to move to something more current and announce an end date
for Quiz support.

 





By the way, it's easy to output a pdf report in QUIZ for Windows. Simply get
hold of one of the pdf printer drivers, such as PDFCreator at
sourceforge.org, and use it in the string following SET REPORT DEVICE
PRINTER.

 

What percentage of Quiz developers use Windows?

 

Darren

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20070606/d81487fa/attachment-0001.html


More information about the powerh-l mailing list