Wiki

Scale Your Enterprise

User Tools

Site Tools


bizweaver:exec_sql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
bizweaver:exec_sql [2024/09/09 13:43]
dlee created
bizweaver:exec_sql [2024/09/09 14:35] (current)
dlee [Create Control Procedure]
Line 1: Line 1:
 ======Called from SQL===== ======Called from SQL=====
  
 +A dynamic link library (SQLWSCall.dll) provided by Third Wave Business Systems is required for this functionality to work. The file is installed in C:\Program Files\Bizweaver\BWPortal\BWSQLSP when Bizweaver is installed.
  
-===== Obtain the DLL executable file===== +=====Initialize MS SQL Server=====
-    * The file is installed in C:\Program Files\Bizweaver\BWPortal\BWSQLSP when Bizweaver is installed. +
-    * The file can be downloaded from https://portal/twbs.com in the Software Download section. +
- +
-=====Initialize the Database Code=====+
  
 Execute the following SQL statements against the **Master** database Execute the following SQL statements against the **Master** database
Line 34: Line 31:
 =====Create Assembly===== =====Create Assembly=====
  
-Create an Assembly in the **Target** (SAP or VersagoData) database+Create an Assembly in the **calling** database
  
-  * Expand the folder tree for the target (SAP) database.+  * In MS SQL Management Studio, expand the folder tree for the database.
   * Expand the "Programmability" folder.   * Expand the "Programmability" folder.
   * Right-click on "Assemblies"; select "New Assembly".   * Right-click on "Assemblies"; select "New Assembly".
Line 43: Line 40:
  
   * Browse to folder where the SQLWSCall.dll is located and select it.   * Browse to folder where the SQLWSCall.dll is located and select it.
-    * This will be the same folder as in the previous steps. 
   * The Assembly Name and Assembly Owner are set automatically.   * The Assembly Name and Assembly Owner are set automatically.
   * Select "External Access" from the drop-down for "Permission Set".   * Select "External Access" from the drop-down for "Permission Set".
Line 50: Line 46:
 =====Create Control Procedure===== =====Create Control Procedure=====
  
-Create the following stored procedure in the target (SAP) database.+Create the following stored procedure in the calling database.
  
 <code sql> <code sql>
Line 65: Line 61:
 </code> </code>
  
-<WRAP center round help 80%> +  * @wsMethod: POST 
-A sample of the configuration to call Bizweaver is found **//[[bw2:call_bizweaver_from_sql#Calling Bizweaver Using POST|here]]//**. +  * @wsUrl: <nowiki>https://<yourURL>/</nowiki> (Be sure to use http or https as appropriate) 
-</WRAP>+  @wsPort: <yourPort> (Typically 443 for https or 8080 for http) 
 +  @wsContent: 'application/json' 
 +  * @wsAuthTokentoken generated in Bizweaver's Settings window 
 +  * @wsTaskId: workflow id 
 +  * @wsStartAfter:
 +  * @wsParameters: arguments must be passed using label:value pairs enclosed in double quotes and brackets 
 +    * Example: the variable name in the Bizweaver workflow is vgo_BatchID (case sensitive) 
 +    <code sql> 
 +    SET @wsParameters = '{"vgo_BatchID":' + '"' + @vgo_BatchID + '"' + '}' 
 +    </code> 
 + 
 + 
 + 
 +=====Calling Bizweaver Using spCallBizweaverWS==== 
 +<code sql> 
 + 
 +DECLARE @Arguments NVARCHAR(MAX) 
 +SET @Arguments = '{"YourTargetVariable":' + '"' + @list_of_cols_val_tab_del + '"' + '}' 
 + 
 +EXECUTE [dbo].[spCallBizweaverWS] 
 +    @wsMethod='POST' 
 +    ,@wsURL='https://YourURL' 
 +    ,@wsPort='443' 
 +    ,@wsContent='application/json' 
 +    ,@wsAuthToken='xyxyxyxyxyxyxyxyx' 
 +    ,@wsTaskId='999' 
 +    ,@wsStartAfter='0' 
 +    ,@wsParameters= @Arguments 
 + 
 +END 
 +</code>
  
  
 ---- ----
 **[[bizweaver:Home|Home]]** **[[bizweaver:Home|Home]]**
bizweaver/exec_sql.1725903795.txt.gz · Last modified: 2024/09/09 13:43 by dlee