cancel
Showing results for 
Search instead for 
Did you mean: 

regarding query for jdbc adapter

Former Member
0 Kudos

Hi All,

can JDBC adapter insert into a non-Char column in a table?

regards

Madhu

Accepted Solutions (0)

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Yes it can.

Actually for number you do not need any special settings,. but for characters you need to have a sepacial Attribute called hasQuot with value as No.

More,

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

<i>hasQuot= YES|NO During construction of the WHERE condition of the SQL statement, the table column type determines whether the default is to set the values in quotation marks (text column types) or not (numerical column types). In a few cases (for example, when using functions), it may be necessary to override this. This attribute enables you to do this. If YES, quotation marks are always set round the values for which this attribute is set in the SQL syntax. If NO, quotation marks are never set. Only use this attribute in individual cases.</i>

Regards

Bhavesh

Former Member
0 Kudos

but bhavesh,XI natively deals with Character data.

if u create it as a NUMBER then will it work?

bhavesh_kantilal
Active Contributor
0 Kudos

Madhu,

Assumiing this is the insert query you want to try,

<b>insert into tablename(ename,eno) values('bhavesh',123)</b>

Assuming ename is char and eno is a number. In this case for ename you need to use the attribute hasQuot = "Yes".

In this case, the output XML that goes to the JDBC adapter should be,

<root>

<statement>

<dbTableName action= "NSERT”>

<table>realDbTableName</table>

<access>

<b><ename hasQuot= "Yes">Bhavesh</ename>

<eno>123</eno></b>

</access>

<dbTableName>

</statement>

</root>

Regards

Bhavesh

Former Member
0 Kudos

what if i am going for update query?

Former Member
0 Kudos

Hi ,

<i><dbTableName action= "INSERT”></i>

Just change this to

<dbTableName action= "UPDATE”>

and specify the key fields ( The primary key field it can be one field or many if it is composite primary key ) under KEY tag

<KEY1>

<col1>

</col1>

...

</KEY1>

Thanks ,

Suvarna

bhavesh_kantilal
Active Contributor
0 Kudos

Check the link I have pointed above it explains the strucutre for Update as well,

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

Regards

Bhavesh