Update real time account general data into a custom table

Hi,
I have created a z table for storing account general data for some business requirement. I have created a program and executing batch job to update this z table on periodic basis. Can anyone suggest some other alternative solution to update this z table whenever an account gets created/modified in CRM system? Instead of running a batch job periodically, I need a real time replication of the account data in this custom table.
Thanks and Regards,
Sneha.

Hi,
Thanks for your reply.
But, Can you elaborate the solution, Can we use Business Transaction Events(BTEs) for updating Partner data? Will these be triggered for Account Creation/Modification. If so, Can u suggest any BTE which can be used for my requirement?
Thanks and Regards,
Sneha.

Similar Messages

  • Urgent help needed in inserting data into a custom table in oracle WorkFlow

    Hi
    I am trying to get data from the WF and insert into a custom table..
    I read that workflow procedures WONT allow commits...
    Oracle Workflow will not support autonomous commits in any procedure it calls directly. If you need to perform commits, then embed your SQL in a subprocedure and declare it as an autonomous block. This subprocedure must be capable of being rerun. Additionally, note that Oracle Workflow handles errors by rolling back the entire procedure and setting its status to ERROR. Database updates performed by autonomous commits cannot be rolled back, so you will need to write your own compensatory logic for error handling
    Have anyone did this..
    Please give me some idea ...It is urgent
    I am getting data using getitemattribute..and try to insert it into a custom table
    thanks
    kp

    Pl do not post duplicate threads - insert dont work in Workflow
    Srini

  • Adding data into a custom table through a report transaction

    Is it possible to add data into a table through a report transaction. I have been asked to create a report in which when we add certain data in the selkection screen it updates thoses particular fields and the rest of the records can be fille dout in the output. Basically I have a customised allocation table called zalloc. I have to create a report with selection screen having receiving plant, material document of the original transfer psoting , issuning plant , line item number , batch, receiving and issuning storage location. I need to validate this against the mseg table and whatever entry I make in teh selection screen should update my zalloc table from here.
    Can anyone help me with this please.
    Thanks

    Hi Aarav,
    Yes, It is possible to add records to a table using a report transaction. You can use Update or Modify to insert records in a table.Convert the data fetched from the ZALLOC and convert it into an internal table of the same format as that of the ZALLOC table and simply do an
    loop at itab_zalloc into wa_zalloc.
    *INSERT INTO ZALLOC FROM WA_zalloc*.
    endloop.
    OR
    INSERT ZALLOC FROM TABLE ITAB_ZALLOC
    OR
    UPDATE ZALLOC FROM TABLE ITAB__ZALLOC .
      Update will modify if that record exist and returns sy-subrc as non zero if entry does not exist.
    OR
    MODIFY updates an existing DB entry or, in no matching entry exists, inserts a new entry into the DB table

  • Custom PL/SQL API that inserts the data into a custom interface table.

    We are developing a custom Web ADI integrator for importing suppliers into Oracle.
    The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
    Defined the 'Document Row' import rule and added the rows that would identify the unique record.
    Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
    The source of this parameter is import.vendor_name
    We have also defined an Error lookup.
    After the above setup is completed, we invoke the create document and click on Oracle->Upload.
    The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'

    The same issue.
    Need help.
    Also checked bne.log, no additional information.
    <bne:document xmlns:bne="http://www.oracle.com/bne">
    <bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
    <bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
    <bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
    bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
    bne:action="" bne:source="BneAPIImporter" >
    <bne:context bne:collection="collection_1" />
    </bne:message><bne:message bne:type="STATUS"
    bne:text="No rows uploaded" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message>
    <bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message></bne:document>

  • Sql/Plsql code to export data into a temporary table from a text file

    Dear all,
    I need to create a temporary table getting data from a text file. I am very new to data loading could you please help me how to read the text file in to a temporary table.
    i have text file like as below:
    order items : books Purchasing
    start date:
    8-11-09
    Notes: Books are selling from aug10 to aug 25
    Action performed
    Time
    Verified By
    sold out from shop, sold out date:_________
    1.
    physics _______ book sold to ravi
    2.
    social _______ book this is a good book
    sold to kiran
    aug10th
    ronald
    3.
    maths book to sal
    4.
    english book__________ this was a newbook
    to raj
    jak
    return to shop, return date:____________
    1.
    maths book return by:_____________ Verify book
    aug11th
    john
    2.
    story book by:_________ checked
    aug14th
    Now i need to create a temporary table and insert the data into the table from this text file.
    Now i need to create a temporary table named as books_order with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Order     status     Action_Performed     Time     Verified_By
    books Purchasing     sold     physics _______ book sold to ravi     _______     _________
    books Purchasing     sold     social _______ book this is a good book sold to kiran aug10th     ronald
    books Purchasing sold     maths book to sal     _____     __________
    books Purchasing     sold     english book__________ this was a newbook to raj __________     jak
    books Purchasing return     maths book return by:_____________ Verify book aug11th     john
    books Purchasing     return     story book by:_________ checked aug14th     _________
    Thanks in advance.

    Isn't school work marvelous?
    Create an external table.
    http://www.morganslibrary.org/reference/externaltab.html
    Getting the data into a temporary table may make sense in SQL Server ... but not in Oracle.

  • Drop, create and insert data into few intermediate tables

    Hi All,
    I need to schedule a process to drop, create and insert data into few intermediate tables on a weekly basis. Here is what i need to do in the stored procedure, which can be scheduled weekly.
    DROP TABLE TABLE_NAME1;
    DROP TABLE TABLE_NAME2;
    DROP TABLE TABLE_NAME3;
    CREATE TABLE TABLE_NAME1
    CREATE TABLE TABLE_NAME2
    CREATE TABLE TABLE_NAME3
    INSERT INTO TABLE_NAME1 SELECT ....;
    INSERT INTO TABLE_NAME2 SELECT ....;
    INSERT INTO TABLE_NAME3 SELECT ....;
    Any suggestions, examples or code on how to accomplish this task would be very helpful. Any question pls let me know.
    Thanks in advance.

    I am using the intermediate tables in an extract process. The idea was that the table would be created prior to calling the extract procedure and once the data written to the intermediate table had been processed the table would be dropped. This would be repeated each time the extract process is run. From a DBA's point or view, would it be better to just leave the table on the database and truncate it after each run or is removing it entirely best?

  • Displaying the data into the UI tables

    Hello Experts,
    I am new to web dynpro ABAP and I have created the tree with two UI tables(table1 and table2) by using web dynpro ABAP and want to display the data into both the UI tables at the same time just by one click on the item node of the tree.
    presently I am able to display the data as follows
    1. when I click on the item node the relevant data for the item  appears into table1, but not into table2
    2. when I  select the row of table1 then the revlevant data for item appears into table2.
    like this i can able to dispaly the data into both the table.
    My Question.
    how  to display the data at the same time into both the tables table1 and table2 just by one click
      on the item node.
    please help
    Thanks in advance
    Regards,
    fahad.

    Hi,
    I am able to invoke the method before the taskflow.
    But it is giving me the exception as *"UI Component is Null"* .
    The value of the table which I am using to display the data is coming as Null.
    Please let me know what could be the issue and how to solve this.

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • Can i use one interface to load data into 2 different tables

    Hi Folks,
    Can i use one interface to load data into 2 different tables(same schema or different schemas) from one source table with same structure ?
    Please give me advice
    Thanks
    Raj
    Edited by: user11410176 on Oct 21, 2009 9:55 AM

    Hi Lucky,
    Thanks for your reply,
    What iam trying is ...Iam trying to load the data from legacy tables(3) into oracle staging tables.But i need to load the same source data into two staging tables(these staging tables are in two different schemas)
    can i load this source data into two staging tables by using single standard interface(some business logic is there)
    If i can then give me some suggestion how to do that
    Thanks in advance
    Raj

  • How to read a table and transfer the data into an internal table?

    Hello,
    I try to read all the data from a table (all attribute values from a node) and to write these data into an internal table. Any idea how to do this?
    Thanks for any help.

    Hi,
    Check this code.
    Here i creates context one node i.e  flights and attributes are from SFLIGHT table.
    DATA: lo_nd_flights TYPE REF TO if_wd_context_node,
            lo_el_flights TYPE REF TO if_wd_context_element,
            ls_flights TYPE if_main=>element_flights,
            it_flights type if_main=>elements_flights.
    navigate from <CONTEXT> to <FLIGHTS> via lead selection
      lo_nd_flights = wd_context->get_child_node( 'FLIGHTS' ).
    CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE
      IMPORTING
        TABLE  = it_flights.
    now the table data will be in internal table it_flights.

  • Data from a file need to be read and mapped  into a custom table of R/3

    Hello all,
    This is related to inbound to  SAP ECC via SAP PI.
    There is a requirement concerning PI part that data from a file need to be read and mapped  into a custom table of R/3.
    To have this scenario developed , do we have any other  option than the Proxy ?
    My understanding is as follows : File --> SAP PI --> Proxy
    You suggestions are welcome.
    Regards,
    Rachana

    Hi Ravi,
    As suggested by Inaki, you can use proxy communication in recever.
    but you can also use the below
    FILE -----> PI -------> PROXY
                                  RFC
                                  IDOC
    to communicate to ECC system.
    Regards
    srinivas

  • Writing a stored procedure to import SQL Server table data into a Oracle table

    Hello,
    As a new DBA I have been tasked with writing a stored procedure to import SQL Server table data into an Oracle table. I have been given many suggestions on how to do it from SQL Server but I I just need to write a stored procedure to run it from the Oracle side. Suggestions/guidance on where to start would be greatly appreciated! Thank you!
    I started to write it based on what I have but I know this is not correct :/
    # Here is the select statement for the data source in SQL Server...
    SELECT COMPANY
    ,CUSTOMER
    ,TRANS_TYPE
    ,INVOICE
    ,TRANS_DATE
    ,STATUS
    ,TRAN_AMT
    ,CREDIT_AMT
    ,APPLD_AMT
    ,ADJ_AMT
    ,TRANS_USER1
    ,PROCESS_LEVEL
    ,DESCRIPTION
    ,DUE_DATE
    ,OUR_DATE
    ,OUR_TIME
    ,PROCESS_FLAG
    ,ERROR_DESCRIPTION
      FROM data_source_table_name
    #It loads data into the table in Oracle....   
    Insert into oracle_destination_table_name (
    COMPANY,
    CUSTOMER,
    TRANS_TYPE,
    INVOICE,
    TRANS_DATE,
    STATUS,
    TRANS_AMT,
    CREDIT_AMT,
    APPLD_AMT,
    ADJ_AMT,
    TRANS_USER1,
    PROCESS_LEVEL,
    DESCRIPTION,
    DUE_DATE,
    OUR_DATE,
    OUR_TIME,
    PROCESS_FLAG,
    ERROR_DESCRIPTION)
    END;

    CREATE TABLE statements would have been better as MS-SQL and Oracle don't have the same data types.
    OUR_DATE, OUR_TIME will (most likely) be ONE column in Oracle.
    DATABASE LINK
    Personally, I'd just load the data over a database link:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_table@mssql_db_link
    As far as creating the database link from Oracle to MS-SQL ... that is for somebody else to answer.
    (most likely you'll need to use an ODBC driver)
    EXTERNAL TABLE
    If the data from MS-SQL is in a CSV file, just use and external table.
    same concept:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_external_table
    MK

  • Is it possible to import data into an existing table?

    Hi.. everyone.
    Is it possible to import data into an existing table
    by using import utility?
    The exported table and the existing table have the same name
    and table schema.
    I want to append "new data(exported from oracle8.0.5)" to
    "an existing partitioned-table" by using "oracle 9i import utility".
    Thanks in advance.
    Have a nice day.
    Ho.

    SQL> select index_name
    2 from user_indexes
    3 where table_name = 'IMPORTPK';
    INDEX_NAME
    SYS_C007610
    SQL> create view importpk_view as select * from importpk;
    View created.
    SQL> disconn
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
    oduction
    With the Partitioning, OLAP and Data Mining options
    SQL> exit
    C:\>exp userid=oracle/oracle tables=importpk
    Export: Release 10.1.0.2.0 - Production on Tue Sep 5 08:30:50 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table IMPORTPK 10 rows exported
    Export terminated successfully without warnings.
    C:\>imp userid=oracle/oracle tables=importpk ignore=y
    Import: Release 10.1.0.2.0 - Production on Tue Sep 5 08:31:12 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export file created by EXPORT:V10.01.00 via conventional path
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    . importing ORACLE's objects into ORACLE
    . . importing table "IMPORTPK"
    IMP-00019: row rejected due to ORACLE error 1
    IMP-00003: ORACLE error 1 encountered
    ORA-00001: unique constraint (ORACLE.SYS_C007610) violated
    Column 1 1
    Import terminated successfully with warnings.
    C:\>sqlplus/nolog
    SQL*Plus: Release 10.1.0.2.0 - Production on Tue Sep 5 08:33:20 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    1.No
    Note : if table content primary key and index.
    SQL> conn oracle/oracle
    Connected.
    SQL> create table withoutcons ( no number);
    Table created.
    SQL> insert into withoutcons select * from importpk;
    10 rows created.
    SQL> create view withoutcons_view as select * from withoutcons;
    View created.
    SQL> disconn
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
    oduction
    With the Partitioning, OLAP and Data Mining options
    SQL> exit
    C:\>exp userid=oracle/oracle tables=withoutcons
    Export: Release 10.1.0.2.0 - Production on Tue Sep 5 08:36:05 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table WITHOUTCONS 10 rows exported
    Export terminated successfully without warnings.
    C:\>imp userid=oracle/oracle tables=withoutcons ignore=y
    Import: Release 10.1.0.2.0 - Production on Tue Sep 5 08:37:17 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export file created by EXPORT:V10.01.00 via conventional path
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    . importing ORACLE's objects into ORACLE
    . . importing table "WITHOUTCONS" 10 rows imported
    Import terminated successfully without warnings.
    2. Yes
    If table content no unique constraints
    Message was edited by:
    user526020

  • How to read RMAN data into an ORACLE Table?

    Hallo,
    With regards to RMAN, how should we store the data into a database table, from the commands which can run only on RMAN prompt without using Recovery Catalog?
    For Example:
    RMAN> Report need backup days 3;
    RMAN DATA:
    RMAN-03022: compiling command: report
    Report of files whose recovery needs more than 3 days of archived logs
    File Days Name
    1 1203 D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF
    2 1203 D:\ORACLE\ORADATA\TEST\RBS01.DBF
    3 1203 D:\ORACLE\ORADATA\TEST\USERS01.DBF
    Should it done via UTL_FILE?
    If so, could someone give simple example/code how to do that, in order to write this RMAN data into an Oracle Database table?
    I also set the utl_file_dir parameter to a particular directory in my database.
    Thanks
    W.Benvort

    Actually, I am not using Recovery Catalog, so the views like RC_database, Rc_tablespaces etc , which are specific to recovery catalog are not available.
    r.- this make sense at 100% because those views belong to the recovery catalog.
    So, I wanted that these information, which we can get via using the commands like above, transfer into an Oracle table
    r.- If you want to access the views of the Recovery Catalog to store part of that information in tables you have to have the database registered in a Recovery Catalog.
    Should we keep the Recovery Catalog in Control file? Instead of using separate Schema.
    r.- I recommend you to create a catalog for your database because the space the controlfile to store information regarding RMAN is reused and you can lose important information about your backups.
    Can we run Catrman.sql script as a sys in order to keep the recovery catalog in sys schema?
    r.- As you know, this is not recommended at all.
    Conclusion : Create a Recovery Catalog and you will be able to perform all that you want regardind what you mentioned above.
    I have a thread for this:
    RMAN ( CATALOG CREATION ) STEP BY STEP by Joel Pérez
    Joel Pérez
    http://otn.oracle.com/experts

  • Import Excel File Data into oracle database table.

    HI,
    i want to insert data into a specific table from a excel file. please help me..
    for example
    emp.xls file's data need to be import in emp database table.
    thanks in advance...

    Hi,
    to all knowledgable person, this would be gald for u all that i have solved the problem.
    through this procedure..
    PROCEDURE IMPORT_FROM_EXCEL_PROC (as_FileName VARCHAR2, exe_name varchar2) IS
              appid PLS_INTEGER;
              convid PLS_INTEGER;
              docid PLS_INTEGER;
              conv_established BOOLEAN := FALSE;
              buffer VARCHAR2(100);      
              Emp_code VARCHAR2(100);
              Emp_name VARCHAR2(100);
              Emp_desig VARCHAR2(100);
              Emp_Salary VARCHAR2(100);
              ls_error VARCHAR2(1000);
              li_row integer;
              li_col integer;
              li_error_count integer;
              li_load_count integer;
    BEGIN
         --Start Excel
         --This line assumes that Excel is in the specified directory
              --     APPID := DDE.APP_BEGIN('D:\OFFICE11\EXCEL.EXE',DDE.APP_MODE_MINIMIZED);
              APPID := DDE.APP_BEGIN(exe_name,DDE.APP_MODE_MINIMIZED);
         --Establish a conversation with Excel
         --The following loop will not end until a conversation with Excel
         --has been established. Therefore, it can result in a endless loop,
         --so use with caution.
              WHILE NOT conv_established LOOP
              BEGIN
              convid := DDE.INITIATE('excel', 'system');
              conv_established := TRUE;
              EXCEPTION
              WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
              conv_established := FALSE;
              END;
              END LOOP;
         --Open Excel document
         --This assumes that you have an Excel spreadsheet named ddetest.xls in the root of c:
              DDE.EXECUTE(convid, '[Open("'||as_FileName||'")]', 10000);     
         --Initiate conversation with Excel document
              docid := DDE.INITIATE('excel',as_FileName);
         --Begin transfer from Excel to Forms
                   li_load_count := 0;
                   li_error_count := 0;
                   li_col := 1;
                   li_row := 2;
                   GO_BLOCK('IMPORT_XLS');          
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);          
                   WHILE length(buffer) > 2 LOOP           
                   WHILE li_col < 5 LOOP
                        buffer := substr(buffer, 1, instr(buffer, chr(10)) - 2);               
                   IF li_col = 1 THEN --Emp_code
                        Emp_code := buffer;     
                   ELSIF li_col = 2 THEN --Emp_name     
                        Emp_name := buffer;     
                   ELSIF li_col = 3 THEN --Emp_desig      
                        Emp_desig := buffer;     
                   ELSE --Emp_salary
                        Emp_salary := buffer;
                   END IF;
                   IF nvl(ls_error,'N') = 'N' THEN
                   li_col := li_col + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
                   ELSE
                   li_col := 5;
                   END IF;               
                   END LOOP;
                   IF nvl(ls_error, 'N') = 'N' THEN
                   li_load_count := li_load_count + 1;
                   IF li_load_count = 1 THEN
                   FIRST_RECORD;
                   ELSE
                   NEXT_RECORD;
                   END IF;
                   :IMPORT_XLS.Emp_code := Emp_code;               
                   :IMPORT_XLS.Emp_name := Emp_name;          
                   :IMPORT_XLS.Emp_desig := Emp_desig;
                   :IMPORT_XLS.Emp_salary := Emp_salary;
                   ELSE
                   li_error_count := li_error_count + 1;
                   DDE.POKE(docid, 'R' || TO_CHAR(li_row) || 'C5', ls_error, DDE.CF_TEXT, 10000);
                   END IF;
                   ls_error := '';
                   Emp_code := '';
                   Emp_name := '';
                   Emp_desig := '';
                   Emp_salary := '';
                   li_col := 1;
                   li_row := li_row + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);                
                   END LOOP;               
                   IF li_error_count > 0 THEN
                        DDE.EXECUTE(convid, '[[save]]', 10000);
                        Message(TO_CHAR(li_load_count) || ' Record(s) Loaded. ' ||
                        TO_CHAR(li_error_count) || ' Invalid Record(s). See error in excel file.');
                        ELSE
                        Message(TO_CHAR(li_load_count) || ' Record(s) Successfully Loaded.');
                   END IF;                
                   --End transfer to Excel
                   DDE.TERMINATE(docid);
                   DDE.TERMINATE(convid);
                   DDE.APP_END(appid);                          
                   --Handle exceptions
                   EXCEPTION
                   WHEN DDE.DDE_APP_FAILURE THEN
                   MESSAGE('WINDOWS APPLICATION CANNOT START.');
                   WHEN DDE.DDE_PARAM_ERR THEN
                   MESSAGE('A NULL VALUE WAS PASSED TO DDE');
                   WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
                   MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
                   WHEN DDE.DMLERR_NOTPROCESSED THEN
                   MESSAGE('A TRANSACTION FAILED');
    END;

Maybe you are looking for