Home » SQL & PL/SQL » SQL & PL/SQL » Need help in implementing this procedure using bulk collect (Oracle 11g)
Need help in implementing this procedure using bulk collect [message #582660] Sat, 20 April 2013 22:06 Go to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Can you please help me in implementing the below procedure with bulk collects.

CREATE OR REPLACE PACKAGE BODY "INTERNAL_SCORING_NANDU" IS
PROCEDURE InsertTrend(pBUID IN ORDER_TREND_SCORE.BUID%TYPE,
OrderNum IN ORDER_TREND_SCORE.ORDER_NUM%TYPE,
Variable IN ORDER_TREND_SCORE.TREND_VARIABLE%TYPE,
DeductPoints IN ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE,
FraudPct IN ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE,
FraudWkdPct IN ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE) IS
BEGIN
DELETE FROM order_trend_score WHERE BUID = pBUID AND ORDER_NUM = OrderNum AND TREND_VARIABLE = Variable; 
INSERT INTO ORDER_TREND_SCORE
(BUID,
ORDER_NUM,
TREND_VARIABLE,
DEDUCTION_POINTS,
FRAUD_PERCENTAGE,
FRAUD_WORKED_PERCENTAGE)
VALUES
(pBUID, OrderNum, Variable, DeductPoints, FraudPct, FraudWkdPct);
END InsertTrend;
/ 


Please help me.
Thanks in advance.
Re: Need help in implementing this procedure using bulk collect [message #582661 is a reply to message #582660] Sat, 20 April 2013 22:25 Go to previous messageGo to next message
BlackSwan
Messages: 22728
Registered: January 2009
Senior Member
below STILL applies

Michel Cadot wrote on Thu, 28 March 2013 04:56
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel

Re: Need help in implementing this procedure using bulk collect [message #582671 is a reply to message #582660] Sun, 21 April 2013 02:16 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
I am posting the table structure,data and test cases.
Please help me.How to implement the same procedure using bulk collect.
CREATE TABLE ORDER_TREND_SCORE
(
  BUID                     NUMBER(6)            NOT NULL,
  ORDER_NUM                VARCHAR2(18 CHAR)    NOT NULL,
  TREND_VARIABLE           VARCHAR2(400 CHAR)   NOT NULL,
  DEDUCTION_POINTS         INTEGER,
  FRAUD_PERCENTAGE         NUMBER(12,2),
  FRAUD_WORKED_PERCENTAGE  NUMBER(12,2)
);

Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'cid code: pc: R, cid:  ', 0, 0, 0.11);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'ship code: E', 1, 0, 0.1);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'source system flag: 1', 3, 0.01, 0.15);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'st address diff flag: N', 1, 0, 0.1);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'country code: US', 2, 0, 0.15);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'free email flag: Y', 4, 0.01, 0.19);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (11, '369873265', 'reason codes: OALTT', 0, 0, 0.14);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (1222, '310558263', 'age of account: 181-365', 0, 0, 0);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (2929, '640097475', 'product: POWERSUPPLY/AC/DC', 0, 0, 0);
Insert into ORDER_TREND_SCORE
   (BUID, ORDER_NUM, TREND_VARIABLE, DEDUCTION_POINTS, FRAUD_PERCENTAGE, FRAUD_WORKED_PERCENTAGE)
 Values
   (2929, '640097475', 'avs code: pc: N, avs:  ', 0, 0, 0);
COMMIT;


Test Cases:
If I pass the following values to the procedure

11, '369873265', 'cid code: pc: R, cid: ', 0, 0, 0.11

The record will be deleted from the table.


If I pass the following values to the procedure

12, '556873289', 'cid pc cid: ', 3, 2, 0.54

The record will be inserted into the table.

Thanks in advance.
Re: Need help in implementing this procedure using bulk collect [message #582672 is a reply to message #582671] Sun, 21 April 2013 02:28 Go to previous messageGo to next message
Michel Cadot
Messages: 58959
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you want to implement it with BULK COLLECT when you pass only ONE record?

Regards
Michel
Re: Need help in implementing this procedure using bulk collect [message #582674 is a reply to message #582672] Sun, 21 April 2013 03:45 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
It's inserting only one record.
But deleting millions of records.
And also this procedure is being called in other procedures.
This is also client requirement.
Please help me.
Re: Need help in implementing this procedure using bulk collect [message #582675 is a reply to message #582674] Sun, 21 April 2013 04:10 Go to previous messageGo to next message
Michel Cadot
Messages: 58959
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Once again, there is no place for BULK COLLECT here and the most important reason is that you collect nothing.

Regards
Michel
Re: Need help in implementing this procedure using bulk collect [message #582693 is a reply to message #582675] Sun, 21 April 2013 23:59 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Hi Michel,

As I informed earlier ,the procedure deleting millions of records.

I didn't mentioned that test case.

Please help me to implement with bulk collect.

Thanks.

Re: Need help in implementing this procedure using bulk collect [message #582695 is a reply to message #582693] Mon, 22 April 2013 00:14 Go to previous messageGo to next message
Littlefoot
Messages: 19541
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Generally speaking, regular delete will be faster than bulk delete. So, apart from the "client requirement", what other reason do you have so that you insist on bulk? (Suppose your client is a merchant - what does he know about Oracle technology? Why does he care? He wants the job to be done. It shouldn't be his concern whether you do it with delete, bulk delete, or little green Martians disintegrated these records).
Re: Need help in implementing this procedure using bulk collect [message #582696 is a reply to message #582693] Mon, 22 April 2013 00:20 Go to previous messageGo to next message
Michel Cadot
Messages: 58959
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
As I informed earlier ,the procedure deleting millions of records.


Yes but with a single DELETE not from loop.
- A single DELETEis faster than loop with BULK COLLECT + DELETE
- Loop with BULK COLLECT + DELETE is faster than loop with single FETCH + DELETE

AS I already told you, there is no place for BULK COLLECT here. Who should be too stupid to first SELECT some rows and then DELETE them and loop on this when he can do it with a single DELETE?

Regards
Michel
Re: Need help in implementing this procedure using bulk collect [message #582707 is a reply to message #582696] Mon, 22 April 2013 02:08 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
But the procedure is calling so many times in other procedure.
My client is telling use PL/SQL tables.

Please help me.
Re: Need help in implementing this procedure using bulk collect [message #582715 is a reply to message #582707] Mon, 22 April 2013 03:47 Go to previous messageGo to next message
Michel Cadot
Messages: 58959
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
We do it but you don't want to read us.
You cannot change the facts.

Quote:
But the procedure is calling so many times in other procedure.


The problem may be in these procedures NOT in this one.

Regards
Michel
Re: Need help in implementing this procedure using bulk collect [message #582737 is a reply to message #582715] Mon, 22 April 2013 06:17 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Hi Experts,

I have implemented using associative array.
But I am getting error PLS-00201: identifier 'I' must be declared.
What's wrong in my code.

CREATE OR REPLACE PACKAGE ram_package
IS
TYPE t_pBUID IS TABLE OF ORDER_TREND_SCORE.BUID%TYPE INDEX BY PLS_INTEGER;
TYPE t_OrderNum IS TABLE OF ORDER_TREND_SCORE.ORDER_NUM%TYPE INDEX BY PLS_INTEGER;
TYPE t_Variable IS TABLE OF ORDER_TREND_SCORE.TREND_VARIABLE%TYPE INDEX BY PLS_INTEGER;
TYPE t_DeductPoints IS TABLE OF ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE INDEX BY PLS_INTEGER;
TYPE t_FraudPct IS TABLE OF ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE INDEX BY PLS_INTEGER;
TYPE t_FraudWkdPct IS TABLE OF ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE INDEX BY PLS_INTEGER;

PROCEDURE InsertTrend(pBUID        IN t_pBUID,
                        OrderNum     IN t_OrderNum,
                        Variable     IN t_Variable,
                        DeductPoints IN t_DeductPoints,
                        FraudPct     IN t_FraudPct,
                        FraudWkdPct  IN t_FraudWkdPct);
END;
/

CREATE OR REPLACE PACKAGE BODY ram_package 
IS
PROCEDURE InsertTrend(pBUID        IN t_pBUID,
                        OrderNum     IN t_OrderNum,
                        Variable     IN t_Variable,
                        DeductPoints IN t_DeductPoints,
                        FraudPct     IN t_FraudPct,
                        FraudWkdPct  IN t_FraudWkdPct)
IS
BEGIN

FORALL i in pBUID.FIRST.. pBUID.LAST

 DELETE FROM ORDER_TREND_SCORE WHERE BUID = pBUID(i) AND ORDER_NUM = OrderNum(i) AND TREND_VARIABLE = Variable(i);       
        
    INSERT INTO ORDER_TREND_SCORE
      (BUID,
       ORDER_NUM,
       TREND_VARIABLE,
       DEDUCTION_POINTS,
       FRAUD_PERCENTAGE,
       FRAUD_WORKED_PERCENTAGE)
    VALUES
      (pBUID(i), OrderNum(i), Variable(i), DeductPoints(i), FraudPct(i), FraudWkdPct(i));
END InsertTrend;

Re: Need help in implementing this procedure using bulk collect [message #582739 is a reply to message #582737] Mon, 22 April 2013 06:20 Go to previous messageGo to next message
Michel Cadot
Messages: 58959
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is simply STUPID.

Regards
Michel
Re: Need help in implementing this procedure using bulk collect [message #583854 is a reply to message #582737] Mon, 06 May 2013 01:04 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Hi Experts,

I am providing the complete code and my exact requirement.

CREATE OR REPLACE PACKAGE INTERNAL_SCORING_RAM 
IS

PROCEDURE TrendScoring_ram(pBUID       IN STAGING_ORDER_DATA.BUID%TYPE,
                         OrderNum    IN STAGING_ORDER_DATA.ORDER_NUM%TYPE,
                         ReturnValue OUT VARCHAR2);
PROCEDURE InsertTrend_ram(pBUID        IN ORDER_TREND_SCORE.BUID%TYPE,
                        OrderNum     IN ORDER_TREND_SCORE.ORDER_NUM%TYPE,
                        Variable     IN ORDER_TREND_SCORE.TREND_VARIABLE%TYPE,
                        DeductPoints IN ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE,
                        FraudPct     IN ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE,
                        FraudWkdPct  IN ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE);
END;
/

CREATE OR REPLACE PACKAGE BODY INTERNAL_SCORING_RAM 
IS
PROCEDURE trendscoring_ram
 (pBUID  IN STAGING_ORDER_DATA.BUID%TYPE,
  OrderNum  IN STAGING_ORDER_DATA.ORDER_NUM%TYPE,
  ReturnValue OUT VARCHAR2) 
IS
    tCleanProdDesc  ORDERS.PRODUCT_DESC%TYPE;
    tLocalChannel   STAGING_ORDER_DATA.LOCAL_CHANNEL%TYPE;
    tSKUNum         STAGING_ORDER_DATA.SKU_NUM%TYPE;
    tDeductionPoints  TREND.DEDUCTION_POINTS%TYPE := 0;
    tFrdPct           TREND.FRAUD_TOTAL_PERCENTAGE%TYPE := 0;
    tFrdWkdPct        TREND.FRAUD_WORKED_PERCENTAGE%TYPE := 0;
    tCount          NUMBER := 0;
    tAVS            VARCHAR2(50);
    tScore          SCORE.VENDOR_COMBINED_SCORE%TYPE;
    tProdDesc       ORDERS.PRODUCT_DESC%TYPE;
   tPayCode        ORDERS.PAY_CODE%TYPE;
 BEGIN
   
  ReturnValue := 'get order header';
  
SELECT stgOrder.LOCAL_CHANNEL
      INTO tLocalChannel
      FROM STAGING_ORDER_DATA stgOrder
     WHERE stgOrder.BUID = pBUID 
     AND stgOrder.ORDER_NUM = OrderNum 
     AND stgOrder.ADDRESS_TYPE = 'B';

      SELECT ord.PRODUCT_DESC, 
            NVL (ord.SKU_NUM, ''),
            NVL (cc.AVS_CC_CODE, ''),
            NVL (s.VENDOR_COMBINED_SCORE, -1)
  INTO    tProdDesc,tSKUNum, tAVS, tScore
  FROM   MASTER_CURRENCY exchg,
               ORDERS ord
            LEFT OUTER JOIN
               (  SELECT   BUID,
                           ORDER_NUM,
                           MIN (AVS_CC_CODE) AS AVS_CC_CODE,
                           MIN (CID_CODE) AS CID_CODE
                    FROM   CREDIT_CARD
                   WHERE   BUID = pBUID AND ORDER_NUM = OrderNum
                GROUP BY   BUID, ORDER_NUM) cc
            ON ord.BUID = cc.BUID AND ord.ORDER_NUM = cc.ORDER_NUM
         LEFT OUTER JOIN SCORE s
         ON ord.BUID = s.BUID 
         AND ord.ORDER_NUM = s.ORDER_NUM
 WHERE   ord.CURRENCY_CODE = exchg.CURRENCY_CODE
         AND ord.BUID = pBUID
         AND ord.ORDER_NUM = OrderNum;
------SKU Num---------------------------------------------------------
     ReturnValue := 'sku Num';
   BEGIN

     SELECT DEDUCTION_POINTS,
             FRAUD_TOTAL_PERCENTAGE,
             FRAUD_WORKED_PERCENTAGE
        INTO tDeductionPoints, tFrdPct, tFrdWkdPct
        FROM TREND
       WHERE VARIABLE_NAME = 'sku num' AND
             UPPER(VARIABLE_VALUE) = tSKUNum AND BUID = pBUID AND
             LOCAL_CHANNEL = tLocalChannel
         AND DEDUCTION_POINTS IS NOT NULL;
         
    ReturnValue := 'product degredation';

         InsertTrend_ram(pBUID,OrderNum,'sku num: ' || tSKUNum,tDeductionPoints,tFrdPct,tFrdWkdPct);
         
EXCEPTION 
WHEN no_data_found THEN
 tCleanProdDesc := fn_cleanproddesc(UPPER(tProdDesc));
    ReturnValue := 'product degredation';

--product degredation---------------------------------------------------------

    BEGIN
    SELECT DEDUCTION_POINTS,
              FRAUD_TOTAL_PERCENTAGE,
              FRAUD_WORKED_PERCENTAGE
         INTO tDeductionPoints, tFrdPct, tFrdWkdPct
         FROM TREND
        WHERE VARIABLE_NAME = 'product' AND
             UPPER(VARIABLE_VALUE) = tCleanProdDesc 
         AND BUID = pBUID 
         AND LOCAL_CHANNEL = tLocalChannel
     AND DEDUCTION_POINTS IS NOT NULL;
       
       InsertTrend_ram(pBUID,OrderNum,'product: ' || tCleanProdDesc,tDeductionPoints,tFrdPct,tFrdWkdPct);
       
     EXCEPTION 
     WHEN no_data_found THEN
      NULL;
     END;
END;
 -----pay code--------------------------------------------------------------------
 ReturnValue := 'pay code';

    BEGIN
      SELECT DEDUCTION_POINTS,
             FRAUD_TOTAL_PERCENTAGE,
             FRAUD_WORKED_PERCENTAGE
        INTO tDeductionPoints, tFrdPct, tFrdWkdPct
        FROM TREND
       WHERE VARIABLE_NAME = 'payment code' AND VARIABLE_VALUE = tPayCode AND
             BUID = pBUID AND LOCAL_CHANNEL = tLocalChannel
              AND DEDUCTION_POINTS IS NOT NULL;

      InsertTrend_ram(pBUID,OrderNum,'pay code: ' || tPayCode,tDeductionPoints,tFrdPct,tFrdWkdPct);
EXCEPTION
WHEN no_data_found THEN
NULL;
END;
--ship code--------------------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum,'ship code: ' || tShipCode,tDeductionPoints,tFrdPct,tFrdWkdPct);

--source system flag----------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum, 'source system flag: ' || tSrcSys,tDeductionPoints,tFrdPct,tFrdWkdPct);
 
 --st address diff flag--------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum, 'st address diff flag: ' || tSTDiff,tFrdPct,tFrdWkdPct);
---inserttrend_ram procedure calling 70 times 
END  trendscoring_ram;

PROCEDURE InsertTrend_ram (
   pBUID          IN ORDER_TREND_SCORE.BUID%TYPE,
   OrderNum       IN ORDER_TREND_SCORE.ORDER_NUM%TYPE,
   Variable       IN ORDER_TREND_SCORE.TREND_VARIABLE%TYPE,
   DeductPoints   IN ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE,
   FraudPct       IN ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE,
   FraudWkdPct    IN ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE
)
IS
BEGIN
   
DELETE FROM  ORDER_TREND_SCORE WHERE  BUID = pBUID AND ORDER_NUM = OrderNum AND TREND_VARIABLE = Variable;

   INSERT INTO ORDER_TREND_SCORE (BUID,
                                  ORDER_NUM,
                                  TREND_VARIABLE,
                                  DEDUCTION_POINTS,
                                  FRAUD_PERCENTAGE,
                                  FRAUD_WORKED_PERCENTAGE)
     VALUES   (pBUID,
               OrderNum,
               Variable,
               DeductPoints,
               FraudPct,
               FraudWkdPct);
END InsertTrend_ram;
END;
/


In my code the procedure "trendscoring_ram" is calling "inserttrend_ram" procedure 70 times
for different variable values.

Instead of calling the "inserttrend_ram" procedure 70 times.
I want to hold the values in a associative array , defining it in package and call that procedure only once.
As below.

Inserttrend_ram(pBUID, OrderNum, Associativearray, Associativearray, Associativearray,Associativearray);

For that I have tried the following but it's not working.

IN the package I have declared the associative array like this.

TYPE type_ots IS TABLE OF ORDER_TREND_SCORE%ROWTYPE INDEX BY PLS_INTEGER;

I have modified the inserttrend_ram as below.

PROCEDURE InsertTrend_ram(
                            P_TYPE_OTS_REC IN type_ots
                           )
        IS
        BEGIN
            FORALL i in P_TYPE_OTS_REC.FIRST.. P_TYPE_OTS_REC.LAST
              DELETE
                FROM ORDER_TREND_SCORE
                WHERE BUID = P_TYPE_OTS_REC(i).BUID
                  AND ORDER_NUM = P_TYPE_OTS_REC(i).ORDER_NUM
                  AND TREND_VARIABLE = P_TYPE_OTS_REC(i).TREND_VARIABLE; 
                  
            FORALL i in P_TYPE_OTS_REC.FIRST.. P_TYPE_OTS_REC.LAST
              INSERT INTO ORDER_TREND_SCORE(
                                            BUID,
                                            ORDER_NUM,
                                            TREND_VARIABLE,
                                            DEDUCTION_POINTS,
                                            FRAUD_PERCENTAGE,
                                            FRAUD_WORKED_PERCENTAGE
                                           )
              VALUES(
                     P_TYPE_OTS_REC(i).BUID,
                     P_TYPE_OTS_REC(i).ORDER_NUM,
                     P_TYPE_OTS_REC(i).TREND_VARIABLE,
                     P_TYPE_OTS_REC(i).DEDUCTION_POINTS,
                     P_TYPE_OTS_REC(i).FRAUD_PERCENTAGE,
                     P_TYPE_OTS_REC(i).FRAUD_WORKED_PERCENTAGE
                    );
END InsertTrend_ram;


Please help me.

Thanks in advance.
Re: Need help in implementing this procedure using bulk collect [message #584025 is a reply to message #583854] Wed, 08 May 2013 00:51 Go to previous message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Hi,

Any body please help me.

Thanks.
Previous Topic: SP2-0552: Bind variable "NEW" not declared.
Next Topic: Index Unused state
Goto Forum:
  


Current Time: Wed Sep 03 01:40:47 CDT 2014

Total time taken to generate the page: 0.11560 seconds