Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLExec() SQL Select from 2 DB
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01654292
Message ID:
01654316
Vues:
46
>>>>>Thank you. I may break the query just to be sure that the user has access to the second database. Also, I don't like to use the DB name in the query (it would be hard-coding it). I prefer to use a handle.
>>>>
>>>>Nope, you can not use handles.
>>>>You must use DataBaseName :-)
>>>
>>>I wonder if I can use a pseudo name for the DB so that I don't have to hard-code it in my query.
>>
>>Nope, you can't.
>>But you can create Synonyms in you database to create instance of table from other database and then use that synonym like table.
>
>Could you, please, give me an example on how to create a synonym?
CREATE SYNONYM schemaname.SynonymName FOR DataBaseName.Schema.TableName
Than you can use it:
SELECT * FROM YourTable
INNER JOIN schemaname.SynonymName ON ...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform