CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Variable tablenames

Print topic Send  topic

Author Message
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
View profile  Send private message
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/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.