McGyver Posted May 17, 2010 Share Posted May 17, 2010 (edited) I am trying to run OSQL to update a customer ID. From a cmd line everything seems fine, but I am unable to get the Run statement to work correctly. I have been unable to troubleshoot as the window that opens when I do the Run doesnt stay open long enough to see if there is an error. Any help is greatly appreciated. Run ('C:\TEMP\osql.exe -S 192.68.1.1 -d Database -U USER -P PASSWORD -Q "update profile set custid = ''$NewID'' where custid = ''$OldID'' update calllog set custid = ''$NewID'' where custid = ''$OldID'' update subset set custid = ''$NewID'' where custid = ''$OldID''"', "" ) Edited May 17, 2010 by McGyver Link to comment Share on other sites More sharing options...
Developers Jos Posted May 17, 2010 Developers Share Posted May 17, 2010 try this to see if the cmd window stays open after the error: Run (@ComSpec & ' /k C:\TEMP\osql.exe -S 192.68.1.1 -d Database -U USER -P PASSWORD -Q "update profile set custid = ''$NewID'' where custid = ''$OldID'' update calllog set custid = ''$NewID'' where custid = ''$OldID'' update subset set custid = ''$NewID'' where custid = ''$OldID''"', "" ) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
McGyver Posted May 17, 2010 Author Share Posted May 17, 2010 try this to see if the cmd window stays open after the error: Run (@ComSpec & ' /k C:\TEMP\osql.exe -S 192.68.1.1 -d Database -U USER -P PASSWORD -Q "update profile set custid = ''$NewID'' where custid = ''$OldID'' update calllog set custid = ''$NewID'' where custid = ''$OldID'' update subset set custid = ''$NewID'' where custid = ''$OldID''"', "" ) That gets me a window that stays open. The response back from OSQL is that 0 rows were affected. If I fill in the variables with the actual values, everything works fine. Is it not possible to use variable in the way that I have? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 17, 2010 Developers Share Posted May 17, 2010 Didn't look at the whole line before. this should be close to also use the variables: Run (@ComSpec & ' /k C:\TEMP\osql.exe -S 192.68.1.1 -d Database -U USER -P PASSWORD -Q "update profile set custid = ''' & $NewID & ''' where custid = ''' & $OldID & ''' update calllog set custid = ''' & $NewID & ''' where custid = ''' & $OldID & ''' update subset set custid = ''' & $NewID & ''' where custid = ''' & $OldID & '''"', "" ) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
McGyver Posted May 17, 2010 Author Share Posted May 17, 2010 Thanks That did the trick. I think working while sick clogs the brain a bit. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now