GASTAN
Posts: 3
|
Posted: 02/18/2004, 4:30 PM |
|
I need to integrate CCS application with existing one.
Existing one uses include.inc where tablenames are specified.
(Example:
$tdsPrefix = "livedemo_";
$tSave = $tdsPrefix . "tSave";
$tUser = $tdsPrefix . "tUser";
)
I need to prefix table names, because I have multiple applications hosted by one database.
So I need somehow to make use of these variable table names.
Ofcourse, I can search and replace them with variable names, but then if I generate application from CCS again, it will screw my changes.
Any ideas ?
Thanx
GASTAN
|
|
|
DonB
|
Posted: 02/21/2004, 6:49 AM |
|
The table name is stored in the "SQL" property of your datasource. This is
available for modification in the Before Build Select event. This may be a
simple substitution (if you merely have the table as the datasource) or
complex (if you have a SQL statement with joins).
I think you might find it convenient to create the application with a set of
pre-defined prefixes (something unique, like "pfx_" for the sake of
example). Then you could do a simple replace for all occurences of "pfx_"
in ds->SQL (the datasource's SQL property) with the alternate prefix defined
at runtime. Execute this search and replace in every page's Before Build
Select event.
Another way to do this (and the way the SQL language designer's intended it
to work) is to use table aliases "SELECT * FROM myTable as TBL1". It might
be easier/safer to change the table alias.
The include file concept is still valid in CCS - just add it to the
appropriate .php file.
--
DonB
http://www.gotodon.com/ccbth
"GASTAN" <GASTAN@forum.codecharge> wrote in message
news:540340396cac61@news.codecharge.com...
> I need to integrate CCS application with existing one.
> Existing one uses include.inc where tablenames are specified.
> (Example:
> $tdsPrefix = "livedemo_";
>
> $tSave = $tdsPrefix . "tSave";
> $tUser = $tdsPrefix . "tUser";
> )
>
> I need to prefix table names, because I have multiple applications hosted
by one database.
>
> So I need somehow to make use of these variable table names.
> Ofcourse, I can search and replace them with variable names, but then if I
generate application from CCS again, it will screw my changes.
>
> Any ideas ?
>
> Thanx
>
> GASTAN
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
|