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 6646299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:23:58+00:00 2026-05-26T00:23:58+00:00

I am having an issue with the OR statement in my SQL SELECT in

  • 0

I am having an issue with the OR statement in my SQL SELECT in perl.

    ######################### Open File and Split The Data Into An Array ####################################
$input_data_file = '/var/www/html/JG/TG/tower_gather.txt';
open (DAT, $input_data_file)
          or die ("Could not open file!");

@raw_data = <DAT>;

close(DAT);
#########################################################################################################

$dbh_source2 = DBI->connect("dbi:Oracle:host=<ip-address>;port=<port-number>;sid=<sid>",'username','password');
$SEL = "SELECT DISTINCT SITE_NAME, SITEID, PE_DOWNLINK_PORT FROM CBHME.SERVICE_TOPOLOGY_VIEW WHERE LOWER(PE_FQDN) = ? OR PE_OSPF_LOOPBACK_IP = ?";


$fqdn = $q->param('PE_FQDN');

$sth = $dbh_source2->prepare($SEL);
print '<table border=1>';
print '<tr>';
print '<th>SUR FQDN</th>';
print '<th>Tower Name</th>';
print '<th>Site ID</th>';
print '<th>SUR Link</th>';

print '</tr>';
foreach my $data_line (@raw_data) {
        chomp $data_line;

        $sth->execute($data_line);

        while (my @row = $sth->fetchrow_array ) {
              #Print data into cells#
              print "<tr>";
              print "<td>$data_line</td>";
              foreach (@row) {
                print "<td>$_</td>";
              }
              print "</tr>";
              #print "<$data_line>\t @row\n";

        }

}

print "</table>";
END {     
            $dbh_source2->disconnect if defined($dbh_source2);
}  

~

The error:
[jgearh200@srv01-netops cgi-bin]$ ./tower_gather_script.cgi 
DBD::Oracle::st execute failed: called with 1 bind variables when 2 are needed [for Statement "SELECT DISTINCT SITE_NAME, SITEID, PE_DOWNLINK_PORT FROM CBHME.SERVICE_TOPOLOGY_VIEW WHERE LOWER(PE_FQDN) = ? OR PE_OSPF_LOOPBACK_IP = ?" with ParamValues: :p1=undef, :p2=undef] at ./tower_gather_script.cgi line 33.
DBD::Oracle::st fetchrow_array failed: ERROR no statement executing (perhaps you need to call execute first) [for Statement "SELECT DISTINCT SITE_NAME, SITEID, PE_DOWNLINK_PORT FROM CBHME.SERVICE_TOPOLOGY_VIEW WHERE LOWER(PE_FQDN) = ? OR PE_OSPF_LOOPBACK_IP = ?" with ParamValues: :p1=undef, :p2=undef] at ./tower_gather_script.cgi line 35.
<table border=1><tr><th>SUR FQDN</th><th>Tower Name</th><th>Site ID</th><th>SUR Link</th></tr></table>[jgearh200@srv01-netops cgi-bin]$ 

So what I want it to be able to do:

I have a text area in which a user enters an FQDN or IP address line by line of a device and it goes into the Oracle Database and grabs certain information.

The SELECT statement is trying to grab that information based on what the user inputs (IP or FQDN).

Thank you

  • 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-26T00:23:59+00:00Added an answer on May 26, 2026 at 12:23 am

    DBD::Oracle::st execute failed: called with 1 bind variables when 2 are needed...

    Well, there you go: you need to bind two variables to the select statement (ie the parts in $SEL where there are question marks) instead of just one.

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

Sidebar

Related Questions

I am having trouble with the following SQL statement. I have had this issue
I'm having a performance issue with a select statement I'm executing. Here it is:
I am having issues with SQL. This SQL statement: SELECT * from chat WHERE
I'm having a bit of issue converting the following t-sql statement to Linq (using
I'm having an issue with an if statement I have an object called enemy2
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Having an issue resizing the #main_wrap on: http://www.coffeeproteindrink.com/method-athlete/ #main_wrap { min-height: 100%; background: url(images/content_back.png)
I am having issues executing a SQL statement from a stored proc having single
I'm having an issue trying to set variable in SQL in a stored procedure.
I'm having an issue with some SQL Server 2008 queries and I think I

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.