|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Parameters in views
Is there a possibility to send parameters to views? if so, please give me instructions about syntax, because i can not find any docs...
![]() |
|
#2
|
||||
|
||||
|
Do you mean something like: select * from view where view_col = 'x'?
Other than this no parameters in views (and for good reason), use a stored procedure.
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
||||
|
||||
|
Quote:
Yes, exactly Quote:
But stored procedure can not return data rows, can it? Could you mention what is this good reason for lack of parameters in views? i'm curious... I thought that the more code i keep in database the easier it is to work with it. Then i do not have to change code in application (sometimes in couple of places), only in database...but maybe I am wrong. If so, please tell me. Anyway, thanks for responce |
|
#4
|
||||
|
||||
|
Quote:
Well, I was unclear, you can: 1. create a view with a where clause (CREATE VIEW ... AS SELECT ... FROM ... WHERE) and you'll also be able to place a where in the select run on the view 2. It is good not to have an order by in the view, because specifying another specific order by in the select run on the view would mean double ordering 3.A stored proc can return a set of rows |
|
#5
|
||||
|
||||
|
Quote:
well..how? Quote:
this is from http://www.destructor.de/firebird/storedproc.htm |
|
#6
|
|||
|
|||
|
okay, I know what You mean, cheers!
|
|
#7
|
|||||
|
|||||
|
An example is the ALL_LANGS procedure in the employee.fdb sample database
sql Code:
You call it as select * from all_langs |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Parameters in views |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|