Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SLOVED]how to use &LINES ?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SLOVED]how to use &LINES ?
 Login/Join
 
Gold member
posted
when i try to this

  

ENGINE SQLMSS SET DEFAULT_CONNECTION CON01
SQL SQLMSS PREPARE SQLOUT FOR
SELECT * from table where field_flag='Y1';
END
-RUN
-IF &LINES EQ 0 GOTO MSG;

TABLE FILE SQLOUT
PRINT *
END
-RUN

-*-SET &LINES=0;
SQL SQLMSS PREPARE SQLOUT FOR
SELECT * from table where field_flag='Y2';
END
-RUN
-IF &LINES  GOTO MSG;

TABLE FILE SQLOUT
PRINT *
END
-RUN


-MSG




if the 1st select result count > 1 and the 2nd select result count =0,
the top code(the 2nd &LINES always >1 ) ,if I SET &LINES=0 , the 2nd &LINES always =0 ,
how can i get the &LINES well?

Thanks,
James

This message has been edited. Last edited by: Yangyang,


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
 
Posts: 97 | Registered: August 18, 2009Report This Post
Expert
posted Hide Post
My guess is that &LINES is not being set if there are 0 records returned from the second SELECT.

Whats also interesting is that I always get 0, and only get &LINES set if I don'y use PREPARE SQLOUT FOR.

-*new file
-SET &ECHO=ALL;

SQL SQLMSS
SELECT * FROM sys.all_objects
WHERE name LIKE 'all%' ;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TMP_OUT
END
-RUN
-TYPE 1st LINES: &LINES

-RUN
-IF &LINES EQ 0 GOTO MSG;

-*TABLE FILE TMP_OUT
-*PRINT *
-*END
-*-RUN

SQL SQLMSS PREPARE SQLOUT FOR
SELECT * FROM sys.all_objects
WHERE name LIKE 'ALL%' ;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TMP_OUT2
END
-RUN
-TYPE 2nd LINES: &LINES
-IF &LINES GT 0 GOTO MSG;

-*TABLE FILE SQLOUT
-*PRINT *
-*END
-*-RUN

-MSG


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
thanks Waz,
I try to do this , It's work Smiler

you mean put the -IF &LINES GT 0 GOTO MSG;

before the below code ?

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS TMP_OUT2
END
-RUN

Thanks,
James


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
 
Posts: 97 | Registered: August 18, 2009Report This Post
Expert
posted Hide Post
quote:
you mean put the -IF &LINES GT 0 GOTO MSG


Its jsut left over from my initial testing.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
thanks Waz Smiler


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
 
Posts: 97 | Registered: August 18, 2009Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SLOVED]how to use &LINES ?

Copyright © 1996-2020 Information Builders