sqlstored-procedurestivoli

Netcool/OMNIbus SQL procedure not running\doing nothing


So i have a tool that call procedure. Tool looks like that:

call Attach_test('select TTID from alerts.status where Class in (73000,8891) and to_int(TTID) > 0 and ServerSerial in ($selected_rows.Serial)',[ $selected_rows.Serial ]); flush iduc;

it should get TTID (that field have only one of many selected alarms ) and array of server serials of selected alarms. Then all this data is transfered to SQL procedure that looks like:

declare
tempservser integer; k integer;
begin
for k = 1 to array_len(serserial) do
    begin
        set tempservser = serserial[k];
        update alerts.status set ParentTT = parentttid, TTFlag = 2 where ServerSerial = tempservser and TTID = '' ; 
    end;
end

Parameters:


And here comes the trouble - procedure do nothing. There is no errors or something but there is no update on selected alarms.

I want it to work like this - you select many alarms with only one that have TTID, run this tool that set ParentTT = TTID on every other of selected alarms. OS ver. 8.1

Sorry for my english


Solution

  • I figured out how to do it:

    Tool

    call AttachSelectedToTTID([ $selected_rows.Serial ],[ $selected_rows.ParentTT ]);
    flush iduc;
    

    Procedure

    declare
    tempservser integer; k integer;n integer;partt char(15);
    begin
    for n = 1 to array_len(ttid) do 
        begin
            if (ttid[n] != '' ) then
                set partt = ttid[n];
            end if;
        end;
    for k = 1 to array_len(serserial) do
        begin
            set tempservser = serserial[k];
            update alerts.status set ParentTT = partt,TTFlag = 2 where Serial = tempservser and TTID = '';  
        end;
    end
    

    Parameters: