Skip to main content

Posts

Showing posts with the label Query

Find slow running queries on MS SQL Server

Source Below query will helps you find the queries which have taken a lot of time in milliseconds. To confirm that you have query performance issues on your SQL Server instance start by examining queries by their execution time. SELECT     req.session_id     , req.total_elapsed_time AS duration_ms     , req.cpu_time AS cpu_time_ms     , req.total_elapsed_time - req.cpu_time AS wait_time     , req.logical_reads     , SUBSTRING (REPLACE (REPLACE (SUBSTRING (ST.text, (req.statement_start_offset/2) + 1,        ((CASE statement_end_offset            WHEN -1            THEN DATALENGTH(ST.text)              ELSE req.statement_end_offset          END - req.statement_start_offset)/2) + ...

How to check Communications Outbound Manager jobs status SQL

When using " Communications Outbound Manager " business service Siebel create a job record in " S_SRM_REQUEST " table. You can easily check the status of these jobs by using below query which is written for MS SQL Manager Studio. SELECT STATUS ,CREATED,ROW_ID,DESC_TEXT,ENTERPRISE_NAME,EXEC_SRVR_NAME,PARAM_VAL,RESP_TEXT,COMPLETION_TEXT FROM S_SRM_REQUEST WHERE 1=1 AND DATEPART ( YEAR ,CREATED) = '2022' AND DATEPART ( MONTH ,CREATED) = '04' AND DATEPART ( DAY ,CREATED) = '06' AND ( PARAM_VAL LIKE '%SendMessage%' OR PARAM_VAL LIKE '%CreateRequest%' ) ORDER BY CREATED DESC

How to remove Line Break when selecting data from SQL Server

When you run SELECT query and copy the result to notepad or excel instead of one row columns with new line character shifts to new row. char(13) is carriage return (is a control character or mechanism used to reset a device's position to the beginning of a line of text) and char(10) is line feed (new line). Below query will eliminate carriage return and new lines from a column of a table. The inner replace replaces line feed and the outer replace replace carriage return SELECT Replace ( Replace( X_DIVISION, CHAR (10), '' ), CHAR (13), '' ) FROM S_CASE_X WHERE PAR_ROW_ID = '1-8I4G98D' Source: Stackoverflow 28628342, Wikipedia See Also: How to remove Line Breaks from a string using Siebel eScript

Make a Field Case Insensitive for Search in Siebel

This article will guide you to make field case insensitive for Query/ Search in Siebel Tools. Login the application and navigate to applet for which we need to make field case insensitive. Get the applet name from Help > About View... Login the Siebel tools and query the applet name, from List Column or Control get the field name. Go to the Business Component and query the field name and get the Column name. Go to Table and query through Column name. Right click on the Column name and from menu click on Case Insensitivity... A wizard window will appear, click on Next button. Click on Finish button. Now query the table and Apply DDL. Compile the table on SRF (Server/ Dedicated Client). Login the application and check the change. Note: Oracle does not recommend making field search case insensitive. This slows down the search performance.

Find record query loop in Siebel eScript

  var EngBO, EngBC, EngId, RecordCount, withRecord, UserName, UserId; EngBO = TheApplication().GetBusObject("My Business Object"); EngBC = EngBO.GetBusComp("My Business Component");          with (EngBC)     {         ActivateField("Parent Id");         SetViewMode(AllView);         ClearToQuery();         SetSearchSpec ("Parent Id", ServiceId);         ExecuteQuery(ForwardOnly);         RecordCount = CountRecords();         withRecord = FirstRecord();                  while(withRecord)         {             EngId = GetFieldValue("Id");             UserNa...

There were more rows than could be returned Siebel SBL-EAI-04376

Steps: IO with two ICs as parent child,  trying to query using business service "EAI Siebel Adapter" method "Query" in child IC. Behavior: Workflow keep executing until application crashed. Reason: This usually occurs when try to query in Child IC and exclude the Parent IC in search spec. Error: Error invoking service 'EAI Siebel Adapter', method 'Query' at step 'Query IO'.(SBL-BPR-00162)--Method 'NextRecord' of business component 'Child BC' (integration component 'Child IC') returned the following error:"There were more rows than could be returned.  Please refine your query to bring back fewer rows(SBL-DAT-00500)"(SBL-EAI-04376)  Solution: Added parent IC in serarch spec as well. "[ParentIC.Case Num] = '" + [&CaseNumber] + "' AND [ChildIC.Id] = '" + [&RowNum] + "'"

How to query or find record in Siebel Business Component

You can perform query operation on Business Component through Workflow, eScript with the help of Siebel Operation, Inbound E-mail Database Operations (method: FindRecord) or EAI Siebel Adapter (method: Query but you need to create Integration Objects). This Business Component can be Virtual Business Component (VBC), External Business Component (EBC) or generic Business Component (BC).  See also: Difference Between Business Components and How to Create BC in Siebel through Object Wizard through Workflow with the help of Siebel Operation Create a workflow and provide the Business Object, business component should be in this BO for which you want to perform the query operation. From the Palettes window drag drop the Siebel Operation into workflow designer plane. Select the Siebel Operation box and open the properties window, provide the Business Component name from the drop down list and set Query in Operation field. You can set the search specification by two means either provide the...

How to add SearchSpec (query) on Applet Load Event through Applet Server Script in Siebel

If record is found every time when user navigate to Applet that record will be displayed. If record is not found Applet will be empty but user can use Query to found desired record. function WebApplet_Load () { var currBC = this.BusComp();     with (currBC)     {        SetViewMode(AllView);        ClearToQuery();        SetSearchSpec("SSN", "abc123xyz789");        ExecuteQuery(ForwardOnly);     } }

How to Find Record (query) in Business Component through Siebel Workflow

Add new Business Service step in Siebel Workflow, set its properties as below: Business Service Name: Inbound E-mail Database Operations Business Service Method: FindRecord Set the values of Input Arguments as below: Input Argument: BusComp Type: Literal Value: Service Request Input Argument: BusObj Type: Literal Value: Service Request Input Argument: QueryFields Type: Literal Value: SR Number Note: Filed on which you want to query. Can add multiple fields like Field1,Field2,Field3 Input Argument: ValueFields Type: Literal Value: Id Note: Filed which will business service return if found the record. Can add multiple fields like Field1,Field2,Field3 Input Argument: SR Number Type: Process Property Property Name: SRNumber Note: Input Argument should be same as the name of filed defined in QueryFields. Set the values of Output Arguments as below: Property Name: SR ID Type: Output Argument Output Argument: Id Note: Output Argume...

How to Query Page in Integration Object IO and get desired number of records using EAI Siebel Adapter business service in Siebel Workflow

Why Pagination in Siebel Inbound Web Service? When creating Inbound Web Services in Siebel for external system consumption data might be huge and web service either take time or timeout when invoking. So in this scenario we need to introduce the pagination. When calling the web service external system will request the page size meaning number of rows in one request. Prerequisite: IO must be compiled on SRF (EAI, SIA) and Deployed to run time data base for which you want to execute query in Siebel Workflow. Process: Add new Business Service step in Siebel Workflow, set its properties as below: Business Service Name: EAI Siebel Adapter Business Service Method: QueryPage Set the values of Input Arguments as below: Input Argument: OutputIntObjectName Type: Literal Value: IO Name Input Argument: SearchSpec Type: Expression Value: "[IC Name.Field Name] = '" + [&Process Property Name] + "'" Sample Expression: "[IC Name.Field Name] ...

How to query in Integration Object IO using EAI Siebel Adapter business service in Siebel Workflow

IO must be compiled on SRF (EAI, SIA) and Deployed to run time data base for which you want to execute query in Siebel Workflow. Add new Business Service step in Siebel Workflow, set its properties as below: Business Service Name:  EAI Siebel Adapter Business Service Method:  Query Set the values of Input Arguments as below: Input Argument: OutputIntObjectName Type: Literal Value: IO Name Input Argument: SearchSpec Type: Expression Value: "[IC Name.Field Name] = '" + [&Process Property Name] + "'" Set the values of Output Arguments as below: Property Name: SiebelMsg  Type: Output Argument Output Argument: SiebelMessage SiebelMsg is a process property with type hierarchical. Below are some SearchSpec expressions: "[IC Name.Field Name] = Today() AND [IC Name.Field Name] = '"+LookupValue("LOV_TYPE","Value")+"'" "[Id]= '"+[&Object Id] +"'...

Siebel DB Backup through SQL Query

Replace values in highlighted with lime color according to your configuration. BACKUP DATABASE [SiebelDB] TO DISK = N' E :\\ FolderName \\ MSSQL11.MSSQLSERVER \\ MSSQL \\ Backup \\SiebelDB- bk-date .bak' WITH NOFORMAT, NOINIT, NAME = N'SiebelDB-Full Database Backup- Date ', SKIP, NOREWIND, NOUNLOAD,  STATS = 10 GO

How to unlock Workflow in Siebel Tools from Database Table through SQL query

Background: For working on an object in Siebel tools you need to lock it and usually developer forget to unlock after working on the object. So you need to ask and wait for current lock owner to unlock. There is simple way to unlock any object in Siebel, use SQL Query. Below are the simple steps to achieve this. Process: Get Row Id of Workflow from Siebel Tools and replace below and run the query:   Open tools select the workflow and from top menu bar go to "Help" and click on "About Record"   A new window will open click on "Details>>" button. Copy the Row# and replace in where clause. UPDATE S_WFR_PROC SET OBJ_LOCKED_FLG='N' WHERE ROW_ID=' 1-OOYOU ' If you using Oracle SQL Developer make sure to commit. In tools query the workflow and lock. Now query the workflow again in Siebel Tools and lock it by right click menu.

How to get Siebel Workflow Instance Monitor values from Database through SQL query

Below is the query for getting workflow instance monitor values from table: select wfdl.NAME as 'WF Name' ,wfdl.DEPLOY_STATUS_CD as 'Status' ,wfdl.VERSION as 'WF Version' ,wfil.END_TS as 'Instance EndDate' ,wfil.STATUS_CD as 'Instance Status' ,wfsil.STEP_NAME as 'Step Name' ,wfsil.STATUS_CD as 'Step Status' ,wfsl.NAME as 'Process Name' ,wfsl.PROP_VAL as 'Process Value' from S_WFA_DEFN_LOG wfdl join S_WFA_INST_LOG wfil on wfdl.ROW_ID = wfil.DEFINITION_ID  --Process Instance join S_WFA_INSTP_LOG wfsil on wfil.ROW_ID = wfsil.INST_LOG_ID --Step Instance join S_WFA_STPRP_LOG wfsl on wfsil.ROW_ID = wfsl.STEP_LOG_ID  --Process Properties where wfdl.NAME = 'Workflow name with instance monitor level 3' --and wfil.STATUS_CD = 'COMPLETED' --and wfsil.STEP_NAME = 'step name' --and wfsl.NAME <> 'Error Message'