473,659 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SQLQueryAnalyze r it runs
fine.
Can somebody try and explain this phenomenon.

Any kind of help will be appretiated.

thanks,
santosh.
Jul 23 '05 #1
2 1443
On Thu, 20 Jan 2005 17:27:26 +0530, "Santosh" <sr***@cisco.co m> 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 SQLQueryAnalyze r 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:: UpdatePredefine dDDI(void)
{
std::string temp = CSVDDIClauseLis t[0].c_str();

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

fprintf(fp, "\n\n");
fprintf(fp,upda teStmt.c_str()) ;

pStmt = m_Con->createStatemen t();
pRs = pStmt->executeQuery(u pdateStmt);

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******@heela l.nl> wrote in message
news:g4******** *************** *********@4ax.c om...
On Thu, 20 Jan 2005 17:27:26 +0530, "Santosh" <sr***@cisco.co m> 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 SQLQueryAnalyze r 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
17004
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 must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
4
1666
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 update my database, I am able to get the form fields, and I am able to replace the data, but when I go "update", the old data remains. I have done everything correct, including this:
3
3441
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 the necessary records in it when testing it. I get the error "No value given for one or more required parameters." when I try to update the database. Can you tell me what am I doing wrong?
16
3485
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 in a hidden field) I wish the user to be able to edit the data in the table, so I have extracted the records into hiddenfield, textareas, dropdown list and checkbox so that they can make changes. I named these elements as arrays and wish to run an...
5
2109
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 process, after user entered the server name and database name, how to open the script file (*.sql) and run that to update database? So they don't have to open Query Analizer to run it. The idea is to get everything done during the installation...
3
2693
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 DataRec.EOF SKU = trim (DataRec("SKU")) ITEM_ID = trim(DataRec("ITEM_ID")) ...
0
9840
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 Automatic Updates facility built into the OS or whether accessing the MS Update site directly. Reason : The problem is often associated with DLL files not being correctly set up for some reason. Most of the suggested fixes involve registering a...
13
4165
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 table. There are a total of 1200 rows that are affected (out of a total of 60,000 in the table). Should not take 20 minutes! Also, retrieving the 1200 rows using the same criteria is instantaneous. Anyone have any idea what's going on? Here's...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.