dw.update returns database error = -3

Hi friends,

can you help me with my problem?

I tried to create a dw to set different price level for different item.
but cannot update the dw.


I created a datawindow with the following sql syntax:
  SELECT
         "itempricelevel"."iplevelid",
         "itempricelevel"."plevelid",
         "itempricelevel"."itemid",
         "itempricelevel"."customprice",
         "item"."itemprice",
         "item"."boughtprice",
         "item"."itemnm"
    FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
"itempricelevel"."itemid" = "item"."itemid"}

and then put that datawindow into dw_2 control.


The following is the script to update dw_2:

int ii
long ll_row, ll_result
string ls_result

for ii = 1 to dw_2.rowcount( )

  ls_result = dw_2.inv_base.of_getitem(ii, "customprice")

 if ls_result = "" then
  ll_result = dw_2.deleterow(ii)
 else
  if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
   ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
  end if
 end if
next

ll_result = dw_2.update()
if ll_result <> 1 then
 messagebox("error", "saved failed")
 sqlca.of_rollback()
else
 sqlca.of_commit()
 messagebox("error", "saved success")

end if


The update failed and returned:
-----------------------------------------------------------------------
A database error has occurred
Database error code = -3

database error message:
row changed between retrieve and update

no changes made to the database

DELETE FROM "itempricelevel" where "iplevelid" IS NULL
------------------------------------------------------------------------


many thanks in advance,
rony


0
Rony
2/5/2005 4:10:21 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

3 Replies
505 Views

Similar Articles

[PageSpeed] 45

no need to comment on this, i've changed the logic and it worked !

thanks,
rony
"Rony Santoso" <rony_xg@yahoo.de> wrote in message
news:4204efe4@forums-2-dub...
> Hi friends,
>
> can you help me with my problem?
>
> I tried to create a dw to set different price level for different item.
> but cannot update the dw.
>
>
> I created a datawindow with the following sql syntax:
>   SELECT
>          "itempricelevel"."iplevelid",
>          "itempricelevel"."plevelid",
>          "itempricelevel"."itemid",
>          "itempricelevel"."customprice",
>          "item"."itemprice",
>          "item"."boughtprice",
>          "item"."itemnm"
>     FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
> "itempricelevel"."itemid" = "item"."itemid"}
>
> and then put that datawindow into dw_2 control.
>
>
> The following is the script to update dw_2:
>
> int ii
> long ll_row, ll_result
> string ls_result
>
> for ii = 1 to dw_2.rowcount( )
>
>   ls_result = dw_2.inv_base.of_getitem(ii, "customprice")
>
>  if ls_result = "" then
>   ll_result = dw_2.deleterow(ii)
>  else
>   if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
>    ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
>   end if
>  end if
> next
>
> ll_result = dw_2.update()
> if ll_result <> 1 then
>  messagebox("error", "saved failed")
>  sqlca.of_rollback()
> else
>  sqlca.of_commit()
>  messagebox("error", "saved success")
>
> end if
>
>
> The update failed and returned:
> -----------------------------------------------------------------------
> A database error has occurred
> Database error code = -3
>
> database error message:
> row changed between retrieve and update
>
> no changes made to the database
>
> DELETE FROM "itempricelevel" where "iplevelid" IS NULL
> ------------------------------------------------------------------------
>
>
> many thanks in advance,
> rony
>
>


0
Rony
2/7/2005 6:34:31 AM
This is a multi-part message in MIME format.
--------------090809060401040908030601
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

are you sure the error went away because of any change you made ?
The -3 is the classic Optimistic Concurrency control error.  PB adds a 
few other columns to the where clause of the update statement. If 
another process has changed the record while your user was filling in 
the DW, then the update finds nothing. Internally, PB checks the 
@@rowcount, and if it is zero, then you get the -3 error.

Rony Santoso wrote:

>no need to comment on this, i've changed the logic and it worked !
>
>thanks,
>rony
>"Rony Santoso" <rony_xg@yahoo.de> wrote in message
>news:4204efe4@forums-2-dub...
>  
>
>>Hi friends,
>>
>>can you help me with my problem?
>>
>>I tried to create a dw to set different price level for different item.
>>but cannot update the dw.
>>
>>
>>I created a datawindow with the following sql syntax:
>>  SELECT
>>         "itempricelevel"."iplevelid",
>>         "itempricelevel"."plevelid",
>>         "itempricelevel"."itemid",
>>         "itempricelevel"."customprice",
>>         "item"."itemprice",
>>         "item"."boughtprice",
>>         "item"."itemnm"
>>    FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
>>"itempricelevel"."itemid" = "item"."itemid"}
>>
>>and then put that datawindow into dw_2 control.
>>
>>
>>The following is the script to update dw_2:
>>
>>int ii
>>long ll_row, ll_result
>>string ls_result
>>
>>for ii = 1 to dw_2.rowcount( )
>>
>>  ls_result = dw_2.inv_base.of_getitem(ii, "customprice")
>>
>> if ls_result = "" then
>>  ll_result = dw_2.deleterow(ii)
>> else
>>  if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
>>   ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
>>  end if
>> end if
>>next
>>
>>ll_result = dw_2.update()
>>if ll_result <> 1 then
>> messagebox("error", "saved failed")
>> sqlca.of_rollback()
>>else
>> sqlca.of_commit()
>> messagebox("error", "saved success")
>>
>>end if
>>
>>
>>The update failed and returned:
>>-----------------------------------------------------------------------
>>A database error has occurred
>>Database error code = -3
>>
>>database error message:
>>row changed between retrieve and update
>>
>>no changes made to the database
>>
>>DELETE FROM "itempricelevel" where "iplevelid" IS NULL
>>------------------------------------------------------------------------
>>
>>
>>many thanks in advance,
>>rony
>>
>>
>>    
>>
>
>
>  
>

--------------090809060401040908030601
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
are you sure the error went away because of any change you made ?<br>
The -3 is the classic Optimistic Concurrency control error.&nbsp; PB adds a
few other columns to the where clause of the update statement. If
another process has changed the record while your user was filling in
the DW, then the update finds nothing. Internally, PB checks the
@@rowcount, and if it is zero, then you get the -3 error.<br>
<br>
Rony Santoso wrote:<br>
<blockquote type="cite" cite="mid42070bf7@forums-1-dub">
  <pre wrap="">no need to comment on this, i've changed the logic and it worked !

thanks,
rony
"Rony Santoso" <a class="moz-txt-link-rfc2396E" href="mailto:rony_xg@yahoo.de">&lt;rony_xg@yahoo.de&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:4204efe4@forums-2-dub">news:4204efe4@forums-2-dub</a>...
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi friends,

can you help me with my problem?

I tried to create a dw to set different price level for different item.
but cannot update the dw.


I created a datawindow with the following sql syntax:
  SELECT
         "itempricelevel"."iplevelid",
         "itempricelevel"."plevelid",
         "itempricelevel"."itemid",
         "itempricelevel"."customprice",
         "item"."itemprice",
         "item"."boughtprice",
         "item"."itemnm"
    FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
"itempricelevel"."itemid" = "item"."itemid"}

and then put that datawindow into dw_2 control.


The following is the script to update dw_2:

int ii
long ll_row, ll_result
string ls_result

for ii = 1 to dw_2.rowcount( )

  ls_result = dw_2.inv_base.of_getitem(ii, "customprice")

 if ls_result = "" then
  ll_result = dw_2.deleterow(ii)
 else
  if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
   ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
  end if
 end if
next

ll_result = dw_2.update()
if ll_result &lt;&gt; 1 then
 messagebox("error", "saved failed")
 sqlca.of_rollback()
else
 sqlca.of_commit()
 messagebox("error", "saved success")

end if


The update failed and returned:
-----------------------------------------------------------------------
A database error has occurred
Database error code = -3

database error message:
row changed between retrieve and update

no changes made to the database

DELETE FROM "itempricelevel" where "iplevelid" IS NULL
------------------------------------------------------------------------


many thanks in advance,
rony


    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>

--------------090809060401040908030601--

0
Andrew
2/8/2005 9:49:49 AM
This is a multi-part message in MIME format.
--------------020001000607080400030909
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

are you sure the error went away because of any change you made ?
The -3 is the classic Optimistic Concurrency control error.  PB adds a 
few other columns to the where clause of the update statement. If 
another process has changed the record while your user was filling in 
the DW, then the update finds nothing. Internally, PB checks the 
@@rowcount, and if it is zero, then you get the -3 error.

Rony Santoso wrote:

>no need to comment on this, i've changed the logic and it worked !
>
>thanks,
>rony
>"Rony Santoso" <rony_xg@yahoo.de> wrote in message
>news:4204efe4@forums-2-dub...
>  
>
>>Hi friends,
>>
>>can you help me with my problem?
>>
>>I tried to create a dw to set different price level for different item.
>>but cannot update the dw.
>>
>>
>>I created a datawindow with the following sql syntax:
>>  SELECT
>>         "itempricelevel"."iplevelid",
>>         "itempricelevel"."plevelid",
>>         "itempricelevel"."itemid",
>>         "itempricelevel"."customprice",
>>         "item"."itemprice",
>>         "item"."boughtprice",
>>         "item"."itemnm"
>>    FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
>>"itempricelevel"."itemid" = "item"."itemid"}
>>
>>and then put that datawindow into dw_2 control.
>>
>>
>>The following is the script to update dw_2:
>>
>>int ii
>>long ll_row, ll_result
>>string ls_result
>>
>>for ii = 1 to dw_2.rowcount( )
>>
>>  ls_result = dw_2.inv_base.of_getitem(ii, "customprice")
>>
>> if ls_result = "" then
>>  ll_result = dw_2.deleterow(ii)
>> else
>>  if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
>>   ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
>>  end if
>> end if
>>next
>>
>>ll_result = dw_2.update()
>>if ll_result <> 1 then
>> messagebox("error", "saved failed")
>> sqlca.of_rollback()
>>else
>> sqlca.of_commit()
>> messagebox("error", "saved success")
>>
>>end if
>>
>>
>>The update failed and returned:
>>-----------------------------------------------------------------------
>>A database error has occurred
>>Database error code = -3
>>
>>database error message:
>>row changed between retrieve and update
>>
>>no changes made to the database
>>
>>DELETE FROM "itempricelevel" where "iplevelid" IS NULL
>>------------------------------------------------------------------------
>>
>>
>>many thanks in advance,
>>rony
>>
>>
>>    
>>
>
>
>  
>

--------------020001000607080400030909
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
are you sure the error went away because of any change you made ?<br>
The -3 is the classic Optimistic Concurrency control error.&nbsp; PB adds a
few other columns to the where clause of the update statement. If
another process has changed the record while your user was filling in
the DW, then the update finds nothing. Internally, PB checks the
@@rowcount, and if it is zero, then you get the -3 error.<br>
<br>
Rony Santoso wrote:<br>
<blockquote type="cite" cite="mid42070bf7@forums-1-dub">
  <pre wrap="">no need to comment on this, i've changed the logic and it worked !

thanks,
rony
"Rony Santoso" <a class="moz-txt-link-rfc2396E" href="mailto:rony_xg@yahoo.de">&lt;rony_xg@yahoo.de&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:4204efe4@forums-2-dub">news:4204efe4@forums-2-dub</a>...
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi friends,

can you help me with my problem?

I tried to create a dw to set different price level for different item.
but cannot update the dw.


I created a datawindow with the following sql syntax:
  SELECT
         "itempricelevel"."iplevelid",
         "itempricelevel"."plevelid",
         "itempricelevel"."itemid",
         "itempricelevel"."customprice",
         "item"."itemprice",
         "item"."boughtprice",
         "item"."itemnm"
    FROM {oj "itempricelevel" RIGHT OUTER JOIN "item" ON
"itempricelevel"."itemid" = "item"."itemid"}

and then put that datawindow into dw_2 control.


The following is the script to update dw_2:

int ii
long ll_row, ll_result
string ls_result

for ii = 1 to dw_2.rowcount( )

  ls_result = dw_2.inv_base.of_getitem(ii, "customprice")

 if ls_result = "" then
  ll_result = dw_2.deleterow(ii)
 else
  if dw_2.inv_base.of_getitem(ii, "plevelid") = "" then
   ll_result = dw_2.inv_base.of_setitem (ii, "plevelid", "13")
  end if
 end if
next

ll_result = dw_2.update()
if ll_result &lt;&gt; 1 then
 messagebox("error", "saved failed")
 sqlca.of_rollback()
else
 sqlca.of_commit()
 messagebox("error", "saved success")

end if


The update failed and returned:
-----------------------------------------------------------------------
A database error has occurred
Database error code = -3

database error message:
row changed between retrieve and update

no changes made to the database

DELETE FROM "itempricelevel" where "iplevelid" IS NULL
------------------------------------------------------------------------


many thanks in advance,
rony


    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>

--------------020001000607080400030909--

0
Andrew
2/8/2005 9:50:12 AM
Reply:

Similar Artilces:

VS2005 - using detailsview to update, insert and delete rows from SQL 2005 database. Delete and insert work but update does not
  Using VS 2005 DetailsView to insert, delete, and update rows in SQL 2005 database.  insert and delete work but update does not.  I recieve no errors and the detailsView comes back unchanged (as well as table row is unchanged).   I am trying to use as little code behind as possible. However I do have ItemUpdating routines that seem to work (i.e Checking table for new login duplicates and encrypting passwords).  The following is the source code generated by VS2005:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="frmDbRegionMgr...

powerbuilder update fails to return error in mysql
Hi Friends this is all about powebuilder i am using powerbuilder 7 and mysql the issue is i created an before update trigger on a table where in i raised error if a column status = 'A'. If i update table using sql update it raised error and transaction fails. But with my powerbuilder application my datawindow get updated it cannot trace the sql_error. update() didnt return any thing and rows_affected return valid rows it updated the table. Even though there is an error in trigger. Funny part is the after update triggers or any other dependent trigger also fails Stra...

filtered datawindow... update() error
I use.. powerbuilder 7.01 build 6012 filtered datawindow exists problem. update.. all right.. after inserting new row, but after changing 'retrieved data', update() crash powerbuilder... this problem.. Is corrected in build 70?? ? Should I upgrade powerbuilder-build70__ ? please answer.. bye~ Choong Su Kim, Could you please post the complete error message you see ? This may help us locate the problem. HTH Sanjiv Das [TeamSybase] "choong su kim" <simiy@kebi.com> wrote in message news:yREEEi#R$GA.98@forums.sybase.com... > I use.....

DataWindow Error : DataWindow does not have UPDATE capability
Hi! I have faced the above error message when I clicked on my saved button which is suppose to save any updates. The strange thing is, the changes are being captured! When I retrieve the particular record I changed, I reflected the changes I made to it. I created a window with a few tab pages, with 1 datawindow control on each tab page, anyway, my other window with a few tab pages works fine. So what's wrong? Any help will be appreciated! :) KCM wrote: > > Hi! > I have faced the above error message when I clicked on my saved button > which is suppose to save...

Update method returns no errors but access database doesn't have the new records?
I am cross-posting this to this forum too. IS that ok? I noticed that this forum has a little bit more activity. So I apologize in advance: Hello, I have code that is inserting records into a DataSet by using the ImportRows method with another dataset as follows: For Each rowName In tblRemoteTable.Rows tblWebTable.ImportRow(rowName) Next Notice there are two DataTables from two DataSets. The WebTable is being updated from the RemoteTable. This code executes fine and adding code to iterate the WebTable rows and columns show that in fact all of the rows have bee...

Update Sql statement does not update. No error returned.
 I cannot get this update code to work. I want to update a row a my database based on information I gathered from textboxes and dropdownlists. When I submit the information, nothing happens. I get no error message. I have a try-catch statement that attempts to trap the error, but it does not nothing. What could be the problem? There are other columns in this row in the DB but only the ones that need updating are in the SQL statement. I've tried rewriting the statement with apostrophes but it didn't help. Using vb 2008. Any help could be appreciated. Maybe there is s...

Return charater causes DW update error and PB crash (re-post from the pb.general group)
Hi All PB 10.0.1, MSSQLServer 2000 We've got a field (defined as Char) that takes standard input... included in this is the odd carriage return (though we've got triggers preventing saving of said bad character).. When this was running with PB 8, the save went through without issue... As soon as app was migrated to PB 10 (no change in back end with migration to 10), the save started blowing up (cannot insert NULL error, even though we can see the value in the insert/update statement... only weird part is that in both the error msg and a DB Trace, the return key...

ERROR: DataWindow definition not set. Error after 2nd update
Hi all, I'm getting an error on a datawindow on a web page that seems to work fine for a while. The error appears on the page, "Error: Datawindow definiation not set' I'm using powerdynamo, jaguar and powersite. I'm getting the error on a datawindow that has an update button on it, but I only get the error if the datawindow is updated twice. I added the Save/Update button in the datawindow painter. I'm using the defaults for most of the sybase html datawindow dtc and am using the generated code. I use a SESSION variable for the retrieval argument: ...

Update works in PB Datawindow Preview but not using dw.update() function
The following select statement will update successfully within the datawindow painter, when performing a preview, changing a value and updating the datawindow. But when running the application, changing the value and performing the .Update() function the data is unchanged in the database, however the return code is 1(successful): 1)The update properties of the datawindow are correct. 2)Inserting and Deleting rows work, but Updating and existing record does not work. 3)I also took out the UNION, thinking that may have something to do with it, NOT. Has anyone experienced this? ...

Datalist Update Problem (cmdUpdate.Parameters error trying to update database)
Hello ~This page recieves an id in the url.  It then populates the itemtemplate containers with the data.  Everything works fine except updating the database.  I have this exact code structure working with another table and it works perfectly.  I think it isn't recognizing my textboxes in the datalist edititem template, but I can't figure it out.  Any help is greatly appreciated. Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the...

Select error: An error occurred, yet no message was returned by the database driver.
I have developed a datawindow from some complex SQL running against a DB2 database. When I run this through PowerBuilder I get the following message: "Select error: An error occurred, yet no message was returned by the database driver." This happens the first time I run it but when I run it again I don't get any error and the datawindow retrieves the correct data. I have run the SQL against DB2 using the database interface (DB2CMD) and it returns the correct data but returns the following warning message: "SQL0437W Performance of this complex query may be...

Error: Failure updating the Directory Services database. Error code -663
I have a single NW5.1 sp8 server on which I had installed eDirectory 8.7.3.6 before the notice came out to back rev to 8.7.3.4. Over the weekend the SYS hard drive failed. I have installed another drive and am trying to load 5.1sp8 from using the overlay CD; I am calling this a new server installation when that question is asked, since there is no SYS information available, but I am telling the installation wizard to only replace the SYS volume. Everything proceeds fine until it gets to the X-Graphics screen, and then I get an error message "Failure updating the Directory Services ...

Customize database error messages in datawindow using the PFC error service
Hi, I want to customize database error messages in datawindows to display text from the messages table using the PFC error service. Any ideas or suggestions ? Thanks in advance Prasad prasad_bhanchand@launch.com On Wed, 25 Jun 1997 17:25:45 -0500, Bhanchand Prasad <bhanchand_prasad@launch.com> wrote: >Hi, > >I want to customize database error messages in datawindows to display >text from the messages table using the PFC error service. Any ideas or >suggestions ? Hi Prasad, If you are using the pfc_save window event sequence to save your da...

dw error updates without retrieve when using stored proc update
Datawindow error Update without retrieve This problem happens only when using JDM JDBC Microsoft VM. I have tried it using ODBC and it works fine. I have not succeeded in getting the JDS JDBC Sun VM to work at all. By the way, using the old style update clause works fine for the same dwindow ie: pb sends multiple update statements to the server. I am sure I am missing some critical piece of information to make this work. ...

dw error updates without retrieve when using stored proc update
Datawindow error Update without retrieve I need help in understanding the new feature in pb7 which allows the use of stored procs to update dwindows. I cannot find Sybase documentation about this. This is conceptually a very different method updating multiple row changes. By the way, using the old style update clause works fine for the same dwindow ie: pb sends multiple update statements to the server. I searched for this topic and found this message posted a while ago. There was a reference to ww.justpbinfo.com/techdocs/rowchange.asp but that article talks to newbies and is...

Web resources about - dw.update returns database error = -3 - sybase.powerbuilder.datawindow

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

ERISA and All Claim databases
... laws, on the books in 18 states, requiring self-insured employers to report data about the prices they pay to β€œall payer claims databases.” ...

Five million customers affected by Vtech database hack
Toy and educational material seller Vtech has revealed five million customers were affected by a hack of its app database and has also suspended ...


Old database dump from Nexus Mods circulating in criminal circles: Change password
Nexus Mods, a gaming site which has mods for 216 games , warned users about a β€œ potential database breach ” after a Reddit user was alerted by ...

Change your passwords: NexusMods suffers database breach
... security breach by posts on reddit. Cybersecurity firm REN-ISAC had apparently contacted several university IT departments about a database ...

EFF confirms that the DEA has deleted its phone call database
Earlier this year, it was revealed that the NSA's massive surveillance program had a precursor: the Drug Enforcement Administration's USTO, which ...

VTech Admits Lack of Database Security Opened Door to Hack
A SQL injection, a common software flaw, was found to be the root cause in the VTech breach.

Animal Venom Database Could Be Boon To Drug Development
A new public database that catalogs animal toxins could spur the development of new drugs made with compounds found in animal venom.

Resources last updated: 12/19/2015 9:18:03 PM