Click here to Skip to main content
15,897,187 members
Home / Discussions / Database
   

Database

 
AnswerRe: The conversion of the nvarchar value overflowed an int column. Pin
Simon_Whale3-Sep-13 5:37
Simon_Whale3-Sep-13 5:37 
GeneralRe: The conversion of the nvarchar value overflowed an int column. Pin
chdboy3-Sep-13 6:13
chdboy3-Sep-13 6:13 
AnswerRe: [solved]The conversion of the nvarchar value overflowed an int column. PinPopular
Bernhard Hiller3-Sep-13 23:28
Bernhard Hiller3-Sep-13 23:28 
GeneralRe: [solved]The conversion of the nvarchar value overflowed an int column. Pin
Eddy Vluggen3-Sep-13 23:52
professionalEddy Vluggen3-Sep-13 23:52 
GeneralRe: [solved]The conversion of the nvarchar value overflowed an int column. Pin
GuyThiebaut4-Sep-13 0:15
professionalGuyThiebaut4-Sep-13 0:15 
GeneralRe: [solved]The conversion of the nvarchar value overflowed an int column. Pin
chdboy4-Sep-13 17:35
chdboy4-Sep-13 17:35 
GeneralRe: [solved]The conversion of the nvarchar value overflowed an int column. Pin
Richard Deeming5-Sep-13 1:25
mveRichard Deeming5-Sep-13 1:25 
GeneralRe: [solved]The conversion of the nvarchar value overflowed an int column. Pin
jschell5-Sep-13 9:34
jschell5-Sep-13 9:34 
QuestionMySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 4:01
Jassim Rahma2-Sep-13 4:01 
AnswerRe: MySQL syntax error.. Please help... Pin
Mycroft Holmes2-Sep-13 12:53
professionalMycroft Holmes2-Sep-13 12:53 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 21:44
Jassim Rahma2-Sep-13 21:44 
AnswerRe: MySQL syntax error.. Please help... Pin
GuyThiebaut2-Sep-13 22:04
professionalGuyThiebaut2-Sep-13 22:04 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 22:53
Jassim Rahma2-Sep-13 22:53 
GeneralRe: MySQL syntax error.. Please help... Pin
GuyThiebaut2-Sep-13 23:10
professionalGuyThiebaut2-Sep-13 23:10 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 23:13
Jassim Rahma2-Sep-13 23:13 
GeneralRe: MySQL syntax error.. Please help... Pin
GuyThiebaut2-Sep-13 23:16
professionalGuyThiebaut2-Sep-13 23:16 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 23:19
Jassim Rahma2-Sep-13 23:19 
GeneralRe: MySQL syntax error.. Please help... Pin
GuyThiebaut2-Sep-13 23:32
professionalGuyThiebaut2-Sep-13 23:32 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma2-Sep-13 23:56
Jassim Rahma2-Sep-13 23:56 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma3-Sep-13 0:22
Jassim Rahma3-Sep-13 0:22 
GeneralRe: MySQL syntax error.. Please help... Pin
Jassim Rahma3-Sep-13 1:43
Jassim Rahma3-Sep-13 1:43 
QuestionPL/Mysql - can't run procedure with sql security invoker Pin
noislude1-Sep-13 15:59
noislude1-Sep-13 15:59 
Good evening from Brazil. I granted select and update to the user but I still can't run the procedure below. What are the other privileges I need to grant to him?

delimiter // 
drop procedure if exists sp_optimistic_locking // 
create procedure sp_optimistic_locking 
(
  p_from_account int, 
  p_to_account int, 
  p_transfer_amount numeric(10,2),
  p_status int, 
  p_message varchar(100)
)
sql security invoker
modifies sql data 
begin 
  declare l_account_balance1 numeric(10,2);
  declare l_account_balance2 numeric(10,2);
  declare l_account_timestamp1 timestamp; 
  declare l_account_timestamp2 timestamp; 
  
  select balance, account_timestamp into l_account_balance1, l_account_timestamp1
  from account_balance where account_id = p_from_account;  
  
  if l_account_balance1 >= p_transfer_amount then 

  start transaction; 

  -- call long_running_validation(p_from_account);

  select balance, account_timestamp into l_account_balance2, l_account_timestamp2 
  from account_balance where account_id = p_from_account for update; 
    
    if (l_account_balance1 <> l_account_balance2 or 
        l_account_timestamp1 <> l_account_timestamp2) then
       rollback; 
       set p_status = -1; 
       set p_message = concat('Transaction canceled due to previous update of account ', p_from_account);
    else 
       update account_balance set balance = balance - p_transfer_amount where 
       account_id = p_from_account; 
 
       update account_balance set balance = balance + p_transfer_amount where 
       account_id = p_to_account; 

       commit;
       set p_status  = 0; 
       set p_message = 'transaction ok'; 
    end if;
    else  
     set p_status = -1; 
     set p_message = 'Transaction canceled due to account balance less than desired withdrawal'; 
  end if; 
     select 'Transaction code', p_status; 
     select 'Transaction message', p_message;
end; 
//

QuestionPL/MySQL - can't load file Pin
noislude1-Sep-13 4:22
noislude1-Sep-13 4:22 
QuestionCan't create table - SQL 2008 R2 Pin
ThetaClear1-Sep-13 3:15
ThetaClear1-Sep-13 3:15 
AnswerRe: Can't create table - SQL 2008 R2 Pin
PIEBALDconsult1-Sep-13 3:35
mvePIEBALDconsult1-Sep-13 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.