Focal Point
SQL PassThru in Dev Studio

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

March 21, 2008, 09:45 AM
<Marilyn Kay>
SQL PassThru in Dev Studio
quote:
ENGINE SET DEFAULT_CONNECTION
ENGINE
SELECT ......
FROM .....
WHERE ...... ;
TABLE ON TABLE HOLD AS
END
-RUN
TABLE FILE
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN


When we attempted to apply this technique within Developer Studio, following the SQL setup with the create SQLOUT checkbox unchecked, we did not find the name of the hold file in the list of data sources for report creation. Is there a workaround other than going back to creating SQLOUT and then tabling SQLOUT to a hold file?
March 21, 2008, 11:24 AM
FrankDutch
quote:
create SQLOUT checkbox unchecked


why "unchecked" if you do this with the checkbox checked you get the SQLOUT as hold file.




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

March 21, 2008, 11:33 AM
<Marilyn Kay>
I wanted to take advantage of the TABLE ON TABLE HOLD AS MYFILE. Then MYFILE would form the basis for the report. No SQLOUT needed. This works find in text mode.
March 21, 2008, 12:07 PM
FrankDutch
Well Marilyn I wonder how your code should work, I never saw code like this.
As far as I know it should after the SQL code start with TABLE FILE SQLOUT and then you can put it an hold file or build the report you like.

An other solution I prefer is create a master on the SQL script (View) that runs on the server.

Now you can build the report on that 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

March 24, 2008, 09:04 AM
PBrightwell
Using:
TABLE
ON TABLE HOLD AS MYFILE
END
after the ; in your SQL code should let you name your table. I think you still need the box checked. You are still creating SQLOUT, you are just giving it a name without running through the data a second time.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 25, 2008, 10:11 AM
<Marilyn Kay>
Thanks Frank and Pat for your replies. Pat, you are right, the technique works and it lets us rename the SQLOUT to MYFILE as long as we are editing the fex in text mode. And in text mode, we can apply DEFINEs directly to MYFILE (which we can't do directly to SQLOUT). But we have team members who prefer to work in Developer Studio where we seem unable to rename the SQLOUT using the tool exclusively. We can go into the text and do it for sure. So thanks a lot. We know what options we have and there is no need to pursue it further at this time.
March 26, 2008, 01:03 PM
Darin Lee
Until recently there was no way to handle SQL at all in DevStudio. The GUI tools are still catching up with the functionality and capabilities of the FOCUS language. So the standard still applies of doing whatever you can in the GUI and then dropping into the code. Those who refuse to go this route may do OK, but they are missing out on a lot of good stuff.


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