I have 3 different database users in SQL Server. There are certain tables that are common to all 3. I would like to point all 3 to one master. I tried the following, but it didn't work:
MYApplication.ASN - snippet
[PATHS]
$TSK = MSS:SCHEMA:USER1||
[ENTITIES]
HED_LO_TEXT.HIS20 = $TSK:HED_LO_TEXT.HIS20
In our USYS.ADM we have (snippet):
$HDB=MSS:?|?|?
;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Server environment
;;;;;;;;;;;;;;;;;;;;;;;;;
$DEF=$HDB
Thanks for any direction!
J. DeTurk
Hi Joanne,
The syntax for an entity to path mapping is Entity.ApplicationModel {=} $Path:Table.*
https://u.uniface.info/docs/1000/uniface/configuration/asnSettings/Entity_to_path_assignments.htm
Hopefull you just need to change the entity mapping line to HED_LO_TEXT.HIS20 = $TSK:HED_LO_TEXT.*
The other thing is the name of the usys assignment file is usys.asn rather than usys.adm however I suspect this is just a typo.
Kind regards,
Mike
I have 3 different database users in SQL Server. There are certain tables that are common to all 3. I would like to point all 3 to one master. I tried the following, but it didn't work:
MYApplication.ASN - snippet
[PATHS]
$TSK = MSS:SCHEMA:USER1||
[ENTITIES]
HED_LO_TEXT.HIS20 = $TSK:HED_LO_TEXT.HIS20
In our USYS.ADM we have (snippet):
$HDB=MSS:?|?|?
;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Server environment
;;;;;;;;;;;;;;;;;;;;;;;;;
$DEF=$HDB
Thanks for any direction!
J. DeTurk
Thanks Mike! I'll try it and let you know. And yes, ADM was a typo (I was thinking of USYS.ASN in the ADM folder)
I have 3 different database users in SQL Server. There are certain tables that are common to all 3. I would like to point all 3 to one master. I tried the following, but it didn't work:
MYApplication.ASN - snippet
[PATHS]
$TSK = MSS:SCHEMA:USER1||
[ENTITIES]
HED_LO_TEXT.HIS20 = $TSK:HED_LO_TEXT.HIS20
In our USYS.ADM we have (snippet):
$HDB=MSS:?|?|?
;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Server environment
;;;;;;;;;;;;;;;;;;;;;;;;;
$DEF=$HDB
Thanks for any direction!
J. DeTurk
Hi Joanna
I'm not sure why are you using two ASN-files or better two different path definitions 🙂
You can define as much ASN-files as you like and include one into another by #FILE.
usys.asn will always loaded as the last one.
In your constellation it looks like:
The usys.asn you are using is just a generic/default one
it defines the pathes $HDB and $DEF
The myapplication.asn is a specific one
it defines a new path $TSK and trys to redirect a entity to another path
As Mike allready mention, the syntay for entity-to-path definition is not correct
But beside of this: what are you try to achieve?
First a few fundamentals
You do have a model in UnifAce wich defines tables/entities. To each of this tables you have to declare which path this tables will use by default.
You do have a SQL-DBMS (here MS-SQL) which holds one or more databases where in each are tables or views defined/filled. The name of such a tables (inside a database) is <schema>.<tablename> where schema can omitted. In such a situation, the DBMS looks out for the proper schema.
BTW: UnifAce can not handle schema-names, it use always the "proper" schema for the user which loged in
Now you have to connect this two sides (UnifAce vs DBMS) by ASN-Files
The easy way is to use the path "DEF" (or $DEF)
In model assign all tables to "DEF" and in ASN write a simple line like
$DEF=MSS:?|?|?
On runtime and first access to database, UnifAce will ask you to specify the DBMS-information.
If you know the proper infomation before staring UnifAce you can write
$DEF=MSS:<odbc_name>|<user_name>|<password>
<odby_name> is a configured ODBC on the client PC which holds the information about the DBMS and the database-name
Caution: here UnifAce is not correct. Documentation says, that a database name is sufficent, which could not be true as you don't know where the DBMS is hosted...
<password> can be left empty the you are using a trusted authority
Sometimes its necassary to have more then one database in parallel:
$PATH1=MSS:<odbc_name1>|<user_name>|<password>
$PATH1=MSS:<odbc_name2>|<user_name>|<password>
You can assign this two pathes in model, but this is then fix in the compiled components.
To do so, you have to use $UDn (user defined pathes) and assing $UDn to $PATHn
$UD1 = $PATH1
$UD2 = $PATH2
If you don't want to modify the model, you can ridirect entities to specific pathes MyEntity1.MyModelName=$PATH1:MyEntity1.*
MyEntity2.MyModelName=$PATH2:MyEntity2.*
If you want to "rename" entities:
MyEntity1.MyModelName=$PATH1:TheEntity.*
MyEntity2.MyModelName=$PATH2:TheEntity.*
in this example, you do have two tables in Uniface which on DBMS side are in different database but do have the same name
But this all are fixed solution either by component or by ASN-file
Please check, if you could transformer your "problem" into such a solution
If not, we are on standby to help you 🙂
Ingo
Hi Joanna
I'm not sure why are you using two ASN-files or better two different path definitions 🙂
You can define as much ASN-files as you like and include one into another by #FILE.
usys.asn will always loaded as the last one.
In your constellation it looks like:
The usys.asn you are using is just a generic/default one
it defines the pathes $HDB and $DEF
The myapplication.asn is a specific one
it defines a new path $TSK and trys to redirect a entity to another path
As Mike allready mention, the syntay for entity-to-path definition is not correct
But beside of this: what are you try to achieve?
First a few fundamentals
You do have a model in UnifAce wich defines tables/entities. To each of this tables you have to declare which path this tables will use by default.
You do have a SQL-DBMS (here MS-SQL) which holds one or more databases where in each are tables or views defined/filled. The name of such a tables (inside a database) is <schema>.<tablename> where schema can omitted. In such a situation, the DBMS looks out for the proper schema.
BTW: UnifAce can not handle schema-names, it use always the "proper" schema for the user which loged in
Now you have to connect this two sides (UnifAce vs DBMS) by ASN-Files
The easy way is to use the path "DEF" (or $DEF)
In model assign all tables to "DEF" and in ASN write a simple line like
$DEF=MSS:?|?|?
On runtime and first access to database, UnifAce will ask you to specify the DBMS-information.
If you know the proper infomation before staring UnifAce you can write
$DEF=MSS:<odbc_name>|<user_name>|<password>
<odby_name> is a configured ODBC on the client PC which holds the information about the DBMS and the database-name
Caution: here UnifAce is not correct. Documentation says, that a database name is sufficent, which could not be true as you don't know where the DBMS is hosted...
<password> can be left empty the you are using a trusted authority
Sometimes its necassary to have more then one database in parallel:
$PATH1=MSS:<odbc_name1>|<user_name>|<password>
$PATH1=MSS:<odbc_name2>|<user_name>|<password>
You can assign this two pathes in model, but this is then fix in the compiled components.
To do so, you have to use $UDn (user defined pathes) and assing $UDn to $PATHn
$UD1 = $PATH1
$UD2 = $PATH2
If you don't want to modify the model, you can ridirect entities to specific pathes MyEntity1.MyModelName=$PATH1:MyEntity1.*
MyEntity2.MyModelName=$PATH2:MyEntity2.*
If you want to "rename" entities:
MyEntity1.MyModelName=$PATH1:TheEntity.*
MyEntity2.MyModelName=$PATH2:TheEntity.*
in this example, you do have two tables in Uniface which on DBMS side are in different database but do have the same name
But this all are fixed solution either by component or by ASN-file
Please check, if you could transformer your "problem" into such a solution
If not, we are on standby to help you 🙂
Ingo
This is my DEVELOPMENT environment. I have 3 separate databases I use to test on. However, they all need to use some of the same tables and I wanted to point all of them to a "master" (for example the HELP table).
We have used $ud1, etc. in the past. But since this is just my environment, I can't change the database from "$DEF". I just wanted to work around having to copy data between different databases.
I fixed the syntax on my entity-to-path definition and it is working perfectly now!
Thanks Mike! I'll try it and let you know. And yes, ADM was a typo (I was thinking of USYS.ASN in the ADM folder)
I fixed the syntax on my entity-to-path definition and it is working perfectly now!