Sunday 28 August 2016

Error : SBL-DBC-00104: Error retrieving next record from the database

Hello All,

Recently i faced an issue where in a view was not loading and error "SBL-DBC-00104: Error retrieving next record from the database" was appearing.
In detailed log also not much of the information was given ,
"SBL-DBC-00104: Error retrieving next record from the database.
SQLParseAndExecute Execute 5 0000a9f7572e1aa8:0 2016-08-25 18:03:38 ORA-24345: A Truncation or null fetch error occurred"

after some debugging i narrowed down the scenarios where this type of error could occur.
  • Some wrong query is being run in back end, which is not fetching any record.
  • Some wrong or Null value is there in any column which is causing the Select selection which is generated at view load time to fail
  • Some columns attribute is being wrongly defined i.e. Length of column is Different then what is maximum declared at table level.
  • Some existing column is mistakenly used again

if found below articles very helpful to make me sure that i was in the right direction.(thank you respective authors for such nice articles)




i further debugged and the root cause in my case was ,

Some existing column is mistakenly used again

in the course of development we used a already used extension column to store some custom value and this column was appearing in the select statement of view load, there was some conflict because of this and it resulted in error.

After changing the column to a new one and clearing any previous value in the columns solved my issue.

so to summaries,

  • whenever using any existing extension column make sure its not already used
  • always make sure length property of column and BC level are same
  • In any error situation the best approach is to first generate Spool and read the Select statement that is failing, most of the issue can be resolved by debugging this SQL statement.
Related Error : "SBL-DBC-00105: An error has occurred executing a Sql statement" ,caused by difference in Physical Schema and Logical Schema, can be removed after Applying DDL from Siebel Tools to the changed/modified table.

Hope it was helpful..  

Wednesday 17 August 2016

Working with Property Sets in Siebel

Hello All,

Siebel property set are indispensable when it comes to format data in hierarchical formats. Recently I had some requirement wherein I had to return output in hierarchical format.
The exact requirements was we have queried multiple SR's and return the result in a hierarchy.

so to format data i used Property Sets to convert  output data in required format

Format 1: 
  PropertySet [
 <?xml version="1.0" encoding="UTF-8"?>
 <?Siebel-Property-Set EscapeNames="true"?>
 <PropertySet>
 <SR1>
          <SRNumber>1-23245</SRNumber>
          <Status>Closed</Status>
          <Error></Error>
 </SR1>
 <SR2>
         <SRNumber>1-456386</SRNumber>
          <Status>Open</Status>
          <Error></Error>                                                                            
 </SR2>
 </PropertySet>]            

in this format Attributes appear as Separate Tags under parent SR tag.

Format 2: 
  PropertySet [
 <?xml version="1.0" encoding="UTF-8"?>
 <?Siebel-Property-Set EscapeNames="true"?>
 <PropertySet>
 <SR1 SRNumber="1-23245" Status="Closed" Error=""></SR1>
<SR2 SRNumber="1-23245" Status="Closed" Error=""></SR2>               
 </PropertySet>]            

in this format Attributes appear witin parent SR tag.

Depending on the requirement below code can be used to format the output.

Sample Code for Format 1:
  for(var x = 1; x <= NumberOfSR; x++)
{
     var outPropset = TheApplication().NewPropertySet() ;
     var outPropset1 = TheApplication().NewPropertySet() ;
     var outPropset2 = TheApplication().NewPropertySet() ;
     var outPropset3 = TheApplication().NewPropertySet() ;
       // oOutputs contains values of Multiple SR's,
    SR = oOutputs.GetProperty('SR '+x);
    var pInputs = TheApplication().NewPropertySet();
    var pOutputs = TheApplication().NewPropertySet();
    pInputs.SetProperty("ProcessName", "Process SR Workflow");
    pInputs.SetProperty("Object Id", SR);
    pService.InvokeMethod("RunProcess", pInputs, pOutputs);
    var SR = oOutputs.GetProperty("SRNumber");
    var Status = oOutputs.GetProperty("Status LIC");
    var Error = oOutputs.GetProperty("Error Code");

     outPropset.SetType('SR'+x) ;
   outPropset1.SetType("SRNumber") ;
   outPropset2.SetType("Status");
   outPropset3.SetType("Error");

   outPropset1.SetValue(SR) ;
   outPropset2.SetValue(Status) ;
   outPropset3.SetValue(Error) ;

   outPropset.AddChild(outPropset1) ;
   outPropset.AddChild(outPropset2) ;
   outPropset.AddChild(outPropset3) ;

   Outputs.AddChild(outPropset);  

}
   // After looping if you want to convert Property set to XML use XML Converter Business Service

Sample Code for Format 2:
 // Declaration same as above
    {
   outPropset.SetType('SR'+x) ;
 outPropset.SetProperty("SRNumber", SR);
 outPropset.SetProperty("Status", Status);
 outPropset.SetProperty("Error", Error);
 Outputs.AddChild(outPropset);

}
   // After looping if you want to convert Property set to XML use XML Converter Business Service 
various methods that can be used with Property sets are.
  • AddChild
  • SetType
  • SetProperty
  • GetProperty
  • SetValue


Tuesday 16 August 2016

Array Variable in siebel eScript

Hello All,

While working with siebel eScript I got a requirement to use array for storing some variables.
Arrays work like normal JavaScript variable in siebel the difference is just in the declaration and the dimension.
Below code describes how to use array.

Sample code looked like.


      var Result= new Array();

      for(var x = 1; x <= 5; x++)
      {  
        // Dynamically assign value in Array variable
          Result[x] = x;
          Outputs.SetProperty('Output'+x,Result[x]);                                                            
      }

the oputput of this will be,
Output1 = 1
Output2 = 2
Output3 = 3
Output4 = 4
Output5 = 5

we can also declare multiple dimensional arrays also,


      var Result= new Array();
// or we can explicitly specify multi dimensional arrays var Result= new Array(x,y);

      for(var x = 1; x <= 5; x++)
      {  
        for(var y = 1; y <= 5; y++)
         {
        // Dynamically assign value in variable
          Result[x,y] = x+y;
          Outputs.SetProperty('Output'+x+y,Result[x,y]);
         }                                                        
      }


the oputput of this will be,
Output11 = 2
Output12 = 2
...
Output21 = 3
Output22 = 4
...
Output51 = 6
Output55 = 10

we can create hierarchical property sets from the outputs depending on the format we are required to return output.

for Creating Hierarchical property sets refer the post http://www.siebelfoundations.com/2016/08/working-with-property-sets-in-siebel.html

Monday 15 August 2016

How to work with input of Array Type in Siebel eScript

Hello All,

Recently I had a requirement wherein I was getting multiple values in inputs and had to use the values one by one in my code ,perform some calculation till all values have been read from input.
The requirement can be summarized as, suppose we are given 5 Service Request number in input and we are required to perform some operation on each of them.

  • We need a way to read each Service Request number individually
  • We need to parse the input based on a delimiter

In my case I was getting the input in format as : 1-12345;1-34566;3-78686;9-09867
Multiple SR numbers separated by semicolon( ; ) as delimiter.

first i had to use Vanilla Business Service

BS : Inbound E-mail Manager 
Method : GetTokens

to parse input text and convert input string in multiple SR numbers.
For more information on this BS please refer bookshelf.
https://docs.oracle.com/cd/E14004_01/books/eMail/eMail_BusServMeth3.html

then, Iterate my code number of time and each time store the output in a variable, since the number of SR in input is not fixed i had to user arrays to dynamically store output.

Sample code looked like.
function Service_PreInvokeMethod(MethodName, Inputs, Outputs)
{
    if (MethodName == 'GetSRNumber')
     {
      var Result= new Array();
      var Status = "";
      var SRInput = Inputs.GetProperty("SRInput");
      var NumberOfSR = Inputs.GetProperty("NumberOfSR");
      var Token = "";
      var oService = TheApplication().GetService("Inbound E-mail Manager");                                    
      var oInputs = TheApplication().NewPropertySet();
      var oOutputs = TheApplication().NewPropertySet();

 // call BS to parse input to separate Numbers

      oInputs.SetProperty("Delimiter", ";");
      oInputs.SetProperty("NumTokens", NumberOfSR);
      oInputs.SetProperty("Text", SRInput);
      oService.InvokeMethod("GetTokens", oInputs, oOutputs);
      for(var x = 1; x <= NumberOfSR; x++)
      {
         Token = oOutputs.GetProperty('Token '+x);
        // Dynamically assign value in variable
          Result[x] = Token;
          Outputs.SetProperty('SR'+x,Result[x]);
      }
 }
 return (CancelOperation);
}


here, NumberOfSR is the count of SR's in Input which we require to separate to individual SR, Result is a array in which we are storing values of SR Number
expression Outputs.GetProperty('Token '+x) this expression iterates in the loop for each instance i.e. for x =1 it is evaluated as
 Outputs.GetProperty("Token 1")
and for subsequent values of x as
 Outputs.GetProperty("Token 2")
 Outputs.GetProperty("Token 3")
 Outputs.GetProperty("Token 4"), here we are dynamically creating the variable based in the number of times we need to run loop.

The same way we are dynamically assigning values in Array,
expression Result[x]  this expression iterates in the loop for each instance i.e. for x =1 it is evaluated as
Result[1] 
and for subsequent values of x as
Result[2] 
Result[3]
Result[4]  
.
The output of this is











we can then fetch the values of SR Number from output or we can use Property set to create Hierarchical outputs as well.

for Creating Hierarchical property sets refer the post http://www.siebelfoundations.com/2016/08/working-with-property-sets-in-siebel.html


Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...