[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::sql

Title:SQL notes
Moderator:NOVA::SMITHI
Created:Wed Aug 27 1986
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3895
Total number of notes:17726

3857.0. "INVOUTTAR" by M5::JAKUHN (RDB: 34% better than real life) Tue Jan 28 1997 14:13

    Hi,  Rdb 6.1. 
    
    The following module gets a
    %SQL-F-INVOUTTAR, parameter D has an invalid target for assignment
    error. both "x" and "d" are int. is it because d is a parameter and
    x is not?
    
    
    create module do_it
    language sql
    procedure do_it(:a integer,
                    :b double precision,
                    :c integer,
                    :d integer);
     begin
            declare :x integer;
     
            set transaction read write;
     
            insert into do_it_table values
            (:a,:b,:c,CURRENT_TIMESTAMP) ;
     
            get diagnostics exception 1 :x = returned_sqlcode;
     
            if :x = 0
               then
                   commit;
               else
                   rollback;
            end if;
     
            begin
                set :d = :d + :x ;  <--- took this out, no diff. 
            end;
            set :d = :x ;   <------- d & x are both int. 
     
        end;
            end module;
     
        commit ;
     
    set verify
    call do_it(1,2,3,4) ;
    %SQL-F-INVOUTTAR, parameter D has an invalid target for assignment
     
    
T.RTitleUserPersonal
Name
DateLines
3857.1can't update a parameter passed as literalM5::JAKUHNRDB: 34% better than real lifeTue Jan 28 1997 14:446
    I overlooked something very basic (thanks for the mail).  
    
    I was pasing in "d" as a literal, and of course you can't update a 
    literal (well, on unix you can), but not here. :-) 
    
    jay