Welcome to Macrobject Community Login | Register | Faq  

    Macrobject Community
  Macrobject Software Knowledge Management and Collaboration Platform
Search    
   

Change DB Scheme at Runtime
Started by Flywheel at 02-19-2009 1:10 AM. Topic has 5 replies.

Print Search « Previous Thread Next Thread »
  02-19-2009, 1:10 AM
Flywheel is not online. Last active: 11/13/2009 10:45:56 PM Flywheel

Top 50 Posts
Joined on 02-19-2009
Posts 4
Change DB Scheme at Runtime
Reply Quote
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


   Report 
  02-19-2009, 6:11 AM
David is not online. Last active: 11/17/2011 8:07:51 AM David

Top 10 Posts
Joined on 01-26-2008
Posts 193
Re: Change DB Scheme at Runtime
Reply Quote
Which action do you want?
Please give us some more details.

PS: DObject supports multi-scheme access.
   Report 
  02-19-2009, 6:38 AM
Flywheel is not online. Last active: 11/13/2009 10:45:56 PM Flywheel

Top 50 Posts
Joined on 02-19-2009
Posts 4
Re: Change DB Scheme at Runtime
Reply Quote
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



   Report 
  02-20-2009, 4:45 AM
David is not online. Last active: 11/17/2011 8:07:51 AM David

Top 10 Posts
Joined on 01-26-2008
Posts 193
Re: Change DB Scheme at Runtime
Reply Quote
As this situation, you could regenerate the code with CodeAuto.
All code you written not need modify.
   Report 
  02-20-2009, 5:16 AM
Flywheel is not online. Last active: 11/13/2009 10:45:56 PM Flywheel

Top 50 Posts
Joined on 02-19-2009
Posts 4
Re: Change DB Scheme at Runtime
Reply Quote
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
   Report 
  02-22-2009, 8:34 AM
David is not online. Last active: 11/17/2011 8:07:51 AM David

Top 10 Posts
Joined on 01-26-2008
Posts 193
Re: Change DB Scheme at Runtime
Reply Quote
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.

   Report 
Post
Macrobject Comm... » Developing Tool... » DObject O/R Map... » Change DB Scheme at Runtime

Powered by Community Server, by Telligent Systems