Quote:
| Originally Posted by Sappy00 I keep trying to rap my head around this, but its just not sticking.
Now I know this is crap code, but I'm trying to quickly develope a site and the database is still in flux, so I don't want anything to break I don't want to declare the columns I want returned. in MS sql I'd simply
Create Procedure MyProc
As
Select * from Table where Date_Created = getdate()
Go
The where clause is meaning less in this example its the "*" that I'm trying to get to work in a procedure in firebird. is it possible? (actually I'm trying to get any procedure to work but I'm starting here). I see its possible as a simple querey but I really really want to stay away from using queries to get my data for obvious reasons...
I've read some documents but none really give me a good 411 on procedures.. Any help would be great.
Thanks
-Tom |
There is some good information on FireBird stored Procedures in the Resources sticky of this forum. But I haven't had the need to look at them much myself so I don't know how comprehensive they are.
So let me get this straight... in your example, you want to select everything from a table (using the '*' symbol), and you want to do it in a stored procedure and have it return the results? (I understand the security reasons for wanting to do this).
From what my experience with FireBird stored procedures has taught me thus far (but since I have been at FireBird for a short time, learning as I go) that when it comes to returning things via a stored procedure, you must have what you are returning specified in the output parameters.
Since you aren't specifying any columns in your query (since the database structure is still in flux), then that means you can't specify the output parameters in the stored procedure either. I know you can construct an SQL command, pass it to a stored procedure as text and execute it within there, but if you don't have any express output parameters, then I don't believe you can do what you want this way.
But then again, I am still relatively new to FireBird. Maybe someone here with more experience can set you straight.
Oh, and instead of "getdate()", you'll want to use "current_date".