BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Obtaining server side defaults

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Nov 14, 2003 5:12 pm    Post subject: Re: Obtaining server side defaults Reply with quote



Pete Gajria wrote:

Quote:
i have a table with a few cols that have default values
how would i go about obtaining those defaults so i can assign them
to the default expression on a clientdataset

It's generally speaking difficult to answer DB-specific questions when
you don't mention which DB you're using. Not all DB servers have
support for this.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
Everything You Need to Know About InterBase Character Sets:
http://delphi.weblogs.com/stories/storyReader$306

Back to top
Pete Gajria
Guest





PostPosted: Fri Nov 14, 2003 5:53 pm    Post subject: Obtaining server side defaults Reply with quote



hi,
i have a table with a few cols that have default values
how would i go about obtaining those defaults so i can assign them
to the default expression on a clientdataset

thanks
pete



Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Nov 14, 2003 6:15 pm    Post subject: Re: Obtaining server side defaults Reply with quote



Pete Gajria wrote:

Quote:
hi craig,
im targetting interbase/oracle for now
the idea is to get the defaults at runtime using a generic function.

In InterBase the defaults are stored in RDB$FIELDS.RDB$DEFAULT_VALUE.
This is binary BLR and about as readable as machine code. InterBase
also has a column called RDB$FIELDS.RDB$DEFAULT_SOURCE, where it stores
the source code used to generate the BLR. But you can change this (for
example, to obfuscate your DB metadata) without affecting the actual
default.

I don't know how Oracle handles this, but there is no generic way to
do this.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase Performance Monitor -- Analyze and control your IB7
server: http://delphi.weblogs.com/IBPerformanceMonitor

Back to top
Pete Gajria
Guest





PostPosted: Fri Nov 14, 2003 6:22 pm    Post subject: Re: Obtaining server side defaults Reply with quote

hi craig,
im targetting interbase/oracle for now
the idea is to get the defaults at runtime using a generic function.

pete


Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Nov 14, 2003 6:42 pm    Post subject: Re: Obtaining server side defaults Reply with quote

Dmitry Arefiev [gs-soft.ru] wrote:

Quote:
But defaults may contain expressions.

Same in InterBase.

-Craig

--
Craig Stuntz [TeamB] ž Vertex Systems Corp. ž Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
Please read and follow Borland's rules for the user of their
news server: http://info.borland.com/newsgroups/guide.html

Back to top
Dmitry Arefiev [gs-soft.r
Guest





PostPosted: Fri Nov 14, 2003 7:25 pm    Post subject: Re: Obtaining server side defaults Reply with quote

Hello !

I will say about Oracle. Take a look on
[USER]|[ALL]|[DBA]_TAB_COLUMNS view.
They have columns:
- DEFAULT_LENGTH - length of default value for column
- DATA_DEFAULT - actually default value

But defaults may contain expressions. And in
Oracle case - on Oracle expression language.
So, how you will evaluate that ? <g>

Regards,
Dmitry


--
Dmitry Arefiev, gs-soft Company, community.gs-soft.com
Personal - www.da-soft.com

SAPx - Delphi to SAP R/3 direct access
Saphir - SAP R/3 metadata on your fingertips
MetaBase - ERWIN model in Delphi applications
NCOCI8 - Freeware Delphi to ORACLE direct access

Pete Gajria wrote:
Quote:
hi craig,
im targetting interbase/oracle for now
the idea is to get the defaults at runtime using a generic function.

pete

Back to top
Pete Gajria
Guest





PostPosted: Fri Nov 14, 2003 7:42 pm    Post subject: Re: Obtaining server side defaults Reply with quote

thanks for the replies guys Smile
confirms what i thought

yeah i do know about the oracle dba_* & all* views being an oracle dba
i was simply hoping to get the data using setschemainfo
but as mentioned by another poster that seems to be slow on certain drivers

regards,
pete





Back to top
Dmitry Arefiev [gs-soft.r
Guest





PostPosted: Fri Nov 14, 2003 7:56 pm    Post subject: Re: Obtaining server side defaults Reply with quote

Hello !

Quote:
But defaults may contain expressions.
Same in InterBase.

Although my freeware lib (i dont have anymore time to
support it already year ...), has complete implementation
for Oracle expression language. Also many things from
ANSI and etc. So, if it is extremely required, then it
may by filled with IB functions. IMHO, operators are
at most (in Oracle '||' is string concatination) the same.

Regards,
Dmitry

--
Dmitry Arefiev, gs-soft Company, community.gs-soft.com
Personal - www.da-soft.com

SAPx - Delphi to SAP R/3 direct access
Saphir - SAP R/3 metadata on your fingertips
MetaBase - ERWIN model in Delphi applications
NCOCI8 - Freeware Delphi to ORACLE direct access


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.