Re: Change DB Scheme at Runtime
DObject O/R Mapping Suite
Change DB Scheme at Runtime
Flywheel
02-19-2009, 1:10 AM
Hi.
I am using DObject to access an oracle DB.
I have 2 Databases with identical tables.
Is it possible to change the scheme at runtime
i.e. scheme1.tableXY
scheme2.tableXY
thanx
Re: Change DB Scheme at Runtime
David
02-19-2009, 6:11 AM
Which action do you want?
Please give us some more details.
PS: DObject supports multi-scheme access.
Re: Change DB Scheme at Runtime
Flywheel
02-19-2009, 6:38 AM
Hi David,
For my Oracle DB i have a different User with limited rights, so i have to
supply a qualifier (Scheme) with the tablename or to access the same table
in another scheme.
i.e.
select * from test.table1
and
select * from prod.table1
If i generate the code with AutoCode, i have to give a scheme i.e. test
this works fine as long as my DB scheme is test
Where do i have to change the scheme name at runtime which is given via a config file
to access prod.table1
thank you
regards
Re: Change DB Scheme at Runtime
David
02-20-2009, 4:45 AM
As this situation, you could regenerate the code with CodeAuto.
All code you written not need modify.
Re: Change DB Scheme at Runtime
Flywheel
02-20-2009, 5:16 AM
Sorry David,
what i meant is :
at Runtime i read the scheme i.e. TEST or PROD from a config file
and replace this in my queries
scheme := 'xyz';
Query := ' select * from ' + scheme + '.table1';
to access different schemes without recompiling my app.
How can this be done using DObject ?
thanks
Re: Change DB Scheme at Runtime
David
02-22-2009, 8:34 AM
Sorry for the delayed response.
DObject can not support change scheme at the runtime by itself.
As you see, DObject use a connection string as it's entry, you could modify the connection string at runtime to fit your requirement.
Any questions please feel free to contact us, thanks.
David.