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] Convert SQL Query into FOCUS Format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert SQL Query into FOCUS Format
 Login/Join
 
Silver Member
posted
Hi everyone! I'm new to FOCUS language and WEBFOCUS platform in general, so I have this questions for you guys: I need to convert this SQL Query into a FOCUS command:

 
SELECT field_a,field_b  FROM table1
INNER JOIN table2                  
ON  field_table1    = field_table2
AND field_c_table1  = 'L'                
AND field_d_table2  = field_b_table2        
FOR FETCH ONLY WITH UR;

I've just made up some names in my query, because the most important thing to know for me is how can I convert a INNER JOIN in FOCUS, I've read the documentation manual and there is a JOIN command for linking two tables, but I'm a little bit confused.
Thank you everyone for helping me in this issue!

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


WebFOCUS 7.1.4
Windows, All Outputs
 
Posts: 35 | Registered: December 21, 2011Report This Post
Virtuoso
posted Hide Post
Probably something like this:

JOIN CLEAR *
JOIN INNER FIELD_TABLE1 IN TABLE1 TO FIELD_TABLE2 IN TABLE2 AS J1
-*
TABLE FILE TABLE1
 PRINT TABLE1.FIELD_A
       TABLE1.FIELD_B
 WHERE (TABLE1.FIELD_C_TABLE1 EQ 'L')
   AND (TABLE2.FIELD_D_TABLE2 EQ TABLE2.FIELD_B_TABLE2);
END

If the relationship between TABLE1 and TABLE2 is one to many, then the JOIN becomes:

JOIN INNER FIELD_TABLE1 IN TABLE1 TO ALL FIELD_TABLE2 IN TABLE2 AS J1


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Silver Member
posted Hide Post
Hi Dan thank you for your response. Now it's clearer for me how can I convert my SQL Query.
One more question please I dont understand very well how FOCUS manage datatypes, for example in this snippet:
  
DEFINE FILE COMPANY                                                                       
COMP_FIELD/P32.8 = COMP_FIELD;                                                        
COMP_AFIELD/P32.8 = COMP_AFIELD;                                                        
COMP_BFIELD/A22    = EDIT(FIELD5) | EDIT(FIELD6);                                  
END              

I don't understand what P32.8 is, I'm not sure if it is a datatype or something like that. What's more after reading the documentation I understand that if I wanted to declare variables I had to put its datatype between a slash. Is that correct? Finally the operator | is for concatenation isn't it?
Thank you so much for your support


WebFOCUS 7.1.4
Windows, All Outputs
 
Posts: 35 | Registered: December 21, 2011Report This Post
Virtuoso
posted Hide Post
P32.8 defines a packed decimal field, 32 digits long, including 8 decimals. So it would have 23 or 24 significant digits. (I always forget if the length includes the decimal place or not.) There are limits to the lengths of packed (P), double-precision (D), and single-precision (F) numeric fields that can be defined. The limits have increased over the years and I no longer know for sure what they are. Field formats do follow a forward slash after the field name (as in your sample code). Operator | does represent soft concatenation, and || signifies hard concatenation (blanks are removed).


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Silver Member
posted Hide Post
Thank you for the support! Besides the documentation reference, do you know any other manual for learning FOCUS? I'm been searching the internet but I've found a few resources.


WebFOCUS 7.1.4
Windows, All Outputs
 
Posts: 35 | Registered: December 21, 2011Report This Post
Virtuoso
posted Hide Post
The best source for documentation is at http://documentation.informationbuilders.com/.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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] Convert SQL Query into FOCUS Format

Copyright © 1996-2020 Information Builders