473,320 Members | 1,939 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,320 software developers and data experts.

problem with update query

154 100+
I got a perl script that i am reading from a txt file
I then parse the data which all works but when i run the update queries
I get an error you have an error in your sql synax

this is the code i am using

Expand|Select|Wrap|Line Numbers
  1.         foreach (@rows) {
  2.         @_ = split;
  3.  
  4.  
  5.  
  6.       # EXECUTE THE QUERY FUNCTION
  7. #$execute = $connect->query($myquery);
  8.  #$connect->disconnect  or warn $dbh->errstr;
  9.  
  10.  
  11.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET queuename_prod = $_[0] where queuename_prod = $_[0]");
  12.  $sth->execute();
  13.  
  14.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET rcvrs_prod = $_[3] where queuename_prod = $_[0]");
  15.  $sth->execute();
  16.  
  17.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET number_of_msgs_prod = $_[4] where queuename_prod = $_[0]");
  18.  $sth->execute();
  19.  
  20.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET queue_size_prod = $_[5] $_[6] where queuename_prod = $_[0]");
  21. $sth->execute();
  22.  
  23. my $sth = $dbh->prepare("UPDATE JMS_PROD SET updated_date = NOW() where queuename_prod = $_[0]");
  24. $sth->execute();
  25.  
  26. print "updated record $_[0] \n\n\n";
  27. #sleep 3;
  28.  
  29.  
Could somebody please help me thanks
Jul 2 '07 #1
1 1406
r035198x
13,262 8TB
I got a perl script that i am reading from a txt file
I then parse the data which all works but when i run the update queries
I get an error you have an error in your sql synax

this is the code i am using

Expand|Select|Wrap|Line Numbers
  1.         foreach (@rows) {
  2.         @_ = split;
  3.  
  4.  
  5.  
  6.       # EXECUTE THE QUERY FUNCTION
  7. #$execute = $connect->query($myquery);
  8.  #$connect->disconnect  or warn $dbh->errstr;
  9.  
  10.  
  11.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET queuename_prod = $_[0] where queuename_prod = $_[0]");
  12.  $sth->execute();
  13.  
  14.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET rcvrs_prod = $_[3] where queuename_prod = $_[0]");
  15.  $sth->execute();
  16.  
  17.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET number_of_msgs_prod = $_[4] where queuename_prod = $_[0]");
  18.  $sth->execute();
  19.  
  20.  my $sth = $dbh->prepare("UPDATE JMS_PROD SET queue_size_prod = $_[5] $_[6] where queuename_prod = $_[0]");
  21. $sth->execute();
  22.  
  23. my $sth = $dbh->prepare("UPDATE JMS_PROD SET updated_date = NOW() where queuename_prod = $_[0]");
  24. $sth->execute();
  25.  
  26. print "updated record $_[0] \n\n\n";
  27. #sleep 3;
  28.  
  29.  
Could somebody please help me thanks
Does your engine indicate the line where the error was found? Indicate that if it does.
Jul 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kulnor | last post by:
My hosting company upgraded yesterday to pHp 4.3.10. Since then, all my INSERT/UPDATE/DELET query on our MS-SQL database seem to fail. No specific error message is returned by...
3
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field...
4
by: John Baker | last post by:
Hi: I have two tables, a setup table (TblSetup) and a purchase order table (tblPO). When i construct a query with ONLY the tblPO shown, and a type in parameter for the PO number, I an update...
6
by: John Baker | last post by:
Hi: As those who have looked at this newsgroup recently will realize, I am a neophyte with Access, although I have experienced with Approach (the Lotus product). There are things I could easily...
7
by: Patrick Fisher | last post by:
Hi I have a table which Contains entries with RefCode field containing INVP or INVPD Common fields in each entry would be InvoiceNo, Total and PurTyp for example. You could have ...
31
by: Lag | last post by:
Having a problem updating my database from a web page, through a submission form. Can anyone help? ----THIS IS MY CODE IN update.php----(user, pass, and database are typed in directly, I...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
15
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
1
by: giovannino | last post by:
Dear all, I did a query which update a sequence number (column NR_SEQUENZA) in a table using a nice code (from Trevor !). 1) Given that I'm not a programmer I can't understand why...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.