Focal Point
[SOLVED] How do I write data direictly to SQL from a .fex

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

March 19, 2014, 06:46 AM
Hero
[SOLVED] How do I write data direictly to SQL from a .fex
I have a fairly simple question (i hope)
In order to monitor the use of my reports, I want to create an INCLUDE file that writes the date, fexname, and user name to an Sql-table.
Can Anyone show me the syntax to wite to sql from a fex?

(i'm using WF 7.703)

Thanks

Hero

This message has been edited. Last edited by: <Kathryn Henning>,


WebFocus 7.611
WebFocus 7.703
Windows, All Outputs
March 19, 2014, 07:25 AM
Tony A
Lots of examples and threads on this. Search on "sql update" in this forum for 12 pages 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 
March 20, 2014, 11:39 AM
Hero
Thanks Tony for your reply.
I looked at the threads, but frankly, I cannot make heads nor tails from all the posts.
I do not have much experience in WF, so general advice is of little use to me.

I am looking for a simple example I can use to send & values to my sql database.


WebFocus 7.611
WebFocus 7.703
Windows, All Outputs
March 20, 2014, 12:40 PM
Tony A
Hi Hero,

From the multitude of threads that there are, you should have found that you can use (what is known as) SQL Passthru.

The basis of this is that you can embed SQL syntax between the command "SQL SQLMSS" (for MSSQL) and a semi-colon. The SQL that you can use is generally most (if not all) of the SQL available via your adapter i.e. if you use the MSSQL adapter, you can use MS SQL, if you use the ODBC adapter to access MS SQL instances then your SQL is restricted (because ODBC is restrictive).

Using this you will understand that the following code could be used via an MS SQL adapter (without using WF synonyms) -
SQL SQLMSS
  update [your target table] T1
     set column4 = (select column1 | column2
	             from [your source table] S1
                     where T1.column1 | T1.column2 | T1.column3
                         = S1.column1)
;
END

... and similar code.

Alternatively you could use MAINTAIN (your licencing would need to be checked) or MODIFY - these languages would use the synonyms (*.mas and *.acx files) and they would need to be configured correctly (with permissions etc.) to enable you to write to your chosen SQL table.

Good luck.

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 
March 24, 2014, 09:44 AM
Hero
Thanks Tony,
This is usefull.
I'll give it a try


WebFocus 7.611
WebFocus 7.703
Windows, All Outputs