How to insert this date colum into some other table

Hi all,
I have to write a procedure to select the data from one table & insert date column data into another table,the data is in different date formats,but in the second table date column format should be (mm/dd/yyyy) .
example:
if the date in first table is 1992 it should be modify to "01-01-1992" & insert into the second table.But the values should be different(below are the different types).
RELEASE_DATE
1992
1962
July 1987
Aug 1968
10/30/06
6/1/2005
2004
7.25.1951
12/12/2006
12/1/2005
1992
2003
2005
1958
2002
11/11/03
1/1/91
50-21-2001
10.28.1991
Please any body can help.

<FONT FACE="Arial" size=2 color="2D0000">
Thanks..! for giving the data type..
Here is an example..
SQL> desc atestdate
Name                                      Null?    Type
CHARDATE                                           VARCHAR2(10)
ACTDATE                                            DATE
SQL> select * from atestdate;
1992
July 1987
Aug 1968
10/30/06
6/1/2005
2004
7.25.1951
12/12/2006
12/1/2005
1992
2003
2005
1958
2002
11/11/03
1/1/91
50-21-2001
10.28.1991
18 rows selected.
SQL> select <font color="#0000ff">char_trim_x</font>(chardate) from atestdate;
1992
July-1987
Aug-1968
10-30-06
6-1-2005
2004
7-25-1951
12-12-2006
12-1-2005
1992
2003
2005
1958
2002
11-11-03
1-1-91
50-21-2001<font color="#8000ff">--? 50 can not be a month nor a date  do not give  junk values</font>
10-28-1991
18 rows selected.
<font color="#0000ff">char_trim_x</font> This is a function which I have created with REPLACE function
this brings to some extent of an orderly format..
<font color="#008000">But you have not yet posted your work ..</font>
-SK
</FONT>

Similar Messages

  • How to insert the data from XML to a table

    Hi,
    I'm using Oracle 10g Express Edition
    I need help in How to insert the data from XML file into the table.
    Below is the example i'm working on..
    I have create ridb user with below mentioned privileges:
    Account Status Locked Unlocked
    Default Tablespace: USERS
    Temporary Tablespace: TEMP
    User Privileges :
    Roles:
    CONNECT
    RESOURCE
    Direct Grant System Privileges:
    CREATE DATABASE LINK
    CREATE MATERIALIZED VIEW
    CREATE PROCEDURE
    CREATE PUBLIC SYNONYM
    CREATE ROLE
    CREATE SEQUENCE
    CREATE SYNONYM
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    CREATE VIEW
    & table is created TRIALZIPCODES below mentioned is the DDL:
    CREATE TABLE TRIALZIPCODES
    STATE_ABBR VARCHAR2(20) NOT NULL
    , ZIP_CODE NUMBER(10, 0) NOT NULL
    , ZIP_CODE_EXT VARCHAR2(20)
    Below is the XML FILE: which is stored in C:\OracleProject Folder
    File name: trial.xml
    <?xml version="1.0" ?>
    <metadata>
    - <Zipcodes>
    - <mappings Record="4">
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    - <mappings Record="5">
    <STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
    <ZIPCODE>80323</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    </mappings>
    </Zipcodes>
    </metadata>
    PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
    create or replace
    PROCEDURE TRIAL AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    begin
    -- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
    -- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -- the name of the table as specified in our DTD
    DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
    -- the name of the data set as specified in our DTD
    DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
    insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    DBMS_XMLStore.closeContext(insCtx);
    END;
    END TRIAL;
    For the first time when i complied i got the errors as :
    Procedure RIDB.PROCEDURE1@RIDB
    Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
    Error(16,14): PL/SQL: Item ignored
    Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(29,1): PL/SQL: Statement ignored
    Error(33,1): PL/SQL: Statement ignored
    Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(36,1): PL/SQL: Statement ignored
    Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
    SQL Statement:
    grant execute on utl_file to ridb
    So, it got compiled successfully but when i execute it gives me error as:
    Source does not have a runnable target.
    What does this mean?
    So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
    So can i edit the init.ora with notepad.When i tried to do that it says permission denied
    In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
    but there is also other file initXETemp in the same path do i need to do the changes in it.
    I have tried even editing the SPFILE as mentioned below:
    C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
    So i had reinstall the software again.
    Could you please let me know how to proceed..

    hi,
    I have created the directory from sys database
    CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
    & grant read,write access to the user
    grant read,write on directory XML_DIR2 to RIDB;
    & i had change the tag name in the xml file as shown below:
    <?xml version = '1.0'?>
    <metadata>
    <Zipcodes>
    <mappings Record="4">
    <STABBRE>CA</STABBRE>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    <mappings Record="5">
    <STABBRE>CO</STABBRE>
    <ZIPCODE>80323</ZIPCODE>
    <ZIPCODEEXT>9277</ZIPCODEEXT>
    </mappings>
    </Zipcodes>
    </metadata>
    TRIALZIPCODE table as shown below:
    CREATE TABLE "RIDB"."TRIALZIPCODE"
    (     "STABBRE" VARCHAR2(20 BYTE),
         "ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
         "ZIPCODEEXT" NUMBER
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    I have tried two methods as shown below:
    Procedure 1:
    create or replace
    PROCEDURE TRIAL_V2 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
    DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
    DBMS_XMLStore.setRowTag(insCtx, 'mappings');
    cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
    DBMS_XMLStore.closeContext(insCtx);
    END;
    Procedure 1 was compiled with out errors but when i execute i got the error as :
    Source does not have a runnable target.
    Procedure 2_
    CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
    SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
    extractvalue(x.column_value, 'mappings/ZIPCODE'),
    extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
    FROM TABLE(
    XMLSequence(
    EXTRACT(
    xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
    'metadata/Zipcodes/mappings'
    ) x
    END;
    END TRIAL_V3;
    Procedure 2 was complied without errors but when i execute i got the error as:
    Connecting to the database RIDB.
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at "RIDB.TRIAL_V3", line 12
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database RIDB.
    Could you please let me know how to proceed...

  • How to delete the data loaded into MySQL target table using Scripts

    Hi Experts
    I created a Job with a validation transformation. If the Validation was failed the data passed the validation will be loaded into Pass table and the data failed will be loaded into failed table.
    My requirement was if the data was loaded into Failed database table then i have to delete the data loaded into the Passed table using Script.
    But in the script i have written the code as
    sql('database','delete from <tablename>');
    but as it is an SQL Query execution it is rising exception for the query.
    How can i delete the data loaded into MySQL Target table using scripts.
    Please guide me for this error
    Thanks in Advance
    PrasannaKumar

    Hi Dirk Venken
    I got the Solution, the mistake i did was the query is not correct regarding MySQL.
    sql('MySQL', 'truncate world.customer_salesfact_details')
    error query
    sql('MySQL', 'delete table world.customer_salesfact_details')
    Thanks for your concern
    PrasannaKumar

  • How to Achieve this Data Load into Cube

    Hi Experts,
    Could you please update me on how to achieve this
    I got a History data (25-35 Million Records) for about 8 years to be loaded to BW.
    What is the best approach to be followed
    1) Load everything into one cube and create aggregates or
    2) Create 4 different cubes (with same data model) and load load 2 years of data into each cune (2Years * 4 Cubes = 8 Years Data) and develop a multicube on top of 4 cubes
    If so how can i load data into respective cubes
    Ex: Lets assure i got data from 31.12.2007 to 01.01.2000 which is 8 years of data
    Now i created 4 Cubes--C1,C2,C3,C4 & C5
    How can i specifically
    load data from 01.01.2000 to 31.12.2001 (2 Years) to C1
    load data from 01.01.2002 to 31.12.2003 (2 Years) to C2
    load data from 01.01.2004 to 31.12.2005 (2 Years) to C3
    load data from 01.01.2006 to 31.12.2007 (2 Years) to C4
    load data from 01.01.2008 to 31.12.2010 (2 Years) to C5 (Currently Loading)
    Please advise the best approach to be followed and why
    Thanks

    If you already have the cube C5 being loaded and the reports are based on this cube, then if you donot want to create additional reports, you can go ahead and load the history data into this cube C5.
    What is your sourcesystem and datasource?. Are there selection conditions (in your infopackage) available to specify the selections? If so, you can go ahead and do full loads to the current cube.
    For query performance, you can create aggregates on this cube based on the fiscal period / month / year ( whichever infoobject is used in the reports)
    If your reports are not based on timeperiod, then multicube query will work as parrallelized sub queries and so there will be 4 dialog processes occupied on your BW system everytime the query is hit.
    Also any changes that you want to make in cube will have to be copied to all cubes, so maintenance may be a question.
    If there are enough justification, then approach 2 can be taken up

  • How to insert the data

    Hi, I have the following xml file, can some one please tell me how to insert this file cdata into the table in the below format
    There would be couple of <TRAN> tag where we will not have AMT Tag but we will have only RKEY Tag.
    <?xml version='1.0' encoding='UTF-8'?>
    <main>
    <F_Header>
    <Version><![CDATA[1.0]]></Version>
    <SInfo>
    <In>
         <ID><![CDATA[12]]></ID>
         <Type><![CDATA[S]]></Type>
         <Filepath><![CDATA[\\temp\files\test.xml]]></Filepath>
    </In>
    </SInfo>
    </F_Header>
    <Tran>
    <GI>
    <RKey><![CDATA[1]]></RKey>
    <Amt><![CDATA[10.80]]></Amt>
    </GI>
    </Tran>
    <Tran>
    <GI>
    <RKey><![CDATA[2]]></RKey>
    <Amt><![CDATA[11.89]]></Amt>
    </GI>
    </Tran>
    <Tran>
    <GI>
    <RKey><![CDATA[0]]></RKey>
    </GI>
    </Tran>
    </main>
    create table temp_tab(version varchar2(20), SinfoID varchar2(20)
    , SInfotype varchar2(20), SInfoFPath varchar2(20), TranKey varchar2(20), TranAmt varchar2(20))
    The sample output should look like
    Version SINFOID SINFOTYPE SINFOPATH TRANKEY TRANAMT
    1.0 12 S \\temp\files\test.xml 1 10.80
    1.0 12 S \\temp\files\test.xml 2 11.89
    1.0 12 S \\temp\files\test.xml 0
    Thanks,

    As A_Non explained, two XMLTables will do the job.
    The first one to extract header info and the collection of Tran elements, and the second one to shred the collection of Trans passed from the first XMLTable into relational rows :
    SQL> SELECT h.version
      2       , h.SInfoID
      3       , h.SInfotype
      4       , h.SInfoFPath
      5       , t.TranKey
      6       , t.TranAmt
      7  FROM XMLTable(
      8        '/main'
      9        passing xmltype(bfilename('TEST_DIR','test.xml'),nls_charset_id('AL32UTF8'))
    10        columns
    11          version    varchar2(10) path 'F_Header/Version'
    12        , SInfoID    varchar2(10) path 'F_Header/SInfo/In/ID'
    13        , SInfotype  varchar2(10) path 'F_Header/SInfo/In/Type'
    14        , SInfoFPath varchar2(40) path 'F_Header/SInfo/In/Filepath'
    15        , Trans      xmltype      path 'Tran'
    16       ) h
    17     , XMLTable(
    18        '/Tran'
    19        passing h.Trans
    20        columns
    21          TranKey    varchar2(10) path 'GI/RKey'
    22        , TranAmt    varchar2(10) path 'GI/Amt' default '0'
    23       ) t
    24  ;
    VERSION    SINFOID    SINFOTYPE  SINFOFPATH                               TRANKEY    TRANAMT
    1.0        12         S          \\temp\files\test.xml                    1          10.80
    1.0        12         S          \\temp\files\test.xml                    2          11.89
    1.0        12         S          \\temp\files\test.xml                    0          0

  • How to insert text data into temp tables....

    Dear All,
    I have one notepad with three columns, first column is segment1, second column is segment2 & third column is price list....
    and there is no delimiter and exact spaces..(i.e, zizak fomat)
    Ex:-
    xx yy 00009999
    kk mmmm 00009333
    Data is available like above example...So, I need to insert this data into one table.(2LAKSHS OF RECORDS AVAILABLE IN THAT NOTEPAD)
    So, Any can one help me, how to insert this kind of text data into temparory table...
    Regards
    Krishna
    Edited by: user12070109 on May 29, 2010 9:48 PM
    Edited by: user12070109 on May 29, 2010 9:49 PM

    Hello,
    What manu suggested this can be done through oracle forms.
    If as i read your last post you are using that in database it will not work in db. Try to use the same process in oracle forms will work by making some changes.
    And if you don't want to use forms then there is one way using SQL LOADER. It required control file to execute for uploading data.
    See the below link.
    http://www.orafaq.com/wiki/SQL*Loader_FAQ
    In this example its showing filename.csv you can use your file name like yourfilename.txt.
    So your control file will look like this...
    load data
    infile 'file_path\file_name.txt'
    into table table_name  -- use actual table name where you want to upload data
    fields terminated by " "  -- Here using spaces as you mentioned           
    (column1, column2, column3)  -- Here use the three column names of tableAnd after creating control file with the above code. You can call it in command prompt like this
    sqlldr username/password control=control_file_path\control_file_name.ctl log=log_file_path\log_file_name.log
    or
    sqlldr username/password@dbconnection control=control_file_path\control_file_name.ctl log=log_file_path\log_file_name.log
    Before doing this practice make sure SQLLDR.exe availabe in the machine where you have to execute. Otherwise you will have to install db client for using sqlldr.exe
    -Ammad

  • How to insert  Legacy data into QP_RLTD_MODIFIERS table?

    How to insert  Legacy data into QP_RLTD_MODIFIERS table in R12 instance.

    I would use the API QP_Modifiers_PUB.Process_Modifiers for pushing legacy pricing data into R12.  QP_RLTD_MODIFIERS is only used for certain types of discounts (in my prod environnment, only promos have data in this table).

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • How CallableStatement in JSP use setDate() method to insert the date value into DB?

    Dear all,
    I met a strange error message when i insert a date value into DB via JSP call PL/SQL procedures.
    The error seems caused by the setDate(index, date) method with CallableStatement.
    The message is: Can not find the setDate(int, java.util.Date) method in the CallableStatement interfaces.
    Any ideas?
    Thanks advanced.

    Thank you!:)
    I solved it using this:
    String name="david";
                stmt = con1.createStatement();
                String prikaz1 = "INSERT INTO table (id,age,surname,name) IN 'C:\\Users\\David\\Desktop\\db.mdb' SELECT id,age,surname,' " + name + " ' FROM table2";
                stmt.executeUpdate(prikaz1);

  • *HOW TO INSERT DATA MANUALLY INTO A BW TABLE*

    Dear experts,
    I'm working in BW 3.5 version.
    Since I need to test some tables which are going to be load manually, please could anyone explain me which are the steps to insert data manually into a BW table.
    Thank you very much in advance,
    Jorge

    Hi Jorge,
    You can maintain the TMG(Table maintenance generator) and then enter the data manually. TMG creation Tcode is se55. and to view and maintain TMG it is sm30 .
    Or if you have the data in excel. You can write a simple excel uploading ABAP program which will load your excel data to the table .
    Hope the above reply was helpful.
    Thanks & Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on Apr 30, 2011 6:45 AM

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • How to insert a tumbler blog into muse web site?

    Hey I was wondering if you know how to insert a tumbler blog into adobe muse? I have a tumbler account but would like to use it in adobe muse. how can I add it to my blog page in muse for desktop?

    Goto your Tumblr account and then view it when you're logged out ... the URL link should look something like this?:
    http://my-tumblr-blog.tumblr.com
    Now copy & paste that URL link and insert it into this code snippet:
    <iframe src="http://my-tumblr-blog.tumblr.com" onLoad="calcHeight();" scrolling="YES" frameborder="0" width="660" height="950" name="resize" id="resize"></iframe>
    Now copy and paste this edited snippet into the Muse page where you want your Blog ... set the correct width and height in the code (see above) to fit your page ...
    Cutomize it:
    I would suggest customizing your Blog with the built-in customize HTML section to tweak the embedded Blog page ... i.e. turn off some of the Tumblr sections like Header, Description, etc, if you don't want them ...
    Better still go over to this Tumblr Theme site and create a nice custom theme where you can do it all yourself ...
    Then after that still use the snippet code above once you have copied & pasted the new customised Tumblr HTML into you Tumblr Blog:
    http://www.totallylayouts.com/tumblr-generator/
    The art is to streamline your Blog as much as possible so you get the most screen estate shown in Muse, because as an inserted iFrame widget you do lose a bit ...
    cheers,
    Gem

  • Select from 2 tables and insert same data into 2 other tables(BPEL Process)

    Hi All,
    Please suggest me how to select from 2 tables and insert the same data into 2 tables. I am successful in selecting data from 2 tables, but i am not able to insert the same data into 2 other tables. There is foreign key constraint between 2 tables.
    Thanks in Advance,
    MAH

    I have created DB Adapter for selecting from 2 tables and also DB adapter for insert and i have created parent child relationship between 2 tables.
    I am getting this error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 6f3fe20c1b031057:-6cc7dfb5:11b8bf5fbe1:-7fa4. Please check the process instance for detail.</faultstring>
    </Fault>

  • Boss is gonna kill me. I Need help inserting a DATE/TIME into MSAccess

    Hello,
    I have spent way to long trying to figure out how to insert a date into the date/time field of a microsoft access database. Could someone please help me figure this out. I know there are a million previous posts about this topic and i looked through a bunch and none of them seem to work... i have tried so many different things. The code i am working (at this point in time.. since it has changed a million times) is:
                             String MYDATE = "yyyy-MM-dd hh:mm:ss a";
                             Date date = new Date();
                             String dateout = new SimpleDateFormat(MYDATE).format(date);
                             System.out.println(" the date is " + dateout);
    Timestamp timeStamp = new Timestamp(date.getTime());
    timeStamp.setNanos(0);
                             System.out.println(" the date is " + timeStamp);
                             String sql2 = "INSERT INTO DATE5 (stuff, date) VALUES ('hello', CVDATE(" + timeStamp + "))";
                             ProblemTrackingDB.DoUpdate(sql2);
                             sql2 = "INSERT INTO DATE5 (stuff, date) VALUES ('hello', '" + dateout + "')";
                             ProblemTrackingDB.DoUpdate(sql2);
    i have tried both of those ways and either work (ie... comment one out and try the other)
    i always get a " Syntax error in INSERT INTO statement" thrown
    i have also tried without the single quotes.
    Any help would Be MUCH appreciated as my boss is starting to get agrivated...
    thanks to anyone who helps,
    Jon

    Change your program to use a PreparedStatement to do this insert. You only need to create a PreparedStatement once, so in your constructor or initializer do this:PreparedStatement insert = connection.PrepareStatement("INSERT INTO DATE5 (stuff, date) VALUES (?, ?)");Then the code to write a record is this:Timestamp timeStamp = new Timestamp(date.getTime());
    timeStamp.setNanos(0);
    insert.setString(1, "hello");
    insert.setTimeStamp(2, timeStamp);
    insert.executeUpdate();That's all. You never need to mess about with formatting timestamps in the way your database needs them, the PreparedStatement takes care of all that for you.

Maybe you are looking for

  • Remote Desktop Connection on EA6500

    Very simple requirement.  New EA6500  Server (Win7Pro) on LAN  PC (Win8Pro) on LAN  Need to use Remote Desktop Connection to connect from PC to Server. The old LinkSys WRT54G worked fine. Also tried searching the web and speaking to support for a cou

  • Kernal: smb_iod_sendall: Timed out waiting on response

    With 10.7.4, when connected to windows 2008 r2 server using smb, I get kernal: smb_iod_sendall: Timed out waiting on response. How do I resolve this? This also happens on a 10.6.8 iMac. With the new 10.7.4 iMac, it is bound to our active directory do

  • How do you make a jar file for your program?

    Title says it all - I don't have software that automatically does it for me. Using text pad :O

  • Apple applications crashing after Mountain Lion update

    I have updated to Mountain Lion (10.8.1) update. Some apple applications are crashing after the upgrade. I have tried some third party applications and they run fine. The following is App Store crash report. Process:         App Store [1459] Path:   

  • MIGO in release 6.0

    Hi, my problem is this:in release 6.0 I'am executing a good receipts from delivery with type movement 101 but the system send me the message 'NR 751, XAB--> BELEGNR number range doesn't exist' but I have verified and the number range in customizing i