473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Update Query Failing when done from a Script.

Hi,

I have a script running which fails when it tries to execute an Update
query, but when i try to run the query from the SQLQueryAnalyzer it runs
fine.
Can somebody try and explain this phenomenon.

Any kind of help will be appretiated.

thanks,
santosh.
Jul 23 '05 #1
2 1435
On Thu, 20 Jan 2005 17:27:26 +0530, "Santosh" <sr***@cisco.com> wrote:
Hi,

I have a script running which fails when it tries to execute an Update
query, but when i try to run the query from the SQLQueryAnalyzer it runs
fine.
Can somebody try and explain this phenomenon.

Any kind of help will be appretiated.

thanks,
santosh.

It is hard when you have such a general story. But here are a few
guesses:

- Are you logged in using the same user and password from the same
host in both situations?

- Did your script connect to the mysql server? Did you check?

Maybe you could post (part) of the script and then we can try to
figure out what you are doing wrong.

Jonathan
Jul 23 '05 #2
Hi,

I did log on to the SQL Server with the same Login/pwd. I noticed one more
thing that this script is able to update the required vaules in some Servers
and in others it cant.
This is a code snippet which will give you an idea of what I am trying to
do.

void CIDPDBInstall:: UpdatePredefinedDDI(void)
{
std::string temp = CSVDDIClauseList[0].c_str();

fp = fopen(logFile, "a");
fprintf(fp,"UpdatePredefinedDDI\n");
std::string updateStmt = "update DigitDiscardInstruction set clause = '" +
temp + "' where fkDialPlan = '" + DialPlan_pkid + "' and name = 'NoDigits'";

fprintf(fp, "\n\n");
fprintf(fp,updateStmt.c_str());

pStmt = m_Con->createStatement();
pRs = pStmt->executeQuery(updateStmt);

delete pRs;
delete pStmt;

If there was a connection failure then i would have got an error message for
that in my logs, but that was not there.......... so i presume that there is
no problem with the connection part.

Any idea of whats happening ??

regards,
santosh.
"Jonathan" <jo******@heelal.nl> wrote in message
news:g4********************************@4ax.com...
On Thu, 20 Jan 2005 17:27:26 +0530, "Santosh" <sr***@cisco.com> wrote:
Hi,

I have a script running which fails when it tries to execute an Update
query, but when i try to run the query from the SQLQueryAnalyzer it runs
fine.
Can somebody try and explain this phenomenon.

Any kind of help will be appretiated.

thanks,
santosh.

It is hard when you have such a general story. But here are a few
guesses:

- Are you logged in using the same user and password from the same
host in both situations?

- Did your script connect to the mysql server? Did you check?

Maybe you could post (part) of the script and then we can try to
figure out what you are doing wrong.

Jonathan

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
4
by: René Kabis | last post by:
People, I am at my wit's end. I am using the exact code from http://aspnet.4guysfromrolla.com/articles/071002-1.aspx And yet, the code does not manage to update the database. When I go to...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
5
by: Leanne | last post by:
I am doing customization for Microsoft Pos. I am working on installation package now. I added some new tables and stored procuedures and generated SQL Script for that. During the installation...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not...
0
NeoPa
by: NeoPa | last post by:
Introduction : I have come across a problem, on a number of occasions, where PCs under my control fail to load new updates successfully. This is true whether they are attempting to apply via the...
13
by: Neil | last post by:
I'm running an update query in SQL 7 from QA, and it runs forever. Has been running for 20 minutes so far! The query is quite simple: update a single field in a table, based on a join with another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.