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     Can you create a temp table?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Can you create a temp table?
 Login/Join
 
Gold member
posted
Can you create a temp table in WF
Something like

Define File TempTable
BR/A45 = &InBR
END

Now use the TempTable and BR field

Table File TempTable
Print BR
bal bal
All I'm doing is print out what the user is sending in through a input parameter. Can this be done?
 
Posts: 72 | Registered: April 03, 2006Report This Post
Platinum Member
posted Hide Post
Is this just for testing and debugging? If so, would using -TYPE accomplish what you need?

-TYPE &InBR
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Gold member
posted Hide Post
This will be more for production. I'm figuring I can use this approach to show the first report of 3 compound reports(excel and pdf). The first is the front page and it will display the user input. The subsequent reports will print with the data coming back from a sql stored proc. The issue I have is if I tie the first report to a result set and that result set comes back empty then the front page will not show. I need the front page to show always.
 
Posts: 72 | Registered: April 03, 2006Report This Post
Guru
posted Hide Post
Let me see if I can explain this right.
Try following the below steps and see if this is what you want.

1) Running the following code will place data into an edapath (appath) folder.
FILEDEF TESTCAR DISK C:\ibi\apps\baseapp\testcar.ftm
TABLE FILE CAR
SUM
     RETAIL_COST
     DEALER_COST
BY
     COUNTRY
BY
     CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TESTCAR FORMAT ALPHA
END
-RUN


2) You will need to create a master file for the data you placed on the edapath.
FILENAME=TESTCAR,	SUFFIX=FIX
FIELDNAME=COUNTRY,	COUNTRY,	A10,$
FIELDNAME=CAR,		CAR,		A16,$
FIELDNAME=DEALER_COST,	DEALER_COST,	D7,$
FIELDNAME=RETAIL_COST,	RETAIL_COST,	D7,$


3) Then you will need to be able to read the data you placed on the edapath.
FILEDEF HOLDMAST DIR C:\ibi\apps\baseapp\
FILEDEF TESTCAR DISK C:\ibi\apps\baseapp\testcar.ftm
-RUN

TABLE FILE TESTCAR
PRINT *
END
-RUN
FILEDEF HOLDMAST CLEAR
-RUN


I hope this will give you some ideas.
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Platinum Member
posted Hide Post
Can you turn EMPTYREPORT on and make the user supplied parms a report heading?
Example with the infamous car file:

SET EMPTYREPORT=ON
-DEFAULT &FIELD1 = 'CAR';
-DEFAULT &FIELD2 = 'MODEL';
TABLE FILE CAR
ON TABLE PAGE-BREAK AND SUBHEAD
"Fields selected: &FIELD1"
"&FIELD2"
"More fields... etc. PRINT &FIELD1 &FIELD2
BY COUNTRY
WHERE COUNTRY EQ 'MONKEY'
ON COUNTRY PAGE-BREAK
ON TABLE PCHOLD FORMAT PDF
END

You'd need to tweak this but it might get you started...
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Gold member
posted Hide Post
Architecturally you need to create a physical table, define it and then populate it. Is there some way to do it in memory?
 
Posts: 72 | Registered: April 03, 2006Report This Post
Guru
posted Hide Post
If you are running on an Oracle db you could do some like this:

-SET &VAR00 = 'HI';
-SET &VAR01 = 'BYE';
-RUN

SQL SQLORA
SELECT
'&VAR00' var00,'&VAR01' var01
FROM
  dual
;
TABLE
ON TABLE HOLD AS H0 ALPHA
END
-RUN
TABLE FILE H0
PRINT *
END
-RUN
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Expert
posted Hide Post
rc,

This is a piece of code that I use occasionally to generate the contents for a combo box when I need to "invent" data. The basic principle is creating a dummy file that resides only in the EDATEMP folder and, providing you don't have TEMPERASE=OFF, the file will be deleted when the agent process ends.

APP FI mcgyver DISK mcgyver.MAS
-RUN
-WRITE mcgyver FILE=mcgyver,SUFFIX=FOC
-WRITE mcgyver SEGNAME=SEG1
-WRITE mcgyver FIELD=DATA_KEY,,I9,I4,$
-RUN
USE mcgyver.FOC NEW
END
-RUN
CREATE FILE mcgyver
-RUN
MODIFY FILE mcgyver
FIXFORM DATA_KEY/A9
MATCH DATA_KEY
  ON NOMATCH INCLUDE
DATA
        1
        2
        3
        4
        5
        6
        7
        8
END
-RUN
DEFINE FILE mcgyver
  DISPLAY/A15 = DECODE DATA_KEY(1 'Display Value 1' 2 'Display Value 2' 3 'Display Value 3'
                                4 'Display Value 4' 5 'Display Value 5' 6 'Display Value 6'
                                7 'Display Value 7' 8 'Display Value 8' ELSE 'FOC_NONE');
END
TABLE FILE mcgyver
PRINT DISPLAY
BY DATA_KEY
ON TABLE PCHOLD FORMAT XML
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
I'm on MS SQL 2k the same possible?
 
Posts: 72 | Registered: April 03, 2006Report This Post
Expert
posted Hide Post
rc,

Yes, as all that this is doing is creating a FOCUS database in EDATEMP.

If you really mean "can I do this in MS SQL" then the answer is dependant upon the write perissions you have to the database to which you are connecting, plus create authority etc.

Basically you would perform SQL passthru to create the table with the specifications and then use INSERT to add the necessary rows of data.

HOWEVER, this does not create a temporary table and it will need to be deleted at the end of your process.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
I would prefer not to have to go to those lengths. But if I have to I will, not yet as familiar with Focus to know it’s limitations.
If you’re familiar with any of these terms you'll know what I ultimately want to do in Focus.
SQL #temp table of type temp. A table that only exists in memory
VB.net table object. Only exist in memory not on the physical database
VB 6 or VBA recordset. Only exist in memory and is derived most of the time from the result of an SQL query.
Looking for a similar construct in Focus. An object that I can be populated with records and used and then discarded as soon as the procedure is done executing.
The most basic concept is a two dimensional array that can be populated used and discarded.


I hope this helps.

This message has been edited. Last edited by: rc,
 
Posts: 72 | Registered: April 03, 2006Report This Post
Virtuoso
posted Hide Post
You can also do a table file
.
..
...
on table hold as format focus
end
Then Focus builds the mfd for you and it goes away after.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
rc,

If I read your second post correctly, you basically want to accept user input (from an HTML page presumably?) and then display this on a first page of a compound report.

If this is the case then you do not have to tie it into another result set (per se). You could just place all the variables being passed to your procedure into a HEADING and then execute an empty report page,

For instance, suppose your user has to choose a number of variables from combo boxes on your HTML page - for example &Var1 through &Var8. Then your procedure could be something like -

-* Always default the incoming variables so that testing is easier.
-DEFAULT &Var1 = '', &Var2 = '', &Var3 = '', &Var4 = '', &Var5 = '', &Var6 = '', &Var7 = '', &Var8 = ''

-* Ensure empty reports are shown
SET EMPTYREPORT = ON

TABLE FILE filename
-* This extracts just one row from the resultset and doesn't print it.
PRINT somefield NOPRINT
IF RECORDLIMIT EQ 1
-* This is where your variables are used on the first page
HEADING
"Report for someone using parameter input as follows :-"
"&Var1"
"&Var2"
"&Var3"
"&Var4"
"&Var5"
"&Var6"
"&Var7"
"&Var8"
ON TABLE PCHOLD FORMAT format OPEN
END
-RUN

TABLE FILE filename
SUM numeric_field
    more fields
BY sort_field etc.
WHERE field1 EQ '&Var1'
  AND field2 EQ '&Var2'
  AND etc.
ON TABLE PCHOLD FORMAT format
END
-RUN

more reports as required.

SET COMPOUND = CLOSE


The first report will always have content, the second will have content if the result set is not empty or will show the HEADING and FOOTING components if the resultset is empty.

As I say, I think is what you really want and not a temporary file that you can push the user input into to then extract from it. If not then let us know and we'll try again. Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Thanks all.
Tony A approach worked great.
What is the run with "-" Why can I use the Set right before the Table File filename and inside the Table File I have to use -Set ??
 
Posts: 72 | Registered: April 03, 2006Report This Post
Expert
posted Hide Post
rc,

Glad it worked for you.

The -RUN forces the execution of the stack and, as all commands preceded by a hypen, is a dialogue manager command. There are some good explanations in this forum (somewhere).

As per the above, there is a difference between the -SET and just plain SET. What SET do you mean and what is the full string you are refering to?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
set emptyreport = on
vs
-Set &sdatey = &dateyy;

Why the "-" and ";"

Within the coding window there must be different flavors of code you can write i.e. dialogue manager vs. what?
 
Posts: 72 | Registered: April 03, 2006Report This Post
Expert
posted Hide Post
rc,
For a very old, but still relevant, example of how dialogue manager controls the flow of your procedure, check out this link. You will need an inforesponse login to view it.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     Can you create a temp table?

Copyright © 1996-2020 Information Builders