Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

IB5.1, ODBC and Parsing SQL string

IB5.1, ODBC and Parsing SQL string

IB5.1, ODBC and Parsing SQL string

I've inherited a global network of Interbase 5.1 based databases.  I'm writing an application in .Net (don't worry, this isn't a cross post ) and amongst other things I'd like to incorporate a SQL string parse function that operates in a similar way to that of MS Query Analyser.  I've used the SQL Server functions SET PARSEONLY and SET NOEXEC before with no problems, but I don't seem to be able to find an equivalent in Interbase.  I've looked at the documentation for IB 5.5 and there is mention of a PREPARE statement that may be useful.  I'm connecting to each database via ODBC using the Interbase Intersolv driver v  When I try a prepare statement, I get the following error:

Microsoft.Data.Odbc.OdbcException: ERROR [37000] [INTERSOLV][ODBC InterBase driver][InterBase]Dynamic SQL Error, SQL error code = -104, Token unknown - line 1, char 0, PREPARE
--- error message truncated

This is the same error (more or less) reported when I try running the same sql through the (awful) WISQL tool that comes with Interbase.

I'd appreciate any help received.  I should say that any 'upgrade or replace' Interbase solutions are no-go as the current setup will 'have-to-do' until I can replace it with a better solution (like anything!!! can you tell I've developed a dislike for Interbase??! )



RE: IB5.1, ODBC and Parsing SQL string

I don't think that PREPARE is what you are looking for. It appears to be a DSQL statement for use in embedded SQL, not something you can use directly as part of an SQL statement.

Take a look at Interbase 6 - it's open source so you could look at the parsing code itself (if all else fails).

RE: IB5.1, ODBC and Parsing SQL string

Thanks Pat, but like I said, upgrading isn't an option.  Nothing like being restricted to legacy systems eh?  Looks like I'm going to have to write my own parser...

RE: IB5.1, ODBC and Parsing SQL string

Like I said, you can download the source code for IB6 - you don't have to implement it in your production environment - but you look in the code to see how they do the parsing and then use this info to implement your own parser.

Personally, I like Interbase as a DBMS, but the supplied UIs are awful.

RE: IB5.1, ODBC and Parsing SQL string

What are you trying to accomplish? Why do you think "prepare" will solve your problem? (it doesn't because you get an error - but what IS your problem?)

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird

RE: IB5.1, ODBC and Parsing SQL string


I thought my post said it all with regard to my problem.  What I want to be able to do is check a sql script against the Interbase parser without executing it.  I'll be writing a number of scripts to be executed on a number of IB 5.5 instances and a parse facility would be useful.  Since upgrading each of the IB instances (there are hundreds!) isn't an option and replacement with my preferred DB platform (MSDE) is a long term solution, I think I'll have to make do for now.

Incidentally, I took a look at the Interbase site and I don't think I've seen a site where information was harder to find... Ok, maybe MSDN

RE: IB5.1, ODBC and Parsing SQL string

Well, "preparing" helps - but it's not a single statement. It's more of an API call. I bet the .NET classes have some kind of "Prepare" method that maps to this, or should map to this...

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close