|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
I've searched for a possible solution, but cannot find.
I am joining two tables on ID. It's an outer join with ALL=ON. Because of this, all the fields in the cross reference table are also missing. Is there a way to plug a dummy value in for the missing values. JOIN TABLE1.ID IN TABLE1 TO ALL TABLE2.ID IN TABLE2 END DEFINE FILE TABLE1 NAME_MOD/A10 MISSING ON = IF TABLE2.NAME IS MISSING THEN '0' ELSE 'TABLE2.NAME'; END TABLE FILE PRINT TABLE1.ID NAME_MOD END Basically, I want a character value in NAME_MOD for every record regardless. Thanks all. WF 7.6.1; |
||
|
|
Master |
Are you saying that you are not coming up with values from TABLE2 or are they not what you expect them to be?
If NAME_MOD is a required field remove the MISSING ON and the quotes around 'TABLE2.NAME' MATCH might serve you better in this case, try searching on it. Pat WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
|
Member |
The fields in Table2 are missing only where there is not a match between the two tables on ID.
WF 7.6.1; |
|||
|
|
Master |
There's a bit of subtlety required here.
If the target field you are joining to does not have MISSING=ON then a non matching value will retrieve blanks. (I personally always use the missing attribute on keys in an RDBMS for this reason). DEFINE FILE TABLE1 NAME_MOD/A10 MISSING ON = IF TABLE2.NAME IS MISSING OR TABLE2.NAME EQ ' ' THEN '0' ELSE 'TABLE2.NAME'; END Should do the trick. Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo |
|||
|
|
Virtuoso |
As Pat says, if you always want a value for the field NAME_MOD, there is no need for the "MISSING ON." That only means that the value of NAME_MOD could sometimes be missing - which is NOT what you asked for.
When you put TABLE2.NAME inside of tick marks, WF thinks you are setting the value of NAME_MOD to a literal (which in this case is 11 characters so it would give you an error anyway.) This should work. NAME_MOD/A10=IF TABLE2.NAME IS MISSING THEN '0' ELSE TABLE2.NAME; If TABLE2.NAME is blank you would also need to add OR TABLE2.NAME EQ ''. Regards, Darin WF Server: 7.1.6 on Z/OS and Linux, ReportCaster, Self-Service, MRE, Java Data: DB2, DB2/UDB, Adabas, SQL Server Output: HTML,PDF,Excel2K WF Client: Linux w/WebSphere, Servlet, CGI |
|||
|
|
Gold member |
Bobv,
First of all you should use a left_outer join to make sure that all records from table1 are included even if there is no match on table2. Hold the results in a hold file. You can then create a 'Define' field that will check for '' or missing. WF 7.6.4 Tomcat SQLServer 2000 Windows NT-5.2 x86 32bit |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

