|
Home > Archive > SQL Anywhere Mobile > February 2006 > How manage script ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How manage script ?
|
|
| Fantom 2006-02-28, 8:34 pm |
| Hi
How i may unload all script and load it to another database ?
I must write this always from begin ?
Fantom
| |
| Reg Domaratzki \(iAnywhere Solutions\) 2006-02-28, 8:34 pm |
| If you are using an ASA consolidated database, the following SQL will create
a SQL file that can be used to create the synchronization scripts in another
ASA database :
unload
select 'call dbo. ml_add_lang_table_sc
ript( ''' ||
REPLACE(dbo.ml_script_version.name, '''', '''''') || ''', ''' ||
REPLACE(dbo.ml_table.name, '''', '''''') || ''', ''' ||
dbo.ml_table_script.event || ''', ''' ||
dbo.ml_script.script_language || ''', ''' ||
REPLACE(dbo.ml_script.script, '''', '''''') || ''');'
from dbo.ml_table_script,
dbo.ml_script_version,
dbo.ml_script,
dbo.ml_table
where dbo.ml_table_script.version_id =
dbo.ml_script_version.version_id
and dbo.ml_table_script.script_id = dbo.ml_script.script_id
and dbo.ml_table_script.table_id = dbo.ml_table.table_id
union all
select 'call dbo. ml_add_lang_connecti
on_script( ''' ||
REPLACE(dbo.ml_script_version.name, '''', '''''') || ''', ''' ||
dbo. ml_connection_script
.event || ''', ''' ||
dbo.ml_script.script_language || ''', ''' ||
REPLACE(dbo.ml_script.script, '''', '''''') || ''');'
from dbo. ml_connection_script
,
dbo.ml_script_version,
dbo.ml_script
where dbo. ml_connection_script
.version_id =
dbo.ml_script_version.version_id
and dbo. ml_connection_script
.script_id = dbo.ml_script.script_id
to 'c:\\temp\\mlscript.sql'
format ascii quotes off escapes off;
The following SQL works against an MSS consolidated database, and may work
for ASE as well (not tested) :select 'exec ml_add_lang_table_sc
ript( ''' +
REPLACE(CAST(dbo.ml_script_version.name AS VARCHAR(4000)), '''',
'''''') + ''', ''' +
REPLACE(CAST(dbo.ml_table.name AS VARCHAR(4000)), '''', '''''') +
''', ''' +
dbo.ml_table_script.event + ''', ''' +
dbo.ml_script.script_language + ''', ''' +
REPLACE(CAST(dbo.ml_script.script AS VARCHAR(4000)), '''', '''''') +
''');'
from dbo.ml_table_script,
dbo.ml_script_version,
dbo.ml_script,
dbo.ml_table
where dbo.ml_table_script.version_id =
dbo.ml_script_version.version_id
and dbo.ml_table_script.script_id = dbo.ml_script.script_id
and dbo.ml_table_script.table_id = dbo.ml_table.table_id
union all
select 'exec ml_add_lang_connecti
on_script( ''' +
dbo.ml_script_version.name + ''', ''' +
dbo. ml_connection_script
.event + ''', ''' +
dbo.ml_script.script_language + ''', ''' +
REPLACE(CAST(dbo.ml_script.script AS VARCHAR(4000)), '''', '''''') +
''');'
from dbo. ml_connection_script
,
dbo.ml_script_version,
dbo.ml_script
where dbo. ml_connection_script
.version_id =
dbo.ml_script_version.version_id
and dbo. ml_connection_script
.script_id = dbo.ml_script.script_id
--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup
iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"
"Fantom" <szczukot@skasujto.poczta.onet.pl> wrote in message
news:44044190@forums
-2-dub...
> Hi
> How i may unload all script and load it to another database ?
> I must write this always from begin ?
>
> Fantom
| |
|
| Hi Reg,
Do you have sql statement for ASE consolidate ??? and Is
there a way to update current script in current database
Thanks,
Tom
> If you are using an ASA consolidated database, the
> following SQL will create a SQL file that can be used to
> create the synchronization scripts in another ASA database
> :
>
> unload
> select 'call dbo. ml_add_lang_table_sc
ript( ''' ||
> REPLACE(dbo.ml_script_version.name, '''', '''''')
> || ''', ''' ||
> REPLACE(dbo.ml_table.name, '''', '''''') || ''',
> ''' ||
> dbo.ml_table_script.event || ''', ''' ||
> dbo.ml_script.script_language || ''', ''' ||
> REPLACE(dbo.ml_script.script, '''', '''''') || ''')
> ;' from dbo.ml_table_script,
> dbo.ml_script_version,
> dbo.ml_script,
> dbo.ml_table
> where dbo.ml_table_script.version_id =
> dbo.ml_script_version.version_id
> and dbo.ml_table_script.script_id =
> dbo.ml_script.script_id and dbo.ml_table_script.table_id =
> dbo.ml_table.table_id union all
> select 'call dbo. ml_add_lang_connecti
on_script( ''' ||
> REPLACE(dbo.ml_script_version.name, '''', '''''')
> || ''', ''' ||
> dbo. ml_connection_script
.event || ''', ''' ||
> dbo.ml_script.script_language || ''', ''' ||
> REPLACE(dbo.ml_script.script, '''', '''''') || ''')
> ;' from dbo. ml_connection_script
,
> dbo.ml_script_version,
> dbo.ml_script
> where dbo. ml_connection_script
.version_id =
> dbo.ml_script_version.version_id
> and dbo. ml_connection_script
.script_id =
> dbo.ml_script.script_id to 'c:\\temp\\mlscript.sql'
> format ascii quotes off escapes off;
> The following SQL works against an MSS consolidated
> database, and may work for ASE as well (not tested)
> :select 'exec ml_add_lang_table_sc
ript( ''' +
> REPLACE(CAST(dbo.ml_script_version.name AS
> VARCHAR(4000)), '''', '''''') + ''', ''' +
> REPLACE(CAST(dbo.ml_table.name AS VARCHAR(4000)),
> '''', '''''') + ''', ''' +
> dbo.ml_table_script.event + ''', ''' +
> dbo.ml_script.script_language + ''', ''' +
> REPLACE(CAST(dbo.ml_script.script AS
> VARCHAR(4000)), '''', '''''') + ''');'
> from dbo.ml_table_script,
> dbo.ml_script_version,
> dbo.ml_script,
> dbo.ml_table
> where dbo.ml_table_script.version_id =
> dbo.ml_script_version.version_id
> and dbo.ml_table_script.script_id =
> dbo.ml_script.script_id
> and dbo.ml_table_script.table_id = dbo.ml_table.table_id
> union all
> select 'exec ml_add_lang_connecti
on_script( ''' +
> dbo.ml_script_version.name + ''', ''' +
> dbo. ml_connection_script
.event + ''', ''' +
> dbo.ml_script.script_language + ''', ''' +
> REPLACE(CAST(dbo.ml_script.script AS
> VARCHAR(4000)), '''', '''''') + ''');'
> from dbo. ml_connection_script
,
> dbo.ml_script_version,
> dbo.ml_script
> where dbo. ml_connection_script
.version_id =
> dbo.ml_script_version.version_id
> and dbo. ml_connection_script
.script_id =
> dbo.ml_script.script_id
>
> --
> Reg Domaratzki, Sybase iAnywhere Solutions
> Sybase Certified Professional - Sybase ASA Developer
> Version 8 Please reply only to the newsgroup
>
> iAnywhere Developer Community :
> http://www.ianywhere.com/developer iAnywhere Documentation
> : http://www.ianywhere.com/developer/product_manuals ASA
> Patches and EBFs : http://downloads.sybase.com/swd/base.do
> -> Choose SQL Anywhere Studio
> -> Set filter to "Display ALL platforms IN ALL MONTHS"
>
>
> "Fantom" <szczukot@skasujto.poczta.onet.pl> wrote in
> message news:44044190@forums
-2-dub...
>
>
| |
| Reg Domaratzki \(iAnywhere Solutions\) 2006-02-28, 8:34 pm |
| > Do you have sql statement for ASE consolidate ???
I tested the 2nd script (the formatting got a little mangled by the news
reader, but there's TWO sql statements in my post) against an MSS
consolidated, and it might work for ASE, although I've never tested it. It
will at most require minor alterations if something doesn't work.
> Is there a way to update current script in current database
You can edit existing scripts using the MobiLink plug-in in Sybase Central,
or you can execute the ml_add_table_script or ml_add_connection_sc
ript a
second time to modify the script that already exists. If you pass the empty
string to the procedure, the script will be deleted.
--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup
iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"
<Tom> wrote in message news:44047fd9.50e5.1681692777@sybase.com...[color=darkred]
> Hi Reg,
>
> Do you have sql statement for ASE consolidate ??? and Is
> there a way to update current script in current database
>
> Thanks,
> Tom
>
|
|
|
|
|