Error while loading data oracle table using xslt

Hi
I have an following xml:
<TRAN TRAN_ID = "12" RCODE = "W"> <STATION>1234567</STATION> </TRAN>
I have created the following xslt for the above xml:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="TRAN"><xsl:value-of select="@TRAN_ID" /> <xsl:value-of select="@RCODE" /> </xsl:template> </xsl:stylesheet>
I am trying to insert data into the table Tran having columns tran_id and rcode in oracle database 11g.
I am getting the following error:
ERROR at line 1:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '1'
ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
ORA-06512: at "SYS.DBMS_XMLSTORE", line 88
Can anybody tell me if i am making a mistake in writing the xlst?
Thanks in advance.

Thank you for your reply. Currently i am using the insert using xmltable and it works fine. But i would like to use xsl if the dynamic passing of values is possible. Actually i want to store the xsl in a table and call it when needed to insert data to the database table (MSGS). Could you please give me an example of it?
Here is the table structure i have in database:
Table Name: Tran_data
columns: SEQ NUMBER NOT NULL ,
TRAN_ID VARCHAR2(6) NOT NULL ,
RCODE VARCHAR2(30) NOT NULL ,
TRAN_DT DATE NOT NULL ,
xml_data xmltype
Table Name : Msgs
SEQ NUMBER NOT NULL,
RULE_ID VARCHAR2(200) not null,
MSG_TXT VARCHAR2(2000) NOT NULL,
TRAN_DATA_SEQ NUMBER NOT NULL ,
CREATE_USER VARCHAR2(30) NOT NULL ,
CREATE_DATE DATE NOT NULL ,
COMMENTS VARCHAR2(2000)
In this TRAN_DATA_SEQ is a foreign key and is a mandatory column. I can get the Tran_id and the rcode from xml. but the remaining mandatory columns i need to pass them to the xsl. Below is the xsl. Can you please let me know how to pass value to this the xsl.
[P]
xml:
<RES>
<Status>'PASS'</Status>
<Tran_id>1A</Tran_id>
<Rcode>1BR</Rcode>
<Msg>
<Rule_Id>A<Rule_Id>
<Msg_Text>'CRDT Failed'<Msg_Text>
</Msg>
<Msg>
<Rule_Id>B<Rule_Id>
<Msg_Text>'MAN Failed'<Msg_Text>
</Msg>
</RES>
[P]
I need an xsl for this xml to insert tran_id and rcode in tran_data table along with the xml as xml_data and the msg information in msgs table. The seq of tran_data needs to be inserted into the msgs table. Please let me know how this can be achieved using xsl?
Thanks in advance.

Similar Messages

  • Error while load data into Essbase using ODI

    Hi ,
    I'm getting the following error while loading measures into Essbase using ODI, I used the same LOG nd Error file and file path for all my Dimensions , this worked well but not sure why this is not working for measures....need help.
    File "<string>", line 79, in ?
    com.hyperion.odi.common.ODIHAppException: c:/temp/Log1.log (No such file or directory)
    Thanks
    Venu

    Are you definitely running it against an agent where that path exists.
    Have you tried using a different location and filename, have you restarted the agent to make sure there is not a lock on the file.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Error While Inserting Data into table using OAF

    Hi Experts,
    I am learning OAF; i am trying into insert the data into table using OAF. I followed the below procedure.
    My table(OLF_TEST_TBL) Columns:
    EmpID (Number), Ename(VARCHAR2 100), Sal Number, and who columns.
    1. created Application Module (AM).
    package: oracle.apps.mfg.simplepg.server
    name: oaf_test_tbl_am
    2. created simple page
    name:EmployeePG
    package:oracle.apps.mfg.simplepg.webui
    3. Assigned the Application Module to Page
    4. Created Entity Object(EO)
    name:oaf_test_tbl_eo
    package:oracle.apps.mfg.simplepg.schema.server
    schema:apps
    table:OLF_TEST_TBL
    note:
    1. EMPID column is selected as primary key
    2. selected create method, remove method and validation method.
    3.checked generate default view object
    VO:
    name:olf_test_tbl_vo
    note: Entity Object was assigned to VO
    Coming To page:
    page main region:EmployeeMainRN
    1.under main region i created one more region using wizard
    selected AM and VO, region style-default single column
    2. under main region i created one more region
    region style- pagebuttonbar, ID:pagebutoonsRN
    3. under pagebuttonRN, created two submit buttons(ID:SUBMIT, ID:CANCEL).
    In AM java page:
    created a method to insert row and for commit.
    Insert Method:
    public void insertrow(){
    OAViewObject vo=(OAViewObject)getoaf_test_tbl_vo1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    Row row=vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Commit Method:
    public void savaDataTooaftesttable(){
    getDBTransaction().commit();
    In EmployeeMainRN, created a controller.
    In this controller process request method, 'insertrow' method was called.
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("insertrow");
    To commit the transaction when SUBMIT button pressed, commit method was called in process form request method.
    import oracle.apps.fnd.framework.OAViewObject;
    public void processformRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("SUBMIT") != null)
    am.invokemethod("savaDataTooaftesttable");
    Error After clicking the submit button_
    I ran the page, page was opened successfully. Once i enter data and click submit button, it's giving the following error.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object oaf_test_tbl_am.oaf_test_tbl_vo1700_oaf_test_tbl_vo1_practice_test_prc1_oracle_apps_mfg_simplepg_server_oaf_test_tbl_am.oaf_test_tbl_vo1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Experts, Kindly help me why i am getting this error.
    Awating your replies.
    Thanks in advance.

    If you dont want to create message. You can throw exception like below as well
              throw new OAException("Emp Id is "+empId+" and employee name is "+empName, OAException.CONFIRMATION);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error while loading Data into Essbase using ODI

    Hi,
    I am very new to ODI. I have installed ODI and working on Demo environment only. I havn't done any configuration. I am using Essbase Technology which is coming by default.
    I have created one sample outline in Essbase and a text file to load data into essbase using ODI.
    Following my text file.
    Time     Market     Product     Scenario     Measures     Data
    Jan     USA     Pepsi     Actual     Sales     222
    I am getting the error. I have checked in Operator. It is giving at step 6 i.e. Integration SampleLoad data into essbase.
    Here is the description.
    from com.hyperion.odi.common import ODIConstants
    from com.hyperion.odi.connection import HypAppConnectionFactory
    from java.lang import Class
    from java.lang import Boolean
    from java.sql import *
    from java.util import HashMap
    # Get the select statement on the staging area:
    sql= """select C3_C1 ""Time"",C5_C2 ""Market"",C2_C3 ""product"",C6_C4 ""Scenario"",C1_C5 ""Measures"",C4_C6 ""Data"" from "C$_0Demo_Demo_genData" where      (1=1) """
    srcCx = odiRef.getJDBCConnection("SRC")
    stmt = srcCx.createStatement()
    srcFetchSize=30
    stmt.setFetchSize(srcFetchSize)
    rs = stmt.executeQuery(sql)
    #load the data
    stats = pWriter.loadData(rs)
    #close the database result set, connection
    rs.close()
    stmt.close()
    Please help me to proceed further...

    Hi John,
    Here is the error message in execution tab....
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 20, in ?
    java.sql.SQLException: Unexpected token: TIME in statement [select   C3_C1    ""Time]
         at org.hsqldb.jdbc.jdbcUtil.sqlException(jdbcUtil.java:67)
         at org.hsqldb.jdbc.jdbcStatement.fetchResult(jdbcStatement.java:1598)
         at org.hsqldb.jdbc.jdbcStatement.executeQuery(jdbcStatement.java:194)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx4.f$0(<string>:20)
         at org.python.pycode._pyx4.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    java.sql.SQLException: java.sql.SQLException: Unexpected token: TIME in statement [select   C3_C1    ""Time]
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • Error while loading data into 0pur_c03 using 2lis_02_scl

    Hi,
    While trying to load data into 0pur_c03 by using Data Source 2lis_02_scl from R/3 the error message "The material 100 does not exist or not active" is being displayed. I have loaded master data for 0Material and performed change Run also.Still the problem is not resolved.Please suggest in resolving this issue.
    Regards,
    Hari Prasad B.

    I have the same problem in my system and i found that the material XXXXX had movements.....sales documents and more but in certain moment it material was deleted in R3 and it is not loaded into 0MATERIAL infoobject because is marked for deletion....
    If you have this error must activate the load request manually and your infocube can hold the data without any problem.....
    Regards

  • Error while loading data to table

    I was trying to load data into 2 tables using a single control file. When I run the program, it ends up in error.
    The error shown is
    The executable file /appl/apps/apps_st/appl/ap/12.0.0/bin/TEST_SHELL for this concurrent program cannot be executed.
    Contact your system administrator or support representative.
    Verify that the execution path to the executable file is c
    The error is incomplete.
    Please help me with this.
    Thanks,
    Anand

    Pl post details of OS, database and EBS versions.
    Pl confirm you followed all of the steps in these docs
    How to Use 9i or 10g Features in SQL*Loader for Apps? [ID 423035.1]     
    How To Create A Custom Concurrent Program With Host Method and Pass Parameters To The Shell Script [ID 266268.1]     
    HTH
    Srini

  • Error while loading data to Infocube using DTP.

    Dear All
    I am facing problem while uploading data in Zinfocube. Up to PSA the data is loaded and not showing any error but when we try to upload the data from PSA to INFOCUBE through a DTP, It ens up showing error message (Error while updating to targets Infocube) . The long text and details doesnot give any further information. I can't figure out what could be the reason....
    Thanks
    Dinesh Sharma

    Hi
    The data might be mismatched between PSA and Cube or might be the problem in the transformation. We cannot really say what the problem until you tell the error msg.
    There will be some error message in DTP monitor
    Regards
    Srikanth

  • Error while loading data into BW using Datastage tool

    We are extracting data from external source and loading it into SAP BW using Ascential DataStage. Sometimes the job starts on the DataStage side but doesn't really run. I get the following error msg on the BW side:
    S:RSVAR:051 Error opening InfoSource file: ZTESTODS_TRANSACTION.TXT
    Please suggest.
    Thanks,
    RR

    Hi,
    ZTESTODS_TRANSACTION.TXT and ZTESTODS_TRANSACTION.MET are two files in the dsbwconnections directory on the datastage server. The error occurs when a process has a lock on the file.
    If you use PUSH or PULL then you won't see the problem.
    Best regards
    Niels

  • Error while loading data for table. (ADM0161)

    I've this messages when I perform a Scan
    and Repair operation in version 5.1
    The table is obj_X_DOCUMENTS
    Can you help me?
    Thanks

    Check following KB (SAP Note) - 1181953 - Errors: "ADM0161," "DA0005," "ORA-12535," "ORA-00911,"ORA-01001" and "ORA-12560" after moving repository and data source databases between database servers.
    Either connection to your Document domain is not working or you have corrupted DB and need to restore from backup.
    Please note, 5.1 is no longer supported. Only online content is still available.

  • Error while creating data warehouse tables.

    Hi,
    I am getting an error while creating data warehouse tables.
    I am using OBIA 7.9.5.
    The contents of the generate_clt log are as below.
    >>>>>>>>>>>>>>>>>>>>>>>>>>
    Schema will be created from the following containers:
    Oracle 11.5.10
    Universal
    Conflict(s) between containers:
    Table Name : W_BOM_ITEM_FS
    Column Name: INTEGRATION_ID.
    The column properties that are different :[keyTypeCode]
    Success!
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    There are two rows in the DAC repository schema for the column and the table.
    The w_etl_table_col.KEY_TYPE_CD value for DW application is UNKNOWN and for the ORA_11i application it is NULL.
    Could this be the cause of the issue? If yes, why could the values be different and how to resolve this?
    If not, then what could be the problem?
    Any responses will be appreciated.
    Thanks and regards,
    Manoj.

    Strange. The OBIA 7.9.5 Installation and Configuration Guide says the following:
    4.3.4.3 Create ODBC Database Connections
    Note: You must use the Oracle Merant ODBC driver to create the ODBC connections. The Oracle Merant ODBC driver is installed by the Oracle Business Intelligence Applications installer. Therefore, you will need to create the ODBC connections after you have run the Oracle Business Intelligence Applications installer and have installed the DAC Client.
    Several other users are getting the same message creating DW tables.

  • Error While loading data for LIS InfoSources.

    Hi All,
    I am repeatedly receiving load failure errors while loading data using 2lis_01_s001 (This is the case with all the InfoSources).
    The error message is:
    An error occurred in the source system.
    Note
    If the source system is a Client Workstation, then it is possible that the file that you wanted to load was being edited at the time of the data request. Make sure that the file is in the specified directory, that it is not being processed at the moment, and restart the request.
    in our Quality system, we disabled the LIS Updation to No Update(R3) and loaded data and then again changed the Update Mode for No Updating to Asynchronous Update(R3). But now we are doing dataloading in Production. How to proceed. Should we have to disable the LIS Updating whenever we have to load the loads from R3 to BW.
    Regards
    Jay

    Hi Jayanthy,
    Pls. check the order of the fields in the two set up tables for the S001 structure. The order of fields in both the tables should be the same.
    You can see the structure in the TCode - SE11.
    If the order is different, then you bneed to ask the BASIS person to change the order so that the order of fields in both the setup tables is same. This should fix the issue.
    Thanks,
    Raj

  • Error while creating the DWH tables using DAC

    Hi,
    I am getting error while creating the DWH tables using DAC. I have created a ODBC DSN using merant driver with DAC repository DB credentials and the test connection is successful. And while creating the tables i gave the olap dw credentials and the DSN name which i created earlier. But it throws the error as below:
    Please find the below mentioned error message
    =====================================
    STD OUTPUT
    =====================================
    CREATING SIEBEL DATABASE OBJECTS
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ******* /c DB_DAC /G "SSE_ROLE" /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b "" /K "" /X "" /W N
    Error while importing Siebel database schema.
    =====================================
    ERROR OUTPUT
    =====================================
    Siebel Enterprise Applications ODBC DDL Import Utility, Version 7.7 [18030] ENU
    Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.
    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.
    User agrees that any use of this software is governed by: (1) the applicable
    user limitations and other terms and conditions of the license agreement which
    has been entered into with Siebel Systems or its authorized distributors; and
    (2) the proprietary and restricted rights notices included in this software.
    WARNING: THIS COMPUTER PROGRAM IS PROTECTED BY U.S. AND INTERNATIONAL LAW.
    UNAUTHORIZED REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PORTION
    OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.
    If you have received this software in error, please notify Siebel Systems
    immediately at (650) 295-5000.
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ***** /c DB_DAC /G SSE_ROLE /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b /K /X /W N
    Connecting to the database...
    28000: [DataDirect][ODBC Oracle driver][Oracle]ORA-01017: invalid username/password; logon denied
    Unable to connect to the database...
    any help is appreciated.
    Thanks,
    RM

    The fact that you are getting an "ORA-01017: invalid username/password; logon denied" message indicates that you are at least talking to the database.
    The log shows that username "infdomain" is being used. Can you double check the username and password you have in DAC in a SQL*Plus/SQL Developer session?
    Please mark if useful/helpful,
    Andy.

  • Error while loading data from 0FI_TX_4 to ODS

    Dear Friends,
    One of our proccess chain getting error since a week, every day with same error while loading data from R3 data source 0FI_TX_4 to ODS.
    Short dump is raised in R3 system.
    "DBIF_RSQL_SQL_ERROR" CX_SY_OPEN_SQL_DBC
    "SAPLBWFIR" or "LBWFIRU13"
    "BWFIR_READ_BSET_CPUDT_DATA"
    ORA-01555
    The number of records are below 10000 only.
    All other chains are OK.
    we have already searched SDN and Notes...and applied below solution, but still no use
    Increase the size of all the roll back segments
    Increase number of REDO logs
    Decrease the number of records per data packet
    Any more suggessions please ??
    Thanks
    Tony

    How are you telling that no. of records are below 10000 .Have you checked the no.of records in PSA???
    Now ,I tell you something which I had done for this error .I increased the Package size such that whole data gets transferred in single data package.Please make the package size as large as possible so that all the data can be processed in single package.
    I know you have read so many threads on the  same but what I am suggesting is what I have done and successfully rectified this issue.
    regards,
    rocks

  • Error while loading data from a file on application server

    Hi all,
    Facing an error while loading data from a flat file.
    Error 'The argument '##yyyymmdd;@##' cannot be interpreted as a number ' while assigning character.
    I changed the format of date fields (tried with number,general,date(International))in the xls. But i still get the same error.Did check all the data types in Data source all the fields are dats.
    Can you please tell me what could be the problem?
    Thank you all,
    Praveen

    Hi all,
    As far as my first question i got through it but i had one more field in my flat file while actually is a time stamp, but in my flat file i have a data in this format
    10/21/2006  5:11:48 AM which i need to change to 10/21/2006
    one more note is i have some of the fields as NULL in this field
    Last Updated Date
    10/21/2006  5:11:48 AM
    10/21/2006  5:11:48 AM
    NULL
    NULL
    10/21/2006  5:11:48 AM
    NULL
    I want to display the values as 10/21/2006 and NULL as it is.
    Please let me know if we have a conversion routine in datasource which can solve my problem.
    Regards,
    Praveen

  • Error while loading data from DS into cube

    Hello All
    I am getting the below error while loading data from Data source to the cube.
    Record 1 :Time conversion from 0CALDAY to 0FISCPER (fiscal year ) failed with value 20070331
    Wht am i suppose to do?
    Need ur input in this regard.
    Regards
    Rohit

    Hi
    Simply map 0calday to 0fiscper(you already done it)..You might have forgotten to map fiscal year variant in update rules....if it comes from souce,just map it..if it won't comes from source...make it as constant in update rules and give value..
    If your business is April to March make it as  'V3'
    If your business is January to Decemeber make it as 'K4'..
    activate your update rules delete old data and upload again....
    Hope it helps
    Thanks
    Teja

Maybe you are looking for