This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: an ‘SQLRTComponentUninstall’: undefined identifier
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 10, 2009
08:06 AM
an ‘SQLRTComponentUninstall’: undefined identifier
We have a requirement during uninstall to ask the user if they would like to drop a database.
So when the feature TestPro is uninstalled we’d offer the user the option to drop the database. I’m trying to use SQLRTComponentUninstall
A feature called DataseDrop is in the install only to be called by SQLRTComponentUninstall, and has an sql script associated with it to drop a database to run during uninstallation.
I’m getting an ‘SQLRTComponentUninstall’: undefined identifier but I can’t work out what .rul or header files I need to include.
Our sample code is shown below.
export prototype TestPro_UnInstalled();
function TestPro_UnInstalled()
NUMBER nResult;
begin
if (AskYesNo("Preserve Database. Would you like to leave the database " +
"after uninstalling?", YES) = YES) then
nResult = SQLRTComponentUninstall( "DatabaseDrop" );
endif;
end;
So when the feature TestPro is uninstalled we’d offer the user the option to drop the database. I’m trying to use SQLRTComponentUninstall
A feature called DataseDrop is in the install only to be called by SQLRTComponentUninstall, and has an sql script associated with it to drop a database to run during uninstallation.
I’m getting an ‘SQLRTComponentUninstall’: undefined identifier but I can’t work out what .rul or header files I need to include.
Our sample code is shown below.
export prototype TestPro_UnInstalled();
function TestPro_UnInstalled()
NUMBER nResult;
begin
if (AskYesNo("Preserve Database. Would you like to leave the database " +
"after uninstalling?", YES) = YES) then
nResult = SQLRTComponentUninstall( "DatabaseDrop" );
endif;
end;
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 10, 2009
09:56 AM
Did you add a connection and your SQL script in the SQL Scripts view? The SQLRTComponentUninstall function is designed to work in conjunction with the view.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 12, 2009
03:50 AM
Hi
I've added a feature called DatabaseDrop, and then created an SQLConnection with an associated SQL script and have associated this script with the DatabaseDrop feature.
But my problem seems to relate more on the scripting side where the SQLRTComponentUninstall is not recognised.
It looks like I'm missing a #include for either a .h or .rul file by I can't quite work out which
T.
I've added a feature called DatabaseDrop, and then created an SQLConnection with an associated SQL script and have associated this script with the DatabaseDrop feature.
But my problem seems to relate more on the scripting side where the SQLRTComponentUninstall is not recognised.
It looks like I'm missing a #include for either a .h or .rul file by I can't quite work out which
T.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 12, 2009
10:51 AM
Instead of calling the SQLRTComponentUninstall function directly, I would suggest that you will modify the OnSQLComponentInstalled and/or OnSQLComponentUninstalled event to run or not run your SQL script based on your end user's input. Your code will look like this:
BOOL g_bPreserveDatabase;
export prototype TestPro_UnInstalled();
function TestPro_UnInstalled()
NUMBER nResult;
begin
g_bPreserveDatabase = FALSE;
if (AskYesNo("Preserve Database. Would you like to leave the database " +
"after uninstalling?", YES) = YES) then
g_bPreserveDatabase = TRUE;
endif;
end;
function OnSQLComponentUninstalled(szComponent)
string szMessage, szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
number nResult;
BOOL bvOpt1, bvOpt2;
begin
if(g_bPreserveDatabase = TRUE) then
return 0;
endif;
if( SQLRTGetBatchMode() ) then
// Queue up the component to run later
nResult = SQLRTAddToBatchInstall( szComponent );
else
// Run scripts now
nResult = SQLRTComponentInstall( szComponent );
if( nResult = SQL_ERROR_ABORT ) then
// Get error message
SQLRTGetScriptErrorMessage( szMessage );
// Display error
MessageBox( szMessage, SEVERE );
// Rollback SQL Scripts
SQLRTDoRollbackAll();
// Close the current dialog.
EndCurrentDialog();
//Display Finish dialog.
szTitle = "";
szMsg1 = SdLoadString( SD_STR_ONCANCELING_FINISH_MSG1 );
szMsg2 = SdLoadString( SD_STR_ONCANCELING_FINISH_MSG2 );
szOpt1 = "";
szOpt2 = "";
bvOpt1 = FALSE;
bvOpt2 = FALSE;
SdFinish ( szTitle, szMsg1, szMsg2 , szOpt1, szOpt2, bvOpt1, bvOpt2 );
abort;
endif;
endif;
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 13, 2009
10:33 AM
thanks for the reply. I've got it working now. I had to change from an Installscript MSI project to an Installscript to get access to the SQLRT routines.
I also made a small additional modification to check for a specific component "dropit" which is specifically for droping the database. As I don't want to block any other scripts that might be scheduled to run on feature uninstall. See code below in red
thanks
T.
function OnSQLComponentUninstalled(szComponent)
string szMessage, szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
number nResult;
BOOL bvOpt1, bvOpt2;
begin
if(g_bPreserveDatabase = TRUE) then
if(szComponent="dropit.sql_SQLComponent") then
return 0;
endif;
endif;
I also made a small additional modification to check for a specific component "dropit" which is specifically for droping the database. As I don't want to block any other scripts that might be scheduled to run on feature uninstall. See code below in red
thanks
T.
function OnSQLComponentUninstalled(szComponent)
string szMessage, szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
number nResult;
BOOL bvOpt1, bvOpt2;
begin
if(g_bPreserveDatabase = TRUE) then
if(szComponent="dropit.sql_SQLComponent") then
return 0;
endif;
endif;
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)