Subject | Re: [firebird-support] SELECT ... INTO in PSQL |
---|---|
Author | Martijn Tonies |
Post date | 2004-06-29T12:25:30Z |
Hi,
to use the colon.
In general, it's simple:
use colons for variables in SQL statements.
Don't use colons for variables in all other statements.
(like assignments, NULL testing etc)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> thanks for your answers and recommendations.Well, if you have variables named equal to columns, you _have_
> The way you all explained it made sense to me.
>
> In this case, my problem was related to IBExpert because
> as a result to a select which returns no row, IBExpert
> shows "<null>". So I thought that in my SP, the result would
> be NULL if no row was found.
> IBExpert is great, but sometimes it pollutes the "purity"
> of FB ;-)
> Anyway, I should have known that.
>
> A little question concerning your suggestions concerning colons
> before local variables: in some cases, the use of colons is not
> enforced, that means that you are able to use the local variable
> without a preceeding colon.
>
> Is it only bad practice to do this or does it also have
> other negative implications?
to use the colon.
In general, it's simple:
use colons for variables in SQL statements.
Don't use colons for variables in all other statements.
(like assignments, NULL testing etc)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com