Example SQL Query Scripts

This topic shows some example SQL queries that escriptporter.exe (eScript Porting tool) executes to extract the server-side scripts from the Siebel database.

Example SQL for Querying Application Events: The table owner and hard coded parameter values in the following example SQL for querying application events are replaceable.

DM_GET_APPL_ESCRIPT = 
  SELECT app.NAME,script.Name scriptName, script.SCRIPT 
  FROM S_APPL_SCRIPT script, 
       S_APPLICATION app 
  WHERE app.ROW_ID = script.APPLICATION_ID 
    AND script.PROG_LANG = 'JS'
    AND app.REPOSITORY_ID = (SELECT ROW_ID FROM DATAQ1.S_REPOSITORY WHERE NAME = 'Siebel Repository') 
    AND app.INACTIVE_FLG = 'N' 
    AND script.INACTIVE_FLG = 'N';  
 / 

Example SQL for Querying Applet Events: The table owner and hard coded parameter values in the following example SQL for querying applet events are replaceable.

DM_GET_APPLET_ESCRIPT = 
  SELECT applet.Name appletName,script.Name scriptName,script.SCRIPT
  FROM DATAQ1.S_APPL_WEBSCRPT  script,
       DATAQ1.S_APPLET applet
  WHERE script.APPLET_ID = applet.ROW_ID
    AND script.PROG_LANG = 'JS' 
    AND applet.REPOSITORY_ID = (SELECT ROW_ID FROM DATAQ1.S_REPOSITORY WHERE NAME = 'Siebel Repository') 
    AND applet.INACTIVE_FLG = 'N' 
    AND script.INACTIVE_FLG = 'N'; 
 / 

Example SQL for Querying Business Component Events: The table owner and hard coded parameter values in the following example SQL for querying business component events are replaceable.

DM_GET_BUSCOMP_ESCRIPT = 
  SELECT buscomp.NAME bcName,script.Name scriptName, script.SCRIPT
  FROM S_BUSCOMP_SCRIPT script, 
       S_BUSCOMP buscomp 
  WHERE buscomp.ROW_ID = script.BUSCOMP_ID 
    AND script.PROG_LANG = 'JS' 
    AND buscomp.REPOSITORY_ID = (SELECT ROW_ID FROM DATAQ1.S_REPOSITORY WHERE NAME = 'Siebel Repository') 
    AND buscomp.INACTIVE_FLG = 'N' 
    AND script.INACTIVE_FLG = 'N'; 
/ 

Example SQL for Querying Business Service Events: The table owner and hard coded parameter values in the following example SQL for querying business service events are replaceable.

DM_GET_SERVICE_ESCRIPT = 
  SELECT service.NAME svcName ,script.Name scriptName, script.SCRIPT 
  FROM S_SERVICE_SCRPT script, 
       S_SERVICE service 
  WHERE service.ROW_ID   = script.SERVICE_ID 
    AND script.PROG_LANG = 'JS'  
    AND service.REPOSITORY_ID = (SELECT ROW_ID FROM DATAQ1.S_REPOSITORY WHERE NAME = 'Siebel Repository') 
    AND service.INACTIVE_FLG = 'N' 
    AND script.INACTIVE_FLG = 'N'; 
/