Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger at database level
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00114127
Message ID:
00115795
Views:
24
Hi Jayesh,

How do you pass parameters to Oracle Views. If the approach is the same, you could create stored procedures in SQL Server which have the same names as the views in Oracle.

>Hi Kamal,
>
> Thanks for reply. I have my application in PB running with ORACLE backend but one of my new client wants to go for SQL Server. System is smoothly running
>since last 18 months using such a type of parameterized views. So I do not want to redine all those datawindows(PB's) based on this kind of views and will also raise the problem of maintaining two different version one for ORACLE and one for SQL Server.
> But I think i do not have any alternative.
>
>Again thanks for it
>
>Bye
>Jayesh
>
>>Hi Jayesh,
>>
>>SQL Server does not supports parameters in views the way Oracle supports it. Though you could achieve the same using a stored procedure.
>>
>>Lets say we want to call a stored proc, ParaCityName, in Pubs that returns Authors by their cities;
>>
>>CREATE PROCEDURE ParaCityName @vp_CityName varchar(32)
>>AS
>>SELECT * from authors WHERE city like @vp_CityName
>>GO
>>The first line in the stored procedure has the as-yet undeclared @vp_CityName varchar(32). By phrasing the create statement this way you have built in the place holder for the incoming parameter.
>>
>>The rest you leave it on VFP.
>>
lnConn = SQLCONNECT('pubs','sa','')
>>=SQLEXEC(lnConn, 'ParaCityName "C%" ', 'MyCursor')
>>
>>
>>This will return all the city names that begin with letter "C".
>>
>>
>>>Hi Kamal,
>>>
>>> Jayesh here. I need to know one thing about SQL Server Views.
>>>I want to make a parameterized view in SQL Server 6.5 just like VFP's
>>>local/remote views. Oracle supports this.
>>>
>>>For example
>>>
>>>CREATE VIEW myview AS SELECT * FROM CUSTOMER
>>>WHERE cid = &vp_cid
>>>
>>>Bye
>>>Jayesh
>>>
>>>
>>>>Hi Michel,
>>>>
>>>>This is the information I got from one of our SQL Server experts:
>>>>
>>>>In a particular database you can run sp_tables which will produce a list of tables and the owner (which I assume is what is meant by who created them). To find the creation date you have to query the sysobjects table. It has a column crdate. So a select name,crdate from sysobjects where type = 'U' will list all user defined tables (as opposed to system tables) in a particular database. If you need anything further let me know. (JosephL@flashcreative.com)
>>>>
>>>>
>>>>>Is there a possibility to have a trigger at the database level on SQL Server 6.5? We would like to have a trigger to store a value whenever we add a new table to the database. Or, is there another mecanism to know that we have added a new table. Like to scan the systable.
Previous
Reply
Map
View

Click here to load this message in the networking platform