Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
inline command help
summergs
I am trying to get the inline command to work for my DCT, however, I am having NO *&$% LUCK. I even created a VERY simple perl script to return "hello" into a textarea but nothing. Any Ideas??
Find more posts tagged with
Comments
summergs
Here is the associated perl
agubbi21
Use this code. It should work
#!d:/iw-home/iw-perl/bin/iwperl
#############################################
##########################################
#### Very simple callout that reads items
#### from a database and formats them for
#### use with a templating inline callout
##########################################
use DBI;
$table_name = "COUNTY_REF";
$column_key = "COUNTY_NAME";
$column_value = "COUNTY_REF_ID";
#Fill in the details about user and password appropriately.
my $dbh = DBI->connect("DBI
DBC
HAPLC",'plcdba','plcdba',
{
# Default Database Connection Attributes
PrintError => 0, # Messes up the GUI
RaiseError => 1, # Handled elsewhere
AutoCommit => 1, # Usually good
LongTruncOk => 1, # Fetch what you can
LongReadLen => 3200, # Usually enough
ChopBlanks => 1, # Good default for varchar
# User-supplied Attributes and Overrides
}
);
my $sql = "SELECT " . $column_key. "," . $column_value . " FROM " . $table_name;
$stmt = $dbh->prepare($sql);
$stmt->execute();
print "<substitution>\n";
#print "<option value=\"False\" label=\"----\"/>\n";
while (
@val
= $stmt->fetchrow()) {
print qq~<option label="$val[0]" value="$val[1]"/>\n~;
}
print "</substitution>\n";
$stmt->finish();
$dbh->disconnect();
exit;
Thanks,
AG
18295.pdf
summergs
Thanks agubbi21,
UNfortunatly I have isolated the problem to the Oracle DBi. Although Interwoven documentation leads one to believe otherwise, it appears that TeamSite uses a java bridge to process perl calls to a database. I am attempting to ugrade the DBi to match Oracle 8i. Far more difficult than explained by Interwoven. Pray to **** that you never have to deal with Team Site and Oracle on a Windows Environment.
output.pdf
Migrateduser
Hi summergs,
Did you manager to solve the problem?
I'm also trying to do the same, but its not working for me.
I'm using ODBC. My perl script runs properly from command line, but when I include it in datacapture.cfg, a blank screen appears when I try to load the DCT.
Can anyone please take a look at the attached docs and let me know whats wrong with it?
I'm not sure if the libs and path etc for ODBC are automatically taken from the system env vars.
For executing the script from command line, i'm not setting any additional vars.
Thanks
Adam Stoller
The environment within an inline-callout is differnt than the environment from the command shell. You need to explicitly set some environment variables related to the DB in your perl script. There have been posts on this before - basically write a little perl function like so:
sub printenv{
foreach (sort(keys(%ENV))){
print "$_ : $ENV{$_}\n";
}
}
Run this from the command line, and run it from within your inline script - you'll notice a big difference between the resulting output. You need to explicitly set the DB-specific information within your inline script in order for it to be able to connect / interact with the DB.
--fish
(Interwoven Senior Technical Consultant)
summergs
Issue has been continued on my later question: "Has anyone ever upgraded DBI for Oracle8i?"
(Fish, I didnt think we needed to do that if we were handling the connection through ODBC?...am I wrong?)
18311.pdf