Skip to Content
author's profile photo Former Member
Former Member

How can i replace column name using reciever JDBC adapter on runtime.

Hi Experts,

I have a problem with reciever JDBC synario.

Target Oracle table has columns named 2 bytes Japanese character like "日本".

Datatype cannot accept 2bytes character as element name.

So, I would like to how to replace column name on runtime.

Please tell me.

Regards,

Shinya Kawaoge

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2011 at 11:02 AM

    You can rename table column name with ALTER TABLE sql command.

    To rename a column in an existing table, the ALTER TABLE syntax is:

    ALTER TABLE table_name
     RENAME COLUMN old_name to new_name;

    You can insert the ALTER TABLE command in a Stored Procedure, and call it from JDBC Channel.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2011 at 12:57 PM

    Hi ,

    You can use Native SQL format.

    XML Document Format for the Message Protocol Native SQL Format

    This protocol is primarily for test purposes only. Instead of an XML document format, a text is expected that represents any valid SQL statement.

    When inserting a line into a table the corresponding document looks as follows:

    u201E

    INSERT INTO tableName (column-name1, column-name2, column-name3) VALUES(u2018column-value1u2019, u2018column-value2u2019, u2018column-value3u2019)

    u201C

    Refer this docs last section

    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 25, 2011 at 07:12 PM

    Hi Shinya Kawagoe,

    I understand there is a column with two Japanese characters in target database table. Now you want to UPDATE or INSERT data in that table. You do not want to rename the column name in the database table (if you want to rename column, ask the target database admin 😊 ).

    As Japanese characters are not allowed in XML Data Type in ESR. You can [Define a SQL_QUERY Statement|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b7855fde93673e10000000a114a6b/frameset.htm]. Check the Addres日本s in below code.

    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access> UPDATE Customers SET CompanyName=u2019$NAME$u2019, Addresu65E5u672Cs=u2019$ADDRESS$' WHERE CustomerID='$KEYFIELD$u2019
          </access>
          <key>
            <NAME>Firma</NAME>
            <ADDRESS>Strasse 3 </ADDRESS>
            <KEYFIELD>FI</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    </root>

    Regards,

    Raghu_Vamsee

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2011 at 05:15 AM

    Hi experts,

    I solved this problem using SQL_DML.

    Thanks for replies.

    Regards

    Shinya Kawagoe

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.