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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] empty result set

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] empty result set
 Login/Join
 
Platinum Member
posted
Is there any way to get a single blank record returned from a query instead of no records at all? I have some "defines" that I want to appear, even when there are no records that match the WHERE criteria.

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


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Expert
posted Hide Post
Retracted: Try the following, after your DEFINE FILE MyFile:
TABLE FILE MyFile
PRINT REAL_FIELD NOPRINT
DEFINED_FIELD
WHERE RECORDLIMIT EQ 1
END

May I ask: Why do you want to do this? And, can you duplicate this with the CAR File?

This message has been edited. Last edited by: Doug,
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
If there are no records for the define to work on, then you are out of luck.

If you know that you will not have any records, say the previous TABLE FILE produced zero records, then you may be able to -WRITE a blank record to the HOLD file.

TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY EQ 'England'
-*WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS TMP_CTY FORMAT ALPHA
END
-RUN

-IF &LINES GT 0 THEN GOTO NO_PRIME ;
-WRITE TMP_CTY  
-RUN
-NO_PRIME

DEFINE FILE TMP_CTY
 Error/A10 = IF COUNTRY EQ ' ' THEN 'Error' ELSE 'OK' ;
END

TABLE FILE TMP_CTY
PRINT COUNTRY Error
END


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: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Good point Waz...
Confused What was I thinking... Or was I? Which brings me back to my original questions: Why do you want to do this? And, can you duplicate this with the CAR File?

Basically: you need to work with something (as Waz pointed out) even if it's &RECORDS or &LINES...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
MacLonghorn, Are you just testing for No Records Returned? If not, then what do you want to achieve?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
I'm displaying HTML input tags for data entry. When it meets the criteria, there will be a value displayed. But it would be great to be able to handle "new" entries in the same call, maybe by modifying one of these defines?
DEFINE FILE CAR
	CTYFLD/A300 = '<input type="text" name="country" value="'||COUNTRY||'" />';
	CARFLD/A300 = '<input type="text" name="car" value="'||CAR||'" />';
END
TABLE FILE CAR
PRINT
	CTYFLD AS 'Country' OVER
	CARFLD AS 'Car'
WHERE COUNTRY EQ 'ENGLAND' AND CAR EQ 'JAGUAR'
ON TABLE SET PAGE-NUM NOLEAD
END


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Master
posted Hide Post
Mark,

SET EMPTYREPORT=ANSI will help you.

SET EMPTYREPORT=ANSI

TABLE FILE CAR
PRINT 
COUNTRY 
CAR
WHERE COUNTRY EQ 'England_1'
ON TABLE HOLD AS HLD_1 FORMAT ALPHA
END
-RUN
-*? STAT
-*?FF HLD_1
DEFINE FILE HLD_1
	CTYFLD/A300 = '<input type="text" name="country" value="'||COUNTRY||'" />';
	CARFLD/A300 = '<input type="text" name="car" value="'||CAR||'" />';
END
TABLE FILE HLD_1
PRINT
	CTYFLD AS 'Country' OVER
	CARFLD AS 'Car'
ON TABLE SET PAGE-NUM NOLEAD
END
-EXIT

 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Expert
posted Hide Post
Awsome, I'd forgotten about that one.


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: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
SET EMPTYREPORT = ON


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Platinum Member
posted Hide Post
Ram Prasad E and AlexU:
Yeah! Awesome! I know there are other, more inefficient ways of doing what I wanted, but I didn't want to have to duplicate a bunch of code just for a blank set of fields. Thanks a ton.


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
<JG>
posted
ON will not produce what is required it has to be ANSI if you want an empty data row returned
 
Report 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     [SOLVED] empty result set

Copyright © 1996-2020 Information Builders