Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can a parameterized RV pull from a parameterized SQL FN?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00889430
Message ID:
00889450
Vues:
13
Hi Sergey,

I get an error just when trying to create the parameterized version of the view - "No result set has been returned by the server." is the exact message. With the table name hard coded it works fine. My create view statement is identical to yours except the view and Connection names.

I have VFP7 with SP1.

Thanks.

>Hi Jastin,
>
>It works in my test.
-- SQL Server
>CREATE   table T1 (id int , name char (20))
>EXEC   sp_addextendedproperty 'MS_Description', 'MS Employee ID', 'user', dbo, 'table', 'T1', 'column', id
>EXEC   sp_addextendedproperty 'MS_Description', 'MS Employee Name', 'user', dbo, 'table', 'T1', 'column', name
>* -- VFP
>CREATE VIEW test_fn_param  ;
>REMOTE CONNECT "SQLTestdb" ;
>as SELECT ObjType, ObjName, Value ;
>FROM ::fn_listextendedproperty('MS_Description', 'user', 'dbo', 'table', ?vp_Table, 'Column', NULL)
>vp_Table = "T1"
>USE test!test_fn_param             && Returns 2 records
>
>
>>Hello all,
>>
>>I know this can be done quite easily via SPT, but for modularity purposes we need to have this as a remote view.
>>
>>I can create and call the following view quite easily without any problem:
>>
>>
>>CREATE SQL VIEW "Rv_SQLDescriptionsForTable" ;
>>REMOTE CONNECT "SQLConn" ;
>>as SELECT ObjType, ObjName, Value ;
>>FROM ::fn_listextendedproperty('MS_Description', 'user', 'dbo', 'table', 'Order', 'Column', NULL)
>>
>>
>>This returns the SQL descriptions of all fields in the Order table. What I would like to do is pass the view a parameter for the table name, and pass that to the function. The following view fails with a no returned records error:
>>
>>
>>CREATE SQL VIEW "Rv_SQLDescriptionsForTable" ;
>>REMOTE CONNECT "SQLConn" ;
>>as SELECT ObjType, ObjName, Value ;
>>FROM ::fn_listextendedproperty('MS_Description', 'user', 'dbo', 'table', ?vp_Table, 'Column', NULL)
>>
>>
>>Is there any way to get this functionality with a remote view, or am I forced to use SPT here?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform