We're trying to implement the DBA functionality on a simple master file. (no joins) and we're running into an error of
(FOC053) DBA ERROR. INVALID ATTRIBUTE IN MASTER FILE: SALESPERSON_NUM EQ '193' OR '4407' OR '4602' OR '3873' OR '3866' OR '3872' OR '3222' BYPASSING TO END OF COMMAND
Here's the line... USER=JKELLY, ACCESS=RW, ACCESS=R, RESTRICT=VALUE, NAME=SYSTEM, VALUE=SALESPERSON_NUM EQ '193' OR '4407' OR '4602' OR '3873' OR '3866' OR '3872' OR '3222' ,$
The line works fine until we add the 6th salesperon_num to the OR. If we take off the "OR '3222'" it works as expected.
Is there a limitation to the number of OR's you can have, or maybe there's a better way to do what we're trying to do here.
Thanks!This message has been edited. Last edited by: <Emily McAllister>,
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 26, 2007, 01:33 PM
Jason K.
I'd like to add that I tried to use an IN ('x','y','z') and got errors.
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 26, 2007, 01:37 PM
Tony A
Jason,
Have you tried converting the multiple ORs into an IN statement?
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
October 26, 2007, 01:38 PM
Tony A
I guess you did - overlap of postings!
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
October 26, 2007, 02:10 PM
Jason K.
thanks for the tip tony! we were never able to get an IN statement to work without syntax errors, we figured it had something to do with it being a DBA setup rather than an actual where clause.
Is there a way to use an IN in a DBA?
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 26, 2007, 02:42 PM
FrankDutch
I would suggest an other approach.
Create a separate user table with two keys
USERCODE SALESPERSON_NUM
and build the restrict on that table at the first field.
Then if you want to run a report you first select the salesperson_num records based on this table.
The advantage is that you can add records in the database instead of changing the master.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
October 26, 2007, 04:00 PM
Jason K.
hold the phone... Frank, I think I'm understanding you correctly, but I'm not sure....
I could create a table of MR User ID's | Salesperson_Num and join it to Salesperson_Num | Payroll$
and that would only return the salesperson_num associated with the user id!
How could I do this join in my fex? I don't know how to specify the user-id they used to log into webfocus.
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 26, 2007, 04:01 PM
Jason K.
actually, nevermind Frank... that won't work too well as we have to do this for every report built over that master file...there's dozens of them.
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 26, 2007, 04:16 PM
Spence
when your values span multiple lines you need to repeat value=or on each line
example:
PASS=SHIPPENK, ACCESS=R, RESTRICT=VALUE, NAME=CT_LOC, VALUE=EC_CSTRING EQ 'GCH' OR 'GEO' OR 'GIB',$ VALUE=OR 'GLO' OR 'GRS' OR 'GSV' OR 'GVM' OR 'GWS',$
WF 8 version 8.2.04. Windows. In focus since 1990.
October 26, 2007, 04:29 PM
Spence
your example would be:
USER=JKELLY, ACCESS=RW, ACCESS=R, RESTRICT=VALUE, NAME=SYSTEM, VALUE=SALESPERSON_NUM EQ '193' OR '4407' OR '4602' OR '3873' OR '3866' OR '3872' ,$ VALUE=OR '3222' ,$
WF 8 version 8.2.04. Windows. In focus since 1990.
October 26, 2007, 04:46 PM
FrankDutch
If Spence brought the solution then that's ok otherwise.
Create a small select fex that you can include in the others.
TABLE FILE USERS
PRINT SALESPERSON_NUM
WHERE USERCODE EQ '&LOGINID';
ON TABLE HOLD AS HSALENUM FORMAT ALPHA
END
-RUN
..
put an escape if the number of records is zero. and display a functional message
Then you include the line
WHERE (SALESPERSON_NUM IN FILE HSALENUM) ;
In each fex where you need this..
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
October 29, 2007, 09:33 AM
c1
.
September 15, 2016, 09:00 AM
BM
HI, Was this issue ever resolved. I am kinda facing the similar issue.
thanks
WebFOCUS 8202M
September 15, 2016, 10:12 AM
eric.woerle
BM,
I believe there is a limitation on how long a line in a master file can be. You may need to wrap your restriction. I use DBA Security extensively, unfortunately I've never run into this issue before.
On another note, there is a bug in 8105 when using DBA security and Clustered Master Joins. I would run some sql traces once you get this running to be sure that you are getting the expected results before moving this to a production system.
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
September 15, 2016, 12:12 PM
BM
Thanks.. any tip on how i would go about Wrap the restriction?
WebFOCUS 8202M
September 15, 2016, 12:33 PM
eric.woerle
spence talks about it above. I would try that and check the help file. You may also need to open a case if you aren't able to resolve it.
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
September 15, 2016, 09:11 PM
BM
Thanks. I think I have found the issue. In the FILEDEF I had (LRECL 81 . I changed 81 to 800 and it seems to have fixed the issue. I think the limitation is 4000. I guess I will have to figure something better out.