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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:45:25+00:00 2026-05-13T11:45:25+00:00

I have a ruby script which I run using the JRuby Interpreter. The script

  • 0

I have a ruby script which I run using the JRuby Interpreter.
The script connects to a Sybase database using DBI and Sybase JDBC (jTDS3.jar and jconn3.jar)

My problem is that I have a select query that alters the column names of table.
For example:

SELECT
t.TRANSACTION as 'business_transaction',
t.TRADE_CURRENCY as 'currency',
t.CURRENCY as 'settlement_currency'
...etc...

FROM 
TRADE t
...etc...

My problem is when using the examples directly from the documentation

sth = dbh.execute(stmt)

printf "Number of rows: %d\n", rows.size
printf "Number of columns: %d\n", sth.column_names.size
sth.column_info.each_with_index do |info, i|
   printf "--- Column %d (%s) ---\n", i, info["name"]
end

or simply

sth = dbh.execute(stmt)

rows = sth.fetch_all
col_names = sth.column_names
sth.finish
DBI::Utils::TableFormatter.ascii(col_names, rows)

Not ALL the names come out as I set them using the ‘as’ clause in the query. Some are the original field names and some are the names I have specified.

For example they will list like:

--- Column 0 (TRANSACTION) ---
--- Column 1 (TRADE_CURRENCY) ---
--- Column 2 (settlement_currency) ---

or

TRANSACTION
TRADE_CURRENCY
settlement_currency

When testing this in Squirrel SQL Client the columns are correctly named so is this a bug in DBI or the Sybase JDBC drivers? or am I doing something wrong?

Any help would be greatly appreciated

  • 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-13T11:45:25+00:00Added an answer on May 13, 2026 at 11:45 am

    I can confirm it is the Sybase drivers. Using the jTDS (v1.2.5) from
    http://jtds.sourceforge.net/ I can get all the column names correctly defined in my query and can confirm that the original issue is NOT DBI

    If anyone who is following this wondered how I got jtds working with DBI under jRuby please take a look at one of my former questions – it did take some time – and DBI is a little funny when specifying the URL use

    dbi:Jdbc:jtds:sybase://<host>:<port>/<db>
    

    Please note the capital J for Jdbc

    I hope this saves someone a lot of time 😉

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could put an empty div <div id="navigation"></div> And then… May 16, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer The value 12 is not statically bound to a. Rather,… May 16, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer You need to add a second class: A TypeConverter. This… May 16, 2026 at 6:00 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Ruby 1.9 script that I want to run as a long-running
In ruby, is it possible to specify to call another ruby script using the
I have to execute a shell command from Ruby script but I have to
I've just learned the basics of Ruby after being very happy with Python for
I have a cron job on an Ubuntu Hardy VPS that only half works
Have an app that has listings - think classified ads - and each listing
I have a master-workers architecture where the number of workers is growing on a
I have certain initializing functions that I use to set up audit logging on
I've set up a simple, single-service server which has been working just fine with
I have an app that works perfectly on my local machine and am deploying

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.