Focal Point
passthrough and variable

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/100108404

March 26, 2010, 03:05 PM
Maria Tan
passthrough and variable
Hey;

I have the following codes who works fine to date update via passthrough. However i want to make

where query as variable, ex:
WHERE EMPLOYEE_ID EQ &employeeNum;

and it won't work. Any idea?



Original fex file

SET SQLENGINE=SQLMSS

SQL SQLORA SET SERVER EUM
SQL SQLORA
UPDATE PERSON
SET LAST_UPDATED_DATE = SYSDATE
WHERE EMPLOYEE_ID = 'N01';

END
-IF &LINES EQ 0 GOTO REPTDONE;
-RUN
-EXIT
-REPTDONE
-HTMLFORM NODATA


====================
Production: WebFOCUS 7.1.1 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLOGIC 8.1 sp4
Dev: WebFOCUS 7.6.4 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLogic 8.1 sp4
March 26, 2010, 03:11 PM
Darin Lee
What do you mean by "it won't work"? error messages? not updating? updating wrong records?

Also, you are missing the quote marks. Should be WHERE EMPLOYEE_ID = '&employeeNum'; (EQ isn't valid SQL syntax) and &employeeNum would either need to be populated (by a -SET or -DEFAULT) or "Prompt for Parameters" property turned on.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 26, 2010, 03:13 PM
fatboyjim
Hi,

The WHERE statement is missing quotes
  
WHERE EMPLOYEE_ID EQ '&employeeNum';


Best Regards,

Jimmy Pang


DEV: WF 7.6.10
TEST: WF 7.6.10
PROD: WF 7.6.10
MRE: WF 7.6.4
OS/Platform: Windows
Dev Studio: WF 7.7
Output: HTML, EXCEL, PDF, GRAPH, LOTUS, CSV
March 26, 2010, 03:52 PM
Maria Tan
Hey, Darin and Jimmy;

The field got updated.

Thanks a million for your help you gave.

Maria


====================
Production: WebFOCUS 7.1.1 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLOGIC 8.1 sp4
Dev: WebFOCUS 7.6.4 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLogic 8.1 sp4