How to test my Firebird SQL queries - sql

I'm in the process of learning SQL, and I need a way of verifying that my SQL queries are valid (i.e. no syntax errors). I also would like to check what results they yield on a test database of my choosing and structure.
I'm using embedded firebird in my C# .NET application, so I don't really have any tools to work with. Anyone have any tips? Perhaps there are SQL administrators/query IDEs out there that work with Firebird?

You can use IBExpert personal or DatabaseWorkbench Lite
check also this and this

Related

Redgate SQL Prompt equivalent for PostgreSQL database

I'm starting at a new company after coming from a previous role where I could rely on Redgate's SQL Prompt with a MySQL environment. I'm now working with a Postgresql environment (SQL Workbench/J) and was wondering if anyone had come across any similar programs for Postgresql to make the query writing a bit less tedious and time intensive.
I'm aware of the CNTRL + Space option for suggesting columns/tables, hoping for something that automatically prompts.
Thanks!
You can use the dbForge Studio for PostgreSQL software to meet your needs, and this will help you to use this software in accordance with what is in the SQL Prompt program.
I hope the explanation I gave was useful to you.
A full-featured GUI tool for PostgreSQL is pgAdmin.
Among many other useful features, it has a query tool with code completion and suggestion.

Using Oracle SQL syntax for custom developed database server

Is it possible to implement own database server taking Oracle PL/SQL syntax as the bases or i would like to ask why different database solutions have different syntax eg: SQL server, MySql, Sqlite etc. can't they have some specific standard of syntax for basic operations including PL/SQL(excluding SQLite) why everyone is having a different syntax, sorry for diversion of question into patent issues but i could not find a better place to ask this question.
Of course you can, but you have to parse the PL/SQL yourself into something other platforms understand. (You can use ANTLR for example as parser tool. There is even a full featured grammar for PL/SQL) This is possible for small solutions with a small instruction set, but for large, full support of PL/SQL you need to be Oracle-sized.
To answer the why: two reasons:
There is no standard, so everyone picks his own;
You don't want customers to leave, so your own 'best' framework that is incompatible with others, that is your USP, and it prevents users from just porting their code to the other platform. They are stuck on yours.

converting stored procedures from sql server to oracle

We have a massive amount of stored procedures to convert from sql-server 2000 to oracle 10g. Does anyone know of any tool that would achieve this?
We used Oracle SQL developer for this but it seems like it is creating extra cursors for each IF/ELSE condition that was on sql server side.
Has anyone successfully used a tool that would do this?
Sorry, no answer, and you have my sympathies. I've been through this before and it was all manual. We ended up making distinct migration & test plan tasks for it.
Oracle will use cursors in places that look odd for people used to SQL server. I am not aware of any (simple) way around this.
There seem to be a number of companies out there now offering services or tools to help: This Google search shows a bunch.
Don't forget to plan for functional equivalence testing. Datatype differences may cause issues, and your application development tool(s) may interact differently with Oracle than they do with SQL server. I did this conversion a number of years ago for a PowerBuilder application, and a lot more of that needed updating than we expected.

Powerful tools for creating SQL queries

I'm looking for a tool, which would help creating complex SQL queries. Sometimes it's difficult to even verify, whether the results of a query are correct. It's especially easy to get queries joining several tables to return too little or too much data.
The tool should enable at least creation of test tables, some kind of visualization how the queries gather their data and hopefully give better parsing of error cases than for example Oracle does.
Are there tools like this or do I have to stick with creating test tables manually, filling them with test data and commiting all kinds of queries with SQuirrel SQL?
When you have a very complex query it is usually easiest to validate by breaking it up into multiple queries that populate temp tables. These intermediary results can be individually verified and then you bring them together to produce the final result set. Depending on performance needs you can stick with the temp table approach or you can then rewrite to a single statement. Typically when I have a huge query it is for background processing so I stick with the temp table approach.
What RDBMS are you using? All of the major ones have some type of console available (e.g.-SSMS in SQL Server, Toad in Oracle, MySQL Query Browser/Administrator for MySQL, etc.), and they all have Query Execution Plans where you can see how the query will actually run. So, the answer to your question is that it's entirely dependent on what RDBMS you're using, but the safe bet answer is: Yes.
I recommend trying SQL Server 2008 Management Studio Express (SSMSE) if you are working with SQL Server. I have used it at work and I believe it does everything you are looking for.
You can get it and SQL Server (express editions) here.
Certainly not a free, open-source solution, but I believe Quest Software's TOAD will fit your requirements. Quest seems to offer alot of tools in that space...they have tools for modeling and analysis, however I've never used the modeler or analyzer.
I personally have experience with the commercial version of TOAD for Oracle. It's GUI is overwhelming at first, but after you mentally filter out all of the extra buttons that you'll never use, it's manageable.

What do you use to write and edit stored procedures in Oracle?

There are many options for editing and writing Stored Procedures in Oracle; what is the best tool for you and why? (one tool per answer.)
Tool for Oracle Application Developers (TOAD), from Quest Software (formerly TOADSoft) has an excellent Stored Procedure editor with syntax highlighting, some autocomplete support (e.g. type in 'TABLE.' and the columns will appear), a nice Execute Procedure option that will show the results in a Grid or show DBMS output, and will also focus on syntax errors when you hit compile.
Note: The Freeware edition only allows 2 concurrent connections to the same Database Instance (even though the website says 5) - that means only 2 developers or DBA's can use it at the same time on the same Database. It also expires every 3 months but they're good at releasing updates.
I recently found the free Oracle SQL Developer.
nice looking GUI (makes you not poke out your eyes like the usual Oracle tools)
has many nice features, like showing tables filtered
lets you connect to multiple oracle instances at once
you can use sane configuration like ip:port username/password and do not have to use those strange TNSNAMES.ORA file based settings
you can set breakpoints and step through the code of stored procedures.
PL/SQL Developer from Allaround Automations.
I happily paid the $200 or so price for this.
Excellent IDE (+ good Intellisense, + debugging capability) with easy creation and editing of PL/SQL packages, SPs, Triggers etc
So much better than Toad.
Toad, from ToadSoft.com -> http://www.toadsoft.com/toad_oracle.htm
For someone like me who likes to work with a DBA tool like Microsoft's SQL Management Studio, it's a life saver.
As a professional PL/SQL developer I use (heh) PL/SQL Developer from Allaround Automations.
I've worked with TOAD for quite a long time but now it is quite overpriced comparing with PL/SQL dev. It has some advantages like knowledge base or ability to work with other RDBMS like SQL server but that's not a necessity for me.
But Notepad++ will always help to make occasional fix.
I always use PL/SQL Developer from Allround Automations.
http://www.allroundautomations.com/plsqldev.html
But some at our place swear by Toad
Use Oracle's own SQL Developer. If you are mainly working with Oracle, it does everything you'll need.
I use TOAD with our Oracle reports development, and I think that it's a good development tool. I normally toggle back and forth between a number of different Oracle instances and schemae, and I like the way that TOAD can display multiple windows for each instance/schema, or even more than one per schema.
TOAD takes a little while to learn and customize, but it's a worthwhile investment. The layout is similar to the Visual Studio .NET IDE with sidebars that can be anchored or rolled away. Tabs display different aspects of the Oracle schema, including procedures, jobs, stats, etc. And when I'm writing SQL, the editor uses color-coding and the error messages are Oracle-specific.
Toolset for Oracle (TOra) is a free, Open Source Database Tool very similar in scope (and look and feel) to Quest's TOAD
Compared to the freeware edition of TOAD, TOra allows multiple connections to different database instances at the same time, and has no concurrent connection limit (so any number of TOra users can be working on the same database instance)
I just used a standard editor (vim which then gave me syntax highlighting).
/Allan
I like SQL Developer from Oracle. Oh and its free! :)
I like Rapid SQL, you can debug SQL too
Notepad++ stays my favourite editor. I had to use SQL Developer in the past, it's not so "bad", but I encountered many problems with it. It proved very unstable so I wouldn't recommend it, or maybe only to test your procedures.
I use JetBrains IDEA (a Java IDE) to edit and SQL*Plus to execute. The advantages of using a tool with local version control, seemless integration into Source Version Control, advanced find and highlighting, great editing, 'live templates' and so on for me outweighs any advantage of having it 'database aware' (which with plug-ins you can get anyway). If I was coding up a complicated query I might fire up SQL Developer, but generally I prefer great text editing features.
I use Oracle SQL Developer - the latest version also has support for CVS and Subversion.
It has the bonus of supporting other database providers, too.
I have used this tool for 2 years and it has now settled down to be reliable.
I've used RapidSQL by Embarcadero on several different DB platforms, and it's awesome. It has an integrated step debugger, too. I haven't actually used it with Oracle, but I know it's supported.
Another vote for Oracle SQL Developer. It's free, it's stable and it does all the basics that I require.
With the mentioned SQL Developer you can even set breakpoints and step through the code of the stored procedure.
Yet another vote for Oracle SQl Developer. But TOAD works too.
A really good text editor with syntax highlighting (e.g. Textpad from www.textpad.com) and SQL Plus.
For me its, Oracle SQL Developer. The learning curve is very minimal if you have worked on IDEs like Eclipse or VS. You can set break points, read live values when you debug stored procs as you would do to code in eclipse/VS.
Ofcourse the UI is a bit sluggish at times but given that its free compensates the sluggishness.
I use Textpad, Clipmate and Quest SQLNavigator. The newer versions of Quest's SQLNavigator and TOAD are crap -- they tend to crash easily and don't play nice with XP/Vista/Win7.
I've spent hours with their tech support and they don't have alternatives.
You get no access to Quest programmers, but rather you get bogged down in their
trouble ticket process.
Quest needs to focus less on integration of different tools into one and selling you
promises that the next version will solve the instability issues.
They need stability.
This means cleaning up their existing codebase or starting over.
More competent programmers, fewer salespeople, fewer tech support people.
Fix the damn problems.
They focus on sales and it's an idiotic business strategy.
This seems to be a problem across the industry.
Quest's TOAD and SQL Navigator have become bloatware and will soon become abandonware
if they don't turn them around and make them more stable.
I copy and paste frequently between Textpad and Quest SQLNavigator because SQLNavigator
crashes and I lose all my sql code up to the point of crash.
I'll probably dump SQLNavigator once I find something more stable.
SQL Developer from Oracle
We have replaced all other tools at our (large well known) enterprise that has over 150 databases and it works just fine. It's not as good as TOAD but it is getting there, and (unlike TOAD) it's free.
SQL Developer also works well enough connecting to SQL Server