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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:59:14+00:00 2026-05-30T01:59:14+00:00

I have redesigned my Firebird based SQL database. As part of this process I

  • 0

I have redesigned my Firebird based SQL database. As part of this process I created new table named HARMONICS. Using GUI based administration tool I created following columns:

HARM_LP_ID Integer NOT NULL
HNUMBER Integer NOT NULL
HAMPCHNL0 Double precision
HAMPCHNL1 Double precision
HAMPCHNL2 Double precision
HAMPCHNL3 Double precision
HAMPCHNL4 Double precision
HAMPCHNL5 Double precision
HPHCHNL0 Double precision
HPHCHNL1 Double precision
HPHCHNL2 Double precision
HPHCHNL3 Double precision
HPHCHNL4 Double precision
HPHCHNL5 Double precision

After that I inserted into new entities some test data. The changes included also other tables, but these are not related to my problem so I will not list them here. Then I customized my application in order to work with new structure of relational database.

When application was fully tested I enhanced utility named Upgrader. The task of Upgrader is to convert between various versions of SQL databases. To accomplish this task I wrote SQL script. Following erroneous guides on official Firebird site (http://firebirdsql.org/manual/migration-mssql-data-types.html) I wrote following command for creating above mentioned table:

CREATE TABLE HARMONICS
(
  HARM_LP_ID Integer NOT NULL,
  HNUMBER Integer NOT NULL,
  HAMPCHNL0 Float,
  HAMPCHNL1 Float,
  HAMPCHNL2 Float,
  HAMPCHNL3 Float,
  HAMPCHNL4 Float,
  HAMPCHNL5 Float,
  HPHCHNL0 Float,
  HPHCHNL1 Float,
  HPHCHNL2 Float,
  HPHCHNL3 Float,
  HPHCHNL4 Float,
  HPHCHNL5 Float,
  CONSTRAINT PKHARMONICS1 PRIMARY KEY (HARM_LP_ID,HNUMBER)
);

I thought that Firebird data type “Float” is double precision float (the same as data type “double” in C). I eventually found that I was wrong but this was after I created official release of Upgrader utility. So now I have two versions of databases in circulation – one with single precision floating point numbers and second with double precision floating point numbers.

I am searching for SQL script that would check actual data type of columns in table HARMONICS. If this is double precision then script would do nothing. If this is single precision, script would convert columns with data type “Float” to “Double precision” with conserving all existing data. The point is script would not return error in either case. Is this possible? If yes then how?

  • 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-30T01:59:14+00:00Added an answer on May 30, 2026 at 1:59 am

    You can check an actual type of a column using next query

    SET TERM ^ ;
    EXECUTE BLOCK AS BEGIN
      if (exists(select
        rf.rdb$field_name,
        f.rdb$field_type
        from
          rdb$fields f join rdb$relation_fields rf
          on rf.rdb$field_source = f.rdb$field_name
        where
          rf.rdb$relation_name = 'YOUR_TABLE_NAME'
          AND rf.rdb$field_name = 'YOUR_FIELD_NAME'
          AND f.RDB$FIELD_TYPE = 10)) then
      execute statement 'ALTER TABLE YOUR_TABLE_NAME ALTER YOUR_FIELD_NAME TYPE DOUBLE    PRECISION';
    END^
    SET TERM ; ^
    

    rdb$field_type for FLOAT is 10, for DOUBLE PRECISION is 27.

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

Sidebar

Related Questions

I have a site with URLs like this: http://domain.co.uk/subdir/page.php I have redesigned the site
I have several modules (mainly C) that need to be redesigned (using C++). Currently,
I recently redesigned my site, complete with a new database, but I wanted to
We have redesigned the structure to a website which has several business units. Now
I have the following XML Document (that can be redesigned if necessary) that stores
We just switched to our new website redesign. We have a copy of the
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have this odd problem with a third party script. On our site a

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.