Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
inline callout
sbzoom
I am trying to do an <inline command='...'/> from a datacapture.cfg. I call a perl script and that perl script uses DBI to get infomation into an array. This array will be looped over to display a dropdown menu.
This works just fine without the DBI. But with the DBI I keep getting connection errors. And all of my connections should be fine. Has anybody else tried this approach and had any luck?
Thanks.
Whoah TeamSite!
<Charlie/>
Find more posts tagged with
Comments
Adam Stoller
If you run the Perl script from the command line (rather than as an inline) - does it work?
If so - the problem is most likely due to a difference in the environment variables that exist at the prompt as opposed to those that exist when called as an inline script. The fix is generally to include a BEGIN{...} block in your Perl code and explicitly set the DB-specific variables you need.
(simple debugging technique - modify the script to dump the sorted environment information into a file - run it once from the prompt into one file [fileA] and again from an inline into another file [fileB] and compare the results)
Hope that helps
--fish
(Interwoven, Curriculum Development)
sbzoom
Thanks so much for the tip. It helped out. Then again, it didn't. I ran my script through the command line and, after some debugging, it worked. Then I tried it again through the browser and got the same error:
A MessageException was thrown: Error building the requirements: DBI->connect failed: [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation. (SQL-08001) [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (socket()).
Some kind of permission problem? I am logged into TeamSite and the server as the same user.
Thanks again for the help.
Whoah TeamSite!
<Charlie/>
iwovGraduate
As fish pointed out, when the script is run by TeamSite it does not inherit all the environment variables - specifically needed for DC connection. Set them in the begining of your script and it should work. (I am assuming you are able to run the script from command line successfully)
sbzoom
I am able to connect through the command line, and I have done a dump of the ENV hash to two different files and there is a huge difference. Thing is, I don't see anything that has to do with DB connections. I would specifically set what I needed for DB connections at the top of the script except that I am not digging through books and the web to find what I have to set (it has been a long time since I have done this).
I'll dig it up sooner or later. Thanks guys for the help.
Whoah TeamSite!
<Charlie/>
sbzoom
I simply added everything from one file to the top of the script. Not sure which one did it but I don't really care. It works now. Thanks again.
Whoah TeamSite!
<Charlie/>
Adam Stoller
If you post a list of the environment difference (just the environment variable names will do - don't need their values) - someone could probably point out which one(s) you need and you can clean up your script and document it for fugture reference.
--fish
(Interwoven, Curriculum Development)
sbzoom
I commented all of the env variables out and uncommented the last one: SYSTEMROOT, and everything worked jus the way it should. I'm not sure what SYSTEMROOT does to help the script, but its good enough for me.
Thanks so much for all the help.
Whoah TeamSite!
<Charlie/>