We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE: [sap-dev] How to Update a Database Table Field (Type Integer) Using NATIVE SQL

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from horacio zapettini on Jan 23 at 6:35 AM
Hi,
There are some things missing here:

1. database server (oracle, informix, sy-base, mssql server?)
2. are you connecting to the database via exec sql before that update?
3. does the user your basis have defined to connect to the database has enough rights to update the database (in other words if you log into the OS with the user your basis have defined and you run the database admin software and you run that update, are you getting status set to 0 ?
4. does u_cars_sap has update right granted for the user your basis have defined to be used? In my case, we have two different users to connect the rdbms via exec sql: one with select granted so most of the programs use that user, and another with update/insert/delete granted that is used with quite specific programs)

5. the basic one, i_sernr has a valid value? in other words, if you run before the update this nativ sql:
data: wa_plaisiono(40).
wa_plaisiono = '******'
exec sql.
select plaisiono from u_cars_sap into :wa_plaisiono where plaisiono = :i_sernr
endexec.

are you getting a valid value? (if this is true, I'd go in the rights way. If you aren't getting a valid value then i_sernr does not exist in the table u_cars_sap and thus the update is not getting done.
6. is there another exec sql updating fields on u_cars_sap in the same sequence after this update? Perhaps you'd need a database commit work (or stuff like that) after that update (we faced that issue in a long sequence of inserts/updates once. The statement deppends on the underlying database server.

Horacio
Ps: the more info you provide the better solution you'll get.

---------------Original Message---------------
From: andchi
Sent: Wednesday, January 23, 2013 3:25 AM
Subject: How to Update a Database Table Field (Type Integer) Using NATIVE SQL

Hi. I am trying to update a database table field (type integer) using NATIVE SQL.

The code is
EXEC SQL .
UPDATE [KosmocarUsedNew].[dbo].[u_cars_sap]
SET: status = 0
WHERE plaisiono = :i_sernr
ENDEXEC.

It returns sy-subrc = 0 but the value does not update.
Is there anything else I need to do? or need more rights on the basis?

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2013 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
horacio zapettini  

12 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Toolbox.com for iPhone & Android: Ask Questions & Get Answers Anywhere. Download the Free App

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language