List:General Discussion« Previous MessageNext Message »
From:luis perez Date:April 27 2006 1:54pm
Subject:Update not working in a script, but going fine running with MySQL Browser
View as plain text  
Hi guys.
Got a problem when adding records to an existing table, as part of a sql 
script.
There are  a couple of fields that don't get added as they should 
(respaccstopframe and acstpradiusid).
This is the update command:

insert into temp_s1 (accsesid, respaccstopframe, acstpradiusid, sgsnip, 
sgsnip_subnet, sgsnip_last, ggsnip, subip, startime, stoptime)
select r1.radius_acct_session_id, t.frame_number, r1.radius_id, 
r1.radius_XXX_Address, substring_index(r1.radius_XXX_Address,".",3),
substring_index(r1.radius_XXX_Address,".",-1),r1.radius_NAS_IP_Address, 
r1.radius_Framed_IP_Address, f.frame_time, r1.frame_time
from radius r1, temp_respaccstopframe t, frame f
where r1.frame_number = t.r1_fn and f.frame_number= t.syntstart_number and 
t.noacstart=1 and t.started_in >=0;

I didn't received any error, but fields were not added. I added an update 
command for those two fields just right after in the script.

# no preguntes por que lo hago dos veces...los duendes del sw...
update temp_s1 s1, temp_respaccstopframe t
set s1.respaccstopframe= t.frame_number, s1.acstpradiusid=t.radius_id
where s1.accsesid=t.radius_acct_session_id and 
s1.ggsnip=t.radius_NAS_IP_Address and t.noacstart=1 and t.started_in >=0;

Same result.
Then I run the update from MyQSL Browser and then worked fine...!!?

I've run same script and update command thru Browser with same table in both 
MySQLv4.1 and v5.0. No change.

I know it sounds crazy, but can anyone add some light on this?

TIA.
Luis.

_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en 
MSN Motor. http://motor.msn.es/researchcentre/

Thread
Update not working in a script, but going fine running with MySQL Browserluis perez27 Apr
  • Re: Update not working in a script, but going fine running withMySQL Browsermysql27 Apr
    • Multiple primary keysnngau27 Apr
      • Re: Multiple primary keyschriswhite27 Apr
      • Re: Multiple primary keysKishore Jalleda27 Apr
        • RE: Multiple primary keysnngau27 Apr
          • Re: Multiple primary keysGordon27 Apr