Hi all,I am working on Control Hub on unix platform .I have a workflow in which an external task calls upon a perl script , this script connects to an oracle databse and inserts values into a table. Now this script runs fine when invoked through the command prompt itself , however when it is invoked through the external task , though the perl script executes it is not able to make the database connection .I tried setting the environment variables ( ORACLE_HOME, LD_LIBRARY_PATH ) from the perl script however even that isnt working. Also the perl script is not able to execute any of the CLTs. Is this an unix permission issue (the owner of the external task is 'root') or is ther any othe other way of doing it? The solution that we came up with for this isssue was to invoke a shell script first , that will set the necessary environment variables and then call execute the perl script to make the DB. connection.This works fine but we are facing call back issues as we are not able to get the task id in the perl script. Kindly suggest if there is a way out of this issue and how would i be able to invoke the perl script directly instead of using a shell script in between.Thanks,PK
...BEGIN { $ENV{env_var_name1} = "value1"; $ENV{env_var_name2} = "value2"; ...};...
why isnt CH allowing me to set the environment variables through perl script or is it a unix related issue ?
the values I am setting are not incorrect ,I can assure that #!/usr/Interwoven/ControlHub/iw-perl/bin/iwperlBEGIN {$ENV{'ORACLE_HOME'} = "value1";$ENV{'LD_LIBRARY_PATH'} = "value2";$ENV{'PATH'} = "";};use Getopt:td;use File::Basename;use strict;use TeamSite::WFtask;use TeamSite::WFworkflow;use TeamSite::Config;use TeamSite::XMLparser;use TeamSite::JavaResourceBundle;use HTML::Entities;use DBI;...my ($MapNumber,$SourcePath,$TargetPath,$ServerName,$FileName,$Adapter,$UserName,$GroupName,$Permission,$rownum) = ();my ($dcr_file_path, $tablename, $wfid, $taskid, $area) = (@ARGV[0..4]);...my $dbh = DBI->connect('dbiracle:host=name;sid=id','user','password', {RaiseError => 1, PrintError => 1}) or die "Cannot Connect";...This is the code uptill the db connection , now the problem is when this perl script is called through a shell script (after setting the above mentioned environment variables through the shell script) it runs fine , however when I try to set the variables in the perl script itself , it just doesnt happen and the connection doesnt take place .
#!/usr/Interwoven/ControlHub/iw-perl/bin/iwperlBEGIN {$ENV{'ORACLE_HOME'} = "value1";$ENV{'LD_LIBRARY_PATH'} = "value2";$ENV{'PATH'} = "";};use Getopt:td;use File::Basename;use strict;use TeamSite::WFtask;use TeamSite::WFworkflow;use TeamSite::Config;use TeamSite::XMLparser;use TeamSite::JavaResourceBundle;use HTML::Entities;use DBI;...my ($MapNumber,$SourcePath,$TargetPath,$ServerName,$FileName,$Adapter,$UserName,$GroupName,$Permission,$rownum) = ();my ($dcr_file_path, $tablename, $wfid, $taskid, $area) = (@ARGV[0..4]);...my $dbh = DBI->connect('dbiracle:host=name;sid=id','user','password', {RaiseError => 1, PrintError => 1}) or die "Cannot Connect";...This is the code uptill the db connection , now the problem is when this perl script is called through a shell script (after setting the above mentioned environment variables through the shell script) it runs fine , however when I try to set the variables in the perl script itself , it just doesnt happen and the connection doesnt take place .