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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:48:25+00:00 2026-05-20T18:48:25+00:00

This is the data that I would like to sort. AAAAAAAA 0.0.0.0 hs01.stuff.net BBBBBBBB

  • 0

This is the data that I would like to sort.

AAAAAAAA    0.0.0.0   hs01.stuff.net
BBBBBBBB    0.0.0.0   hs01.morestuff.net
CCCCCCCC    0.0.0.0   hs01.evenmorestuff.net
DDDDDDDD    0.0.0.0   hs01.stuff.net
EEEEEEEE    0.0.0.0   hs01.stuff.net
FFFFFFFF    0.0.0.0   hs01.evenmorestuff.net
GGGGGGGG    0.0.0.0   hs01.stuff.net
HHHHHHHH    0.0.0.0   hs01.evenmorestuff.net

This is the result of the ORDER BY:

AAAAAAAA    0.0.0.0   hs01.stuff.net
BBBBBBBB    0.0.0.0   hs01.morestuff.net
CCCCCCCC    0.0.0.0   hs01.evenmorestuff.net
DDDDDDDD    0.0.0.0   hs01.stuff.net
EEEEEEEE    0.0.0.0   hs01.stuff.net
FFFFFFFF    0.0.0.0   hs01.evenmorestuff.net
GGGGGGGG    0.0.0.0   hs01.stuff.net
HHHHHHHH    0.0.0.0   hs01.evenmorestuff.net

THE SAME OUTPUT, so something went wrong.

This is what I have tried thus far

$dbh_source2 = DBI->
connect("dbi:Oracle:host=????;port=????;sid=????",'????','????');

$SEL = "SELECT DISTINCT 
               PE_LOOPBACK_IP,
               PE_FQDN 
          FROM TABLE_NAME
         WHERE SITE_NAME = ? 
      ORDER BY PE_FQDN";

$sth = $dbh_source2->prepare($SEL);

This does not work and does not sort the last column by the name. Does ORDER BY only sort based on the first character? Are the numbers that are within the name causing it to fail?

Here is the code that I use to display the data:

print '<table border=1>';
print '<tr>';
print '<th>Tower name</th>';
print '<th>SUR IP</th>';
print '<th>SUR FQDN</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>";
  • 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-20T18:48:26+00:00Added an answer on May 20, 2026 at 6:48 pm

    Looks like your SQL is doing exactly what you’re asking it to. You execute your statement eight times. Each time the result set contains only one row, so the the sort does nothing.

    You have two options. You can either change your SQL so that you do one select which returns all of the rows that you want sorted how you want it. Or you keep your existing SQL but store the data returned from each execution in an array and sort that array before displaying the results.

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

Sidebar

Related Questions

(please excuse that I didn't use aliases). I would like my query output to
This is beyond both making sense and my control. That being said here is
I want to use a temp directory that will be unique to this build.
I have found this example on StackOverflow: var people = new List<Person> { new
I have a new web app that is packaged as a WAR as part
I am attempting to pull some information from my tnsnames file using regex. I
I'm trying to build a C++ extension for python using swig. I've followed the
Let say I have the following desire, to simplify the IConvertible's to allow me
I have a login.jsp page which contains a login form. Once logged in the
I need to develop a file indexing application in python and wanted to know

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.