Looking for an SQL query to retreive callvariables + ECC from a RUN SCRIPT RESULT (Translation to VRU)

Hi Team,
I am looking for an SQL query to check the data (ECC + CallVariable) received following a RUN SCRIPT RESULT when requesting an external VRU with a Translation Route to VRU with a "Run External Script".
I believe the data are parsed between the Termination Call Detail + Termination Call Variable .
If you already have such an SQL query I would very much appreciate to have it.
Thank you and Regards
Nick

Omar,
with all due respect, shortening a one day's interval might not be an option for a historical report ;-)
I would recommend to take a look the following SQL query:
DECLARE @dateFrom DATETIME, @dateTo DATETIME
SET @dateFrom = '2014-01-24 00:00:00'
SET @dateTo   = '2014-01-25 00:00:00'
SELECT
tcv.DateTime,
tcd.RecoveryKey,
tcd.RouterCallKeyDay,
tcd.RouterCallKey,
ecv.EnterpriseName AS [ECVEnterpriseName],
tcv.ArrayIndex,
tcv.ECCValue
FROM Termination_Call_Variable tcv
JOIN
(SELECT RouterCallKeyDay,RouterCallKey,RecoveryKey FROM Termination_Call_Detail WHERE DateTime > @dateFrom AND DateTime < @dateTo) tcd
ON tcv.TCDRecoveryKey = tcd.RecoveryKey
LEFT OUTER JOIN Expanded_Call_Variable ecv ON tcv.ExpandedCallVariableID = ecv.ExpandedCallVariableID
WHERE tcv.DateTime > @dateFrom AND tcv.DateTime < @dateTo
With variables, you can parametrize your code (for instance, you could write SET @dateFrom = ? and let the calling application fill in the datetime value in for you).
Plus joining two large tables with all rows like you did (TCD-TCV) is never a good option.
Another aspect to consider: all ECC's are actually arrays (always), so it's not good to leave out the index value (tcv.ArrayIndex).
G.

Similar Messages

  • Looking for and SQL query to match CTI OS agent login ID with the Directory Number (instrument)

    Hi All,
    I am looking for an SQL query to request the HDS database to find out which Directory Number / instrument  was associated with a specific CTI OS agent login ID.
    Has anyone done such a query before ?
    Thanks and Regards
    Nick

    Hi,
    this should work in 8.0 and 8.5:
    SELECT
    ag.PeripheralNumber AS [LoginID],
    al.Extension,
    al.LogoutDateTime
    FROM [instance]_hds.dbo.Agent_Logout al
    JOIN [instance]_awdb.dbo.Agent ag ON al.SkillTargetID = ag.SkillTargetID
    Of course, replace [instance] with the ICM instance.
    The query returns a table with three columns, first is the login ID aka PeripheralNumber, Extension is... well, the agent's extension, and LogoutDateTime is the timestamp when the agent logged out.
    G.

  • Looking for a SQL query to get all the possible Alert Messages from the Rules in a Management Pack

    For reporting, I'm looking to get a SQL query of all the possible Alert Messages for Rules configured in a Management Pack (not necessarily the ones that have thrown alerts).  I can do this for Monitors, but not for Rules. 
    The configured alert messages for the Management Pack Monitors
    go like this:  ManagementPack > MonitorView> RuleModule > RuleModule.Alert Message > Localized Text
    The configured alert messages for the Management Pack Rules
    should go something like this, but there is a missing link:  ManagementPack > RuleView > RuleModule > ? Missing Link ? > Localized Text
    The Rules are tied to the Module, but I don't see a connection from the RulesModule to the Alert Message that I see in the LocalizedText. The Rule names do not always equal the Alert name. 
    Can someone provide the missing link?

    Hi,
    please try below powershell code to find the corresponding management pack for specific alert:
    $Alert = get-scomalert | where {$_.Name -like 'Agent Proxy Not Enabled*'} | select -first 1
    If ($alert.IsMonitorAlert -eq "True") {
    write-host "Ths is a monitor-generated alert"
    get-scommonitor -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    else
    write-host "This is a rule-generated alert"
    get-scomrule -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    In addition, please also refer to the below link:
    http://blogs.technet.com/b/mazenahmed/archive/2011/12/02/using-powershell-to-map-opsmgr-active-alert-to-its-corresponding-rule-monitor-and-management-pack-name.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • How to find out which Tables have been accessed without looking at the SQL query ?

    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]
    null

    PRECISE/SQL can help you if you have access to it
    2nd option can be that turn on SQL_TRACE
    Run executable of ur c++ program
    it will create a trace file in user_dump_dest
    and then using TKPROF u can see all quesries and their plan also.
    HTH
    Gagan Deep Singh
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by (jagdeeps):
    Hi,
    I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
    I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
    has the most recently executed queries, but
    I did'nt see any queries connected to my process.
    Could anybody help me on this ?
    Thanks
    Jagdeep
    [email protected]<HR></BLOCKQUOTE>
    null

  • I am looking for a sql analyzer tool.

    I am looking for a sql analyzer tool that can analyze the speed of two queries...

    You mean like autotrace, set timing on, or alter session set events '10046 trace name context forever, level 12' , or you can write your own test harness. Depends upon what you want, exactly. Wall time, cpu time, average over 100 executions? Max time during busiest time of day in the database. Min time during quietest time of day in the database.
    A simple test harness like this might be sufficient.
    declare
    l_start number;
    begin
    l_start := dbms_utility.get_time;
    -- do your query here
    dbms_output.put_line( (dbms_utility.get_time-l_start) || ' hsecs' );
    end;
    Edited by: ajallen on Jan 12, 2010 11:28 AM

  • Looking for a SQL statement

    Looking for a sql statement that returns me one row which is made up of data of two rows but display it side by side instead of one row followed by other row.
    e.g
    Col1
    1
    2
    2 Rows selected
    How can i display it as
    Col1
    1 2
    1 Row selected
    Appreciate any responses.
    TIA
    DS
    null

    How to find the last sql statement executed in oracle .
    thanks
    B.B.Padhi
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by SANJAY KUMAR ([email protected]):
    i have table san with column rl having values 11, 12. Then write the SQL as:
    select a.rl, n.rl from san a,( select b.rl from san b where b.rl in (select rl from san) ) n
    where a.rl < n.rl;
    It will give u approprate result.
    Thanks!<HR></BLOCKQUOTE>
    null

  • Looking for MS SQL Server(2012 or older versions) all commands

    HI,
    Looking for MS SQL Server(2012 or older versions) all commands, i.e., all available sql server commands.
    Is there any reference manual or MS KL to get all commands in SQL Server ?
    Thanks in advance

    Thanks for link
    Sean Gallardy and Jingyang Li.
    This is is not usefull for my requirement.
    What i am looking is..SQL Server commands  like examples... DDL/DML comands...create/alter
    Examples: Insert/update/delete,truncate.......etc
    Create database,create procedure.......etc
    Alter database,shutdown,drop,create....etc
    Looking for list of all commands in one place/doc in SQL Server.
    Thanks

  • Looking for a solution or service to export data from a dynamic form into a database

    As the title of this discussion states, I'm looking for a solution or service to export data from a dynamic form into a database to be used for reporting. Creating the dynamic form is not a problem, it's getting it into a database that's more of a nuisance. A dynamic form is needed in order to provide skip logic, hide/reveal, and other similar dynamic features.
    The database hasn't been created, so just looking for the easiest, more effective and dependable solution. The key is being able to run reports off the data later.

    So i set up 2 residential grade routers to test this out. Seems to be working okayish. I believe with directional antenae routers I should achieve what I need.
    As for security I configured each device separately. I set them so only allow the MAC address of the other through wireless. This seems to be the best system for me. Once they are connected even if a MAC is spoofed of the other router it drops automatically because they are always connected. My wired devices get plugged in and recieve an IP from my main network.
    There more testing to be done, but it seems to be working.
    Thanks for your input and suggestions guys. I will be marking this topic as answered.

  • Looking for Captivate (30-day trial or monthly CreativeCloud) that will run on Mac OS 10.6.8.

    Looking for Captivate (30-day trial or monthly CreativeCloud) that will run on Mac OS 10.6.8. (Currently downloadable version only runs on OS 10.9 and I don't want to upgrade OS (causes other problems). What to do?

    Hi There,
    Would request you to reach out our support by which we can provide you the download links and install instructions for earlier version of Captivate which is compatible with your Mac OS 10.6.8.
    You can contact us on 800-833 6687 follow IVR options 2 > 4 > 2 or can also chat with us by clicking on the following link :- Contact Customer Care
    Regards,
    Ajit

  • Update Field On Change For A SQL Query (updateable report)

    Hi,
    I'd like to request help from anyone with ideas on how to solve this.
    We are using APEX 4.2, 10GR2, RedHat5.
    I have a report that comes from SQL Query (updateable report).
    I'm using the apex_item.text and apex_item.hidden on fields.
    I'm using a button to submit and after submit process to add some logic that I need.
    There could be 1 - 10 records in the report.
    There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
    I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
    This is the question
    When the value of that field is changed then the value of another field in the same row changes immediately.
    Is this possible?
    All the examples I've seen so far are for a single record and that doesn't work for us.
    I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
    Could anyone direct me to where I can see an example or help me get directions?
    I appreciate all your help an comments and I thank you in advance.

    Yes why not...what you looking for is a ajax call
    See {message:id=10390979}
    Please note:-you can also do this as a dynamic action as shown below
    Event: Change
    Selection type: jQuery Selector
    jQuery Selector: input[name="f01"]
    True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this

  • Dashboard Prompt - Getting error for Adding SQL query in "Default to"

    Hello Oracle,
    I am facing some problem in Dashboard Prompt. Like when i add some sql query in "Default to" in Dashboard prompt and for the next prompt when i check for Contrain option i get error in the second prompt. but it works fine when i hard-code a value in "Default to" options.
    For Example:
    Like when we consider a two prompts :
    1) Year -> (In Default to i select SQL Query and enter the query as SELECT "YTD Dim"."Fiscal Year" FROM "YTD Report" WHERE "YTD Dim"."Fiscal Year" = Year(Current_Date)
    2) Business Unit -> (In specific value i give as some hard code value of Business Unit and check the contrain option)
    i get error as
    Business Unit
    Error Generating Drop Down Values
    A numeric value was expected (received "SELECT "YTD Dim"."Fiscal Year" FROM "YTD Report" WHERE "YTD Dim"."Fiscal Year" = Year(Current_Date)"). Error Details
    Error Codes: EHWH2A7E
    but i get correct value for Year as 2011.
    I need to use SQL query in default to option and need to check the constrain option too.
    Looking for positive feedback.

    You need to create a dashboard prompt and in Default To -> select SQL Results
    Click on the ... (three dots ) underneath it and put in your sql
    For Example , I have a Table called "Sales Date" in my "ABC" presentation folder. This has a column called "Year" and "Date". If I want to have a Year prompt with the default value set to current year, here is what the syntax of my sql result will be :-
    SELECT "ABC"."Sales Date".YEAR
    FROM "ABC"
    WHERE "Date" = current_date
    In SQL, we cannot put SQL as we know of in terms of Oracle, Sql Server etc. The SQL here refers to sql as OBIEE understands it and should be in the form of Select "Presentation foler"."Table Name".ColumnName from "Presentation Folder"
    Hope this helps

  • Looking for gaps (SQL, not PL/SQL)

    Hi,
    This is a SQL (not PL/SQL) question.
    Let's say I have the following table:
    COLtype          COLnumber
    AA               1
    AA               2
    AA               4
    AA               5
    BB               1
    BB               2
    BB               3
    BB               5
    CC               1
    CC               5
    How do I find all gaps? I expect a result:
    COLtype          COLnumber
    AA               3
    BB               4
    CC               2
    CC               3
    CC               4
    I tried to use query:
    SELECT COLnumber + 1, COLtype FROM table a1
    WHERE NOT EXISTS (
    SELECT NULL FROM table a2
         WHERE
    a1.COLtype = a2.COLtype
    and (a2.COLnumber = a1.COLnumber + 1)
    but I received as result:
    COLtype          COLnumber
    AA               3
    AA               6
    BB               4
    BB               6
    CC               2
    CC               3
    CC               4
    CC               6
    Any other solutions, ideas?
    Thanks in advance!
    Gaspar
    Edited by: 985540 on 2013-02-01 02:59

    First let define gaps. If we have:
    COLtype COLnumber
    AA      3
    AA      4Are:
    COLtype COLnumber
    AA      1
    AA      2missing? If so is there an assumption COLnumber always starts with 1 or we just looking for gaps between existing numbers? For now I'll assume we are looking for gaps between existing numbers. Then:
    with t as (
               select  coltype,
                       colnumber,
                       lag(colnumber,1,colnumber - 1)
                         over(
                              partition by coltype
                              order by colnumber
                             ) prev_colnumber
                 from  tbl
    select  coltype,
            colnumber - column_value colnumber
      from  t,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level < colnumber - prev_colnumber
                       as sys.OdciNumberList
      where colnumber - prev_colnumber > 1
      order by coltype,
               colnumber
    CO  COLNUMBER
    AA          3
    BB          4
    CC          2
    CC          3
    CC          4
    SQL> explain plan for
      2  with t as (
      3             select  coltype,
      4                     colnumber,
      5                     lag(colnumber,1,colnumber - 1)
      6                       over(
      7                            partition by coltype
      8                            order by colnumber
      9                           ) prev_colnumber
    10               from  tbl
    11            )
    12  select  coltype,
    13          colnumber - column_value colnumber
    14    from  t,
    15          table(
    16                cast(
    17                     multiset(
    18                              select  level
    19                                from  dual
    20                                connect by level < colnumber - prev_colnumber
    21                             )
    22                     as sys.OdciNumberList
    23                    )
    24               )
    25    where colnumber - prev_colnumber > 1
    26    order by coltype,
    27             colnumber
    28  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 1739894384
    | Id  | Operation                            | Name | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                     |      | 81680 |  2552K|       |   991   (1)| 00:00:12 |
    |   1 |  SORT ORDER BY                       |      | 81680 |  2552K|  3216K|   991   (1)| 00:00:12 |
    |   2 |   NESTED LOOPS                       |      | 81680 |  2552K|       |   277   (1)| 00:00:04 |
    |*  3 |    VIEW                              |      |    10 |   300 |       |     4  (25)| 00:00:01 |
    |   4 |     WINDOW SORT                      |      |    10 |   170 |       |     4  (25)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL               | TBL  |    10 |   170 |       |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |   6 |    COLLECTION ITERATOR SUBQUERY FETCH|      |  8168 | 16336 |       |    27   (0)| 00:00:01 |
    |*  7 |     CONNECT BY WITHOUT FILTERING     |      |       |       |       |            |          |
    |   8 |      FAST DUAL                       |      |     1 |       |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter("COLNUMBER"-"PREV_COLNUMBER">1)
       7 - filter(LEVEL<:B1-:B2)
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement (level=2)
    25 rows selected.
    SQL> SY.

  • Looking for a best query for multiple IF Else statement in a single select

    Hi
    I want to run multiple IF Else statements in a single select SQL, each statement is one SQL operating on the same table, what is the best way to write this select SQL query ?
    If it is PL/SQL, when i get the result from the first IF statement I will skip the remaining execution, and so on... Can any one help me on this.
    Thanks in advance !!

    965818 wrote:
    I Apologize, the information i have given might not be enough.
    This is my scenario,
    I am selecting set of rows from the table for the employee id. After selecting those records,
    i need to go through the result list and check the condition 1, if it is met, i will return that employee record.
    If that condition 1 is not met, then i need to go through the condition 2. If that is met, i will return that record.
    Like wise, i have four conditions.
    I am trying to achieve this in a single sql. If i am not clear, please let me know.Not fully clear yet, but the picture is better already. The thing with SQL is that you should stop thinking procedurally. Instead think in data sets.
    For example if the task is:
    Find all managers that work in sales.
    Procedural thinking would work like this:
    pseudo code
    Loop over all employees that work in sales
       for each row
           check if it is a manager
               if manager
                  then return record
               else
                  do nothing
               end
    end loopThinking in datasets will result in a different logic
    pseudo code
    select all employees
    where department = SALES
    and job = MANAGERThis advantage here is that all the "Do nothing" loops are not needed. Those are already eliminated by the database.
    So what is needed to help you? Give the full picture. What is your task that you try to solve. From a business perspective.

  • How to pass a variable for a SQL query in OLEDB source?

    Hi All,
    I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
    eg:
    1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
    2) I have the file Name in a variable called Variable1.
    3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
    Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
    the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
    Any help/suggestions would be of great help.
    Thanks,
    Sri

    Just to add with Vaibhav comment .
    SQL Command  : SQL query either with SQL variable or any condition  or simple Sql statement
    Like ;
    Select * from dimcustomer
    SQL Command using Varible :
    Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
    If you Sql query needs a condition based on SSIS variable .
    you can find a Example here :
    http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
    http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Visual Web - How to 'setObject' for an SQL query with an IN  ? clause

    Hello, I am relatively new to visual web pack. I am stuck at writing the java code for passing parameters to the SQL query. In a normal scenario, where we need to check if some variable is present in a column (= ?), we would pass the parameter as :
    setObject(1, whatevervalue);
    How do we pass parameters if we need to check for more than one variable? The query editor in VWP has the option IN, which allows us to check for more than one match in a column. The IN clause is supposed to allow the format ('ex1', 'ex2' ...). I tried using an array as a parameter, like, setObject(1, somearray). It gives me a null exception. I even tried sending a variable in ('ex1', 'ex2' ...) format; doesn't like it either.
    Any help is greatly appreciated.

    Check the following docs:
    http://www.netbeans.org/kb/60/web/databoundcomponents.html
    http://www.netbeans.org/kb/60/web/inserts-updates-deletes.html
    See also:
    http://developers.sun.com/jscreator/reference/techart/2/query-editor.html

Maybe you are looking for

  • Dynamic data flow from sales order to delivery and vice-versa

    Hi Experts, One of our teams working for a client (transportation industry) on ECC 6.0 is facing an issue in relation to copying of partner data. (Ship-to-party address field changes to be precise) Currently, whenever the partner address data changed

  • Document Restriction Interactive Form

    Hey guys i have generate an Interactive Form like  the ABAP Program FP_TEST_IA_01. Now we try to "configure"  the PDF restrictions over the structure sfpoutputparams (parameter PDFCHANGESRESTRICTED). Our problem is, that the generated PDF doesn't all

  • S651 and 180W PSU, is it enough?

    I have 180W PSU that's powering up my P4 1.8 system. Complete specs: P4 1.8 @ 2.4 MS-6533 256 Kingston GA-Maya R9000Pro 64Mb 2 Maxtor 7200 rpm HDD (80 & 20 Gb) 8x4x32 (old) Sony cdrw a floppy drive PCI Winfast Tv tunner. Logitech optical usb mouse MS

  • Data Insertion in BPC.

    Dear Experts! I am New to BPC. I have a Data file something like below: Account,Entity,Category,Time,Amount Bills,Inr,Budget,2009.Jan,777 Here, "Amount" is taking only "numeric" values. Can i enter "Characters" for Amount. Is there any other way to e

  • WRTU54G-TM not keeping its IP address, generally being annoying

    I bought a Linksys WRTU54G-TM for the TMobile @Home service.  Setting it up is proving to be absurdly frustrating because the webbased interface refuses to acknowledge that I have given it an IP address.  I set the IP to 192.168.1.20, static IP, conf