Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

Re: How to handle rowversion (timestamp) datatype of Microsoft Sql Server in PB?

$
0
0

ok I called GetExpenseById stored proc using DECLARE-EXECUTE-FETCH-CLOSE and it worked. In PB I use a blob variable to store value of rowv column of the row retrieved.

 

Then I called UpdateExpense stored proc using DECLARE-EXECUTE-CLOSE and it failed on EXECUTE. This is the error information in SQLCA:

 

SQLCode = -1

SQLDBCode = 257

SQLErrText =

SQLSTATE = 42000

Microsoft OLE DB Provider for SQL Server

Implicit conversion from data type varchar to timestamp is not allowed. Use the CONVERT function to run this query.

 

How come? Is PB treating that value in blob as varchar?

 

This is the PB code:

 

longlong lll_expense_trans_id

long ll_expense_code

dec{2} ldc_expense_amount

blob lbl_rowv

 

lll_expense_trans_id = 1

 

DECLARE GetById PROCEDURE FOR GetExpenseById

@a_expense_trans_id = :lll_expense_trans_id

USING SQLCA;

 

EXECUTE GetById;

 

FETCH GetById INTO

:lll_expense_trans_id,

:ll_expense_code,

:ldc_expense_amount,

:lbl_rowv;

 

CLOSE GetById;

 

DECLARE UpdateById PROCEDURE FOR UpdateExpense

@a_expense_trans_id = :lll_expense_trans_id,

@a_expense_code = :ll_expense_code,

@a_expense_amount = :ldc_expense_amount,

@a_rowv = :lbl_rowv

USING SQLCA;

 

EXECUTE UpdateById;

 

CLOSE UpdateById;


Viewing all articles
Browse latest Browse all 7329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>