Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3978616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:04:12+00:00 2026-05-20T05:04:12+00:00

My INSERT, DELETE statements won’t work and I dont know why . . .

  • 0

My INSERT, DELETE statements won’t work and I dont know why . . . in fact it’s driving me crazy. Please see my attached scrpits. I have been using the Open Perl IDE as well as Notebook++ to contrast and work on these scripts. As far as I can tell there is nothing the matter with them and it’s driving me nuts. I have checked the file permissions for the database. I can search for information in the database and display all the items in the database but I cant INSERT, DELETE, or UPDATE.

Below find the link to my page (formatting of the page will be better when I can get some functionality):
http://129.2.168.163/cm485a2/project1.html

Please help.

#!/usr/bin/perl -w


use strict;
#use DBI;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);  # provide descriptive error messages
use Win32::ODBC;  #use ODBC package vs. DBI as in text

print header(); # print out "Content-Type: text/html\n\n"

# Get user's desired action from form
my $action = param('form_action');

# Connect to database
my $db = new Win32::ODBC("DSN=rreAccesscm485a2; UID=cm485a; PWD=kbradford68g")
     or die Win32::ODBC::Error();

my $cust_ID;
    my $fName;
my $mI;
my $lName;
my $street;
my $city;
my $state; 
my $zip_Code;
my $DOB;
my $agent_ID;
my $home_Phone;
my $cell_Phone;
my $profession;
my $employer;
my $referrer;

$cust_ID     = param('cust_ID');
$fName = param('first_Name');
    $mI = param('mI');
    $lName = param('last_Name');
    $street = param('street_Name');
    $city = param('city');
    $state = param('state');
    $zip_Code = param('zip_Code');
    $DOB = param('DOB');
    $agent_ID = param('agent_ID');
    $home_Phone = param('home_Phone');
    $cell_Phone = param('cell_Phone');
    $profession = param('profession');
    $employer = param('employer');
    $referrer = param('referrer');
    my $sql;

    $sql  = qq{INSERT INTO customer (Customer ID, first_Name, mI, last_Name,};
    $sql .= qq{street_Name, city, state, zip_Code, DOB};
    $sql .= qq{agent_ID, home_Phone, cell_Phone, profession, employer, referrer)};

    $sql .= qq{ VALUES ('$cust_ID','$fName','$mI','$lName','$street','$city',};
    $sql .= qq{'$state','$zip_Code','$DOB','$agent_ID','$home_Phone','$cell_Phone',};
    $sql .= qq{'$profession', '$employer', '$referrer')};

    #print '$sql=' . $sql . "\n";
    if ($db->Sql($sql)) 
    {
print "SQL Error: " . $db->Error() . "\n";
    print qq(<html><head><title>Database Error</title>
</head>
    <body><center><font size="6">Error with database call.</font>
    <hr />
    <font size="4" color="red">ODBC DB Error</font><br />
    <font size="3">Please hit your <b>Back</b> button to re-enter the data and try    again.</font></center>
    </body>
</html>);
exit;
}

sub Display_Page {
print qq(<html><head><title>Record Added!</title></head>
         <body>
            <center>
            <font size="6">Record Added!</font>
            <hr />
            <font size="4">
            <a href="http://129.2.168.163/cm485a2/project1.html">Back to Main Page</a>
            </font><br />
            </center>
         </body>
      </html>);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:04:13+00:00Added an answer on May 20, 2026 at 5:04 am

    You need to quote Customer ID or change the column name so that it doesn’t contain spaces.

    You also have to make sure you have a comma (,) after every column. It’s missing after the DOB column name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i saw this In MySQL, joins work for INSERT, UPDATE, and DELETE statements. It's
a) SqlCommand.ExecuteNonQuery is used for update, insert and delete operations. Besides the fact that
In ADO.NET, ExecuteNonQuery() For UPDATE, INSERT, and DELETE statements, the return value is the
I have a lot of SQL insert/update/delete statements of which some are redundant. For
This 2007 White Paper compares the performance for individual select/insert/delete/update and range select statements
I have a dotnet applicaton that executes a set of insert,update,delete statements in transactionaly
I utilized the wizard to create Insert Edit Update and Delete statements. Problem is
I often insert/delete 20-30 very complicated UserControls into StackPanel . All UserControls already created
When I run this it doesn't throw an error however it doesn't insert/delete an
I want to have an 'updateinfo' table in order to record every update/insert/delete operations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.