dbTalk Databases Forums  

Using Python in ActiveX task - works when run as separate step, hangs when executing package

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Using Python in ActiveX task - works when run as separate step, hangs when executing package in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter A. Schott
 
Posts: n/a

Default Using Python in ActiveX task - works when run as separate step, hangs when executing package - 08-17-2005 , 11:22 AM






Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside of an
ActiveX task. When I step through the package running each step, the package
runs fine, even to the point of running the "message box" to see where the code
is stopping.

When I try to execute the package as a whole, it goes through all preceeding
steps, but stops at the Python task without showing even the first message box
saying that the function is starting to execute.

Looking at the logs, I have NULLs for stepexecstatus, stepexecresult, endtime,
elapsedtime, errorcode, errordescription, and progresscount in the sysdtssteplog
table.

I'm running under the same users in each case as far as I can tell.

If anyone has encountered something similar with other languages (Perl, PHP,
etc) and has fixed it, please let me know what you did.

If anyone has any ideas on how to get some detailed errors on why it is hanging
here, please let me know and I'll post the results.

Thanks.

-Pete Schott

Reply With Quote
  #2  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: Using Python in ActiveX task - works when run as separate step, hangs when executing package - 08-18-2005 , 04:01 AM






Hello Pete,

Though it is possible to use different script engine such as perl, Python
in ActiveX task, it is not official support.

It is suggest that you use a simple test script ( I use VB script as
sample) to make sure if Python can work under this stiaution

Function Main()

DTSGlobalVariables( "Test" ) = "Test"

msgbox DTSGlobalVariables("Test")

Main = DTSTaskExecResult_Success

End Function

You could execute the step in DTS package window.

I ever installed Perl and it works OK. If above step fail, please try to
click "Auto Gen" to generate default (blank) function to test.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
Subject: Using Python in ActiveX task - works when run as separate step,
hangs when executing package
Date: Wed, 17 Aug 2005 11:22:20 -0500
Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
X-Newsreader: Forte Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: microsoft.public.sqlserver.dts
NNTP-Posting-Host: 216.178.160.231
Lines: 1
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
X-Tomcat-NG: microsoft.public.sqlserver.dts

Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside
of an
ActiveX task. When I step through the package running each step, the
package
runs fine, even to the point of running the "message box" to see where
the code
is stopping.

When I try to execute the package as a whole, it goes through all
preceeding
steps, but stops at the Python task without showing even the first
message box
saying that the function is starting to execute.

Looking at the logs, I have NULLs for stepexecstatus, stepexecresult,
endtime,
elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
table.

I'm running under the same users in each case as far as I can tell.

If anyone has encountered something similar with other languages (Perl,
PHP,
etc) and has fixed it, please let me know what you did.

If anyone has any ideas on how to get some detailed errors on why it is
hanging
here, please let me know and I'll post the results.

Thanks.

-Pete Schott



Reply With Quote
  #3  
Old   
Peter A. Schott
 
Posts: n/a

Default RE: Using Python in ActiveX task - works when run as separate step - 08-18-2005 , 07:51 AM



Well, I've got a bunch of other VBScript tasks running without any issues. I
was trying to use Python in this case because I know it a little better than
VBScript and it was easier to do what I needed. I will try the
auto-generation of a blank function and see if I can run just that as a whole.

The way I defined my task was by defining a Main() function in Python and
putting all of my code in there. Do I need to call the function as well or
will DTS call the main() function? Do I just need to put my code in there
without a function? Can you give me a sample of how you got your ActivePerl
code to work? That may give me some pointers.

Thanks for your help.

-Pete


"Peter Yang [MSFT]" wrote:

Quote:
Hello Pete,

Though it is possible to use different script engine such as perl, Python
in ActiveX task, it is not official support.

It is suggest that you use a simple test script ( I use VB script as
sample) to make sure if Python can work under this stiaution

Function Main()

DTSGlobalVariables( "Test" ) = "Test"

msgbox DTSGlobalVariables("Test")

Main = DTSTaskExecResult_Success

End Function

You could execute the step in DTS package window.

I ever installed Perl and it works OK. If above step fail, please try to
click "Auto Gen" to generate default (blank) function to test.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| Subject: Using Python in ActiveX task - works when run as separate step,
hangs when executing package
| Date: Wed, 17 Aug 2005 11:22:20 -0500
| Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
| X-Newsreader: Forte Agent 3.0/32.763
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.dts
| NNTP-Posting-Host: 216.178.160.231
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
| X-Tomcat-NG: microsoft.public.sqlserver.dts
|
| Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside
of an
| ActiveX task. When I step through the package running each step, the
package
| runs fine, even to the point of running the "message box" to see where
the code
| is stopping.
|
| When I try to execute the package as a whole, it goes through all
preceeding
| steps, but stops at the Python task without showing even the first
message box
| saying that the function is starting to execute.
|
| Looking at the logs, I have NULLs for stepexecstatus, stepexecresult,
endtime,
| elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
| table.
|
| I'm running under the same users in each case as far as I can tell.
|
| If anyone has encountered something similar with other languages (Perl,
PHP,
| etc) and has fixed it, please let me know what you did.
|
| If anyone has any ideas on how to get some detailed errors on why it is
hanging
| here, please let me know and I'll post the results.
|
| Thanks.
|
| -Pete Schott
|



Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Using Python in ActiveX task - works when run as separate step - 08-18-2005 , 06:09 PM



Peter A. Schott wrote:
Quote:
Well, I've got a bunch of other VBScript tasks running without any issues. I
was trying to use Python in this case because I know it a little better than
VBScript and it was easier to do what I needed. I will try the
auto-generation of a blank function and see if I can run just that as a whole.

The way I defined my task was by defining a Main() function in Python and
putting all of my code in there. Do I need to call the function as well or
will DTS call the main() function? Do I just need to put my code in there
without a function? Can you give me a sample of how you got your ActivePerl
code to work? That may give me some pointers.

Thanks for your help.

-Pete


"Peter Yang [MSFT]" wrote:


Hello Pete,

Though it is possible to use different script engine such as perl, Python
in ActiveX task, it is not official support.

It is suggest that you use a simple test script ( I use VB script as
sample) to make sure if Python can work under this stiaution

Function Main()

DTSGlobalVariables( "Test" ) = "Test"

msgbox DTSGlobalVariables("Test")

Main = DTSTaskExecResult_Success

End Function

You could execute the step in DTS package window.

I ever installed Perl and it works OK. If above step fail, please try to
click "Auto Gen" to generate default (blank) function to test.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| Subject: Using Python in ActiveX task - works when run as separate step,
hangs when executing package
| Date: Wed, 17 Aug 2005 11:22:20 -0500
| Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
| X-Newsreader: Forte Agent 3.0/32.763
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.dts
| NNTP-Posting-Host: 216.178.160.231
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
| X-Tomcat-NG: microsoft.public.sqlserver.dts
|
| Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside
of an
| ActiveX task. When I step through the package running each step, the
package
| runs fine, even to the point of running the "message box" to see where
the code
| is stopping.
|
| When I try to execute the package as a whole, it goes through all
preceeding
| steps, but stops at the Python task without showing even the first
message box
| saying that the function is starting to execute.
|
| Looking at the logs, I have NULLs for stepexecstatus, stepexecresult,
endtime,
| elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
| table.
|
| I'm running under the same users in each case as far as I can tell.
|
| If anyone has encountered something similar with other languages (Perl,
PHP,
| etc) and has fixed it, please let me know what you did.
|
| If anyone has any ideas on how to get some detailed errors on why it is
hanging
| here, please let me know and I'll post the results.
|
| Thanks.
|
| -Pete Schott
|


You should not need to call Main. The UI includes the entry point text
box which does this for you. See the "FunctionName" property in BOL,
which is what the task calls on execute.

Saying that I could never get other scripting languages to work, but
probably my in experience in them, as I believe others have, Perl at least.



--
Darren Green
http://www.sqldts.com
http://www.sqlis.com


Reply With Quote
  #5  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Using Python in ActiveX task - works when run as separate step - 08-22-2005 , 12:50 PM



OK - found the setting to change the function called. It defaults to Main, but
does not have to be Main. I left it alone just because it was easier in the
long run. I'm still not having any luck getting it to work as part of a
package. I tried tweaking the step properties which still indicated this was a
VBScript step, but that didn't seem to make any difference either. Still hangs
when executing the package.

Peter Yang, if you can detail some of what you did to get Perl working, I'd
appreciate it. It may help me solve my current issue.

Thanks.

-Pete Schott

Darren Green <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote:

Quote:
Peter A. Schott wrote:
Well, I've got a bunch of other VBScript tasks running without any issues. I
was trying to use Python in this case because I know it a little better than
VBScript and it was easier to do what I needed. I will try the
auto-generation of a blank function and see if I can run just that as a whole.

The way I defined my task was by defining a Main() function in Python and
putting all of my code in there. Do I need to call the function as well or
will DTS call the main() function? Do I just need to put my code in there
without a function? Can you give me a sample of how you got your ActivePerl
code to work? That may give me some pointers.

Thanks for your help.

-Pete


"Peter Yang [MSFT]" wrote:


Hello Pete,

Though it is possible to use different script engine such as perl, Python
in ActiveX task, it is not official support.

It is suggest that you use a simple test script ( I use VB script as
sample) to make sure if Python can work under this stiaution

Function Main()

DTSGlobalVariables( "Test" ) = "Test"

msgbox DTSGlobalVariables("Test")

Main = DTSTaskExecResult_Success

End Function

You could execute the step in DTS package window.

I ever installed Perl and it works OK. If above step fail, please try to
click "Auto Gen" to generate default (blank) function to test.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| Subject: Using Python in ActiveX task - works when run as separate step,
hangs when executing package
| Date: Wed, 17 Aug 2005 11:22:20 -0500
| Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
| X-Newsreader: Forte Agent 3.0/32.763
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.dts
| NNTP-Posting-Host: 216.178.160.231
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
| X-Tomcat-NG: microsoft.public.sqlserver.dts
|
| Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside
of an
| ActiveX task. When I step through the package running each step, the
package
| runs fine, even to the point of running the "message box" to see where
the code
| is stopping.
|
| When I try to execute the package as a whole, it goes through all
preceeding
| steps, but stops at the Python task without showing even the first
message box
| saying that the function is starting to execute.
|
| Looking at the logs, I have NULLs for stepexecstatus, stepexecresult,
endtime,
| elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
| table.
|
| I'm running under the same users in each case as far as I can tell.
|
| If anyone has encountered something similar with other languages (Perl,
PHP,
| etc) and has fixed it, please let me know what you did.
|
| If anyone has any ideas on how to get some detailed errors on why it is
hanging
| here, please let me know and I'll post the results.
|
| Thanks.
|
| -Pete Schott
|



You should not need to call Main. The UI includes the entry point text
box which does this for you. See the "FunctionName" property in BOL,
which is what the task calls on execute.

Saying that I could never get other scripting languages to work, but
probably my in experience in them, as I believe others have, Perl at least.

Reply With Quote
  #6  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default Re: Using Python in ActiveX task - works when run as separate step - 08-23-2005 , 02:21 AM



Hello Peter,

I just used some simple script to test:

sub Main()
{

use Win32;
Win32::MsgBox('Hello Word!', 2|MB_ICONQUESTION, 'My title');
return 0; # DTSTaskExecResult_Success;
}

I installed ActivePerl on my test machine, create a new DTS package, and a
new ActiveX script task.

In language box, I selected "PerlScript language", and click Auto Gen to
create the default Main function. I added the MsgBox function to test. I
then executed the task with the proper result.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
Subject: Re: Using Python in ActiveX task - works when run as separate
step
Date: Mon, 22 Aug 2005 12:50:51 -0500
Message-ID: <2v3kg11g1r7eicqqodu3ad3nrgs19g03n3 (AT) 4ax (DOT) com
References: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
S6M9aN9oFHA.3472 (AT) TK2MSFTNGXA01 (DOT) phx.gbl
<226FE108-09F5-4253-A14E-3C8C2D715C71 (AT) microsoft (DOT) com>
<uGY0enEpFHA.2472 (AT) tk2msftngp13 (DOT) phx.gbl>
Quote:
X-Newsreader: Forte Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: microsoft.public.sqlserver.dts
NNTP-Posting-Host: 216.178.160.231
Lines: 1
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14210
X-Tomcat-NG: microsoft.public.sqlserver.dts

OK - found the setting to change the function called. It defaults to
Main, but
does not have to be Main. I left it alone just because it was easier in
the
long run. I'm still not having any luck getting it to work as part of a
package. I tried tweaking the step properties which still indicated this
was a
VBScript step, but that didn't seem to make any difference either. Still
hangs
when executing the package.

Peter Yang, if you can detail some of what you did to get Perl working,
I'd
appreciate it. It may help me solve my current issue.

Thanks.

-Pete Schott

Darren Green <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote:

Peter A. Schott wrote:
Well, I've got a bunch of other VBScript tasks running without any
issues. I
was trying to use Python in this case because I know it a little
better than
VBScript and it was easier to do what I needed. I will try the
auto-generation of a blank function and see if I can run just that as
a whole.

The way I defined my task was by defining a Main() function in Python
and
putting all of my code in there. Do I need to call the function as
well or
will DTS call the main() function? Do I just need to put my code in
there
without a function? Can you give me a sample of how you got your
ActivePerl
code to work? That may give me some pointers.

Thanks for your help.

-Pete


"Peter Yang [MSFT]" wrote:


Hello Pete,

Though it is possible to use different script engine such as perl,
Python
in ActiveX task, it is not official support.

It is suggest that you use a simple test script ( I use VB script as
sample) to make sure if Python can work under this stiaution

Function Main()

DTSGlobalVariables( "Test" ) = "Test"

msgbox DTSGlobalVariables("Test")

Main = DTSTaskExecResult_Success

End Function

You could execute the step in DTS package window.

I ever installed Perl and it works OK. If above step fail, please try
to
click "Auto Gen" to generate default (blank) function to test.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| Subject: Using Python in ActiveX task - works when run as separate
step,
hangs when executing package
| Date: Wed, 17 Aug 2005 11:22:20 -0500
| Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
| X-Newsreader: Forte Agent 3.0/32.763
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.dts
| NNTP-Posting-Host: 216.178.160.231
| Lines: 1
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
| X-Tomcat-NG: microsoft.public.sqlserver.dts
|
| Trying to use Python 2.4.1 with the Win32 extensions (build 204)
inside
of an
| ActiveX task. When I step through the package running each step,
the
package
| runs fine, even to the point of running the "message box" to see
where
the code
| is stopping.
|
| When I try to execute the package as a whole, it goes through all
preceeding
| steps, but stops at the Python task without showing even the first
message box
| saying that the function is starting to execute.
|
| Looking at the logs, I have NULLs for stepexecstatus,
stepexecresult,
endtime,
| elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
| table.
|
| I'm running under the same users in each case as far as I can tell.
|
| If anyone has encountered something similar with other languages
(Perl,
PHP,
| etc) and has fixed it, please let me know what you did.
|
| If anyone has any ideas on how to get some detailed errors on why
it is
hanging
| here, please let me know and I'll post the results.
|
| Thanks.
|
| -Pete Schott
|



You should not need to call Main. The UI includes the entry point text
box which does this for you. See the "FunctionName" property in BOL,
which is what the task calls on execute.

Saying that I could never get other scripting languages to work, but
probably my in experience in them, as I believe others have, Perl at
least.



Reply With Quote
  #7  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Using Python in ActiveX task - works when run as separate step - 08-25-2005 , 02:34 PM



Well, trying the same thing with ActivePython on my machine. Basic function
would be:

def Main():
return 0

As noted, this works when I run just that task, but not when I try to execute
the whole package. Are you able to execute the package as well, or just the
task?


As a side note, I've pretty much given up on getting this to work and just
generated a file containing the variables needed in CSV format. I can then read
those in using Python to do virtually the same thing as I wanted to do in DTS.
This just changes the location used to run the code.

I'd still like to know if anyone gets this to work inside of DTS as it would be
pretty cool to take advantage of the Python language directly. Peter, can you
give the above a try and see if it works for you?

Thanks to all who responded.

-Pete Schott

petery (AT) online (DOT) microsoft.com (Peter Yang [MSFT]) wrote:

Quote:
Hello Peter,

I just used some simple script to test:

sub Main()
{

use Win32;
Win32::MsgBox('Hello Word!', 2|MB_ICONQUESTION, 'My title');
return 0; # DTSTaskExecResult_Success;
}

I installed ActivePerl on my test machine, create a new DTS package, and a
new ActiveX script task.

In language box, I selected "PerlScript language", and click Auto Gen to
create the default Main function. I added the MsgBox function to test. I
then executed the task with the proper result.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| Subject: Re: Using Python in ActiveX task - works when run as separate
step
| Date: Mon, 22 Aug 2005 12:50:51 -0500
| Message-ID: <2v3kg11g1r7eicqqodu3ad3nrgs19g03n3 (AT) 4ax (DOT) com
| References: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
S6M9aN9oFHA.3472 (AT) TK2MSFTNGXA01 (DOT) phx.gbl
226FE108-09F5-4253-A14E-3C8C2D715C71...soft (DOT) com
uGY0enEpFHA.2472 (AT) tk2msftngp13 (DOT) phx.gbl
| X-Newsreader: Forte Agent 3.0/32.763
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.dts
| NNTP-Posting-Host: 216.178.160.231
| Lines: 1
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14210
| X-Tomcat-NG: microsoft.public.sqlserver.dts
|
| OK - found the setting to change the function called. It defaults to
Main, but
| does not have to be Main. I left it alone just because it was easier in
the
| long run. I'm still not having any luck getting it to work as part of a
| package. I tried tweaking the step properties which still indicated this
was a
| VBScript step, but that didn't seem to make any difference either. Still
hangs
| when executing the package.
|
| Peter Yang, if you can detail some of what you did to get Perl working,
I'd
| appreciate it. It may help me solve my current issue.
|
| Thanks.
|
| -Pete Schott
|
| Darren Green <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote:
|
| > Peter A. Schott wrote:
| > > Well, I've got a bunch of other VBScript tasks running without any
issues. I
| > > was trying to use Python in this case because I know it a little
better than
| > > VBScript and it was easier to do what I needed. I will try the
| > > auto-generation of a blank function and see if I can run just that as
a whole.
|
| > > The way I defined my task was by defining a Main() function in Python
and
| > > putting all of my code in there. Do I need to call the function as
well or
| > > will DTS call the main() function? Do I just need to put my code in
there
| > > without a function? Can you give me a sample of how you got your
ActivePerl
| > > code to work? That may give me some pointers.
|
| > > Thanks for your help.
|
| > > -Pete
|
|
| > > "Peter Yang [MSFT]" wrote:
|
|
| > >>Hello Pete,
|
| > >>Though it is possible to use different script engine such as perl,
Python
| > >>in ActiveX task, it is not official support.
|
| > >>It is suggest that you use a simple test script ( I use VB script as
| > >>sample) to make sure if Python can work under this stiaution
|
| > >>Function Main()
|
| > >> DTSGlobalVariables( "Test" ) = "Test"
|
| > >> msgbox DTSGlobalVariables("Test")
|
| > >> Main = DTSTaskExecResult_Success
|
| > >>End Function
|
| > >>You could execute the step in DTS package window.
|
| > >>I ever installed Perl and it works OK. If above step fail, please try
to
| > >>click "Auto Gen" to generate default (blank) function to test.
|
| > >>Best Regards,
|
| > >>Peter Yang
| > >>MCSE2000/2003, MCSA, MCDBA
| > >>Microsoft Online Partner Support
|
| > >>When responding to posts, please "Reply to Group" via your newsreader
so
| > >>that others may learn and benefit from your issue.
|
| > >>================================================ =====
|
|
| > >>This posting is provided "AS IS" with no warranties, and confers no
rights.
|
|
| > >>--------------------
| > >>| From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
| > >>| Subject: Using Python in ActiveX task - works when run as separate
step,
| > >>hangs when executing package
| > >>| Date: Wed, 17 Aug 2005 11:22:20 -0500
| > >>| Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
| > >>| X-Newsreader: Forte Agent 3.0/32.763
| > >>| MIME-Version: 1.0
| > >>| Content-Type: text/plain; charset=us-ascii
| > >>| Content-Transfer-Encoding: 7bit
| > >>| Newsgroups: microsoft.public.sqlserver.dts
| > >>| NNTP-Posting-Host: 216.178.160.231
| > >>| Lines: 1
| > >>| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| > >>| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
| > >>| X-Tomcat-NG: microsoft.public.sqlserver.dts
| > >>|
| > >>| Trying to use Python 2.4.1 with the Win32 extensions (build 204)
inside
| > >>of an
| > >>| ActiveX task. When I step through the package running each step,
the
| > >>package
| > >>| runs fine, even to the point of running the "message box" to see
where
| > >>the code
| > >>| is stopping.
| > >>|
| > >>| When I try to execute the package as a whole, it goes through all
| > >>preceeding
| > >>| steps, but stops at the Python task without showing even the first
| > >>message box
| > >>| saying that the function is starting to execute.
| > >>|
| > >>| Looking at the logs, I have NULLs for stepexecstatus,
stepexecresult,
| > >>endtime,
| > >>| elapsedtime, errorcode, errordescription, and progresscount in the
| > >>sysdtssteplog
| > >>| table.
| > >>|
| > >>| I'm running under the same users in each case as far as I can tell.
| > >>|
| > >>| If anyone has encountered something similar with other languages
(Perl,
| > >>PHP,
| > >>| etc) and has fixed it, please let me know what you did.
| > >>|
| > >>| If anyone has any ideas on how to get some detailed errors on why
it is
| > >>hanging
| > >>| here, please let me know and I'll post the results.
| > >>|
| > >>| Thanks.
| > >>|
| > >>| -Pete Schott
| > >>|
|
|
|
| > You should not need to call Main. The UI includes the entry point text
| > box which does this for you. See the "FunctionName" property in BOL,
| > which is what the task calls on execute.
|
| > Saying that I could never get other scripting languages to work, but
| > probably my in experience in them, as I believe others have, Perl at
least.
|

Reply With Quote
  #8  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: Using Python in ActiveX task - works when run as separate step, hangs when executing package - 08-25-2005 , 10:38 PM



Hello Peter,

The whole DTS package also works properly for perl.

I downloaded ActivePython, installed it and test the function you provided,
I could execute the task but it stoped to respond when execute the whole
package.

Also, I found AutoGen does not work for Python.

It seems Python cannot work with DTS in SQL server.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: Peter A. Schott <paschott (AT) newsgroup (DOT) nospam
Subject: Using Python in ActiveX task - works when run as separate step,
hangs when executing package
Date: Wed, 17 Aug 2005 11:22:20 -0500
Message-ID: <sgo6g1lkvd7ti0cndf53jegli71vevptdo (AT) 4ax (DOT) com
X-Newsreader: Forte Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: microsoft.public.sqlserver.dts
NNTP-Posting-Host: 216.178.160.231
Lines: 1
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.dts:14088
X-Tomcat-NG: microsoft.public.sqlserver.dts

Trying to use Python 2.4.1 with the Win32 extensions (build 204) inside
of an
ActiveX task. When I step through the package running each step, the
package
runs fine, even to the point of running the "message box" to see where
the code
is stopping.

When I try to execute the package as a whole, it goes through all
preceeding
steps, but stops at the Python task without showing even the first
message box
saying that the function is starting to execute.

Looking at the logs, I have NULLs for stepexecstatus, stepexecresult,
endtime,
elapsedtime, errorcode, errordescription, and progresscount in the
sysdtssteplog
table.

I'm running under the same users in each case as far as I can tell.

If anyone has encountered something similar with other languages (Perl,
PHP,
etc) and has fixed it, please let me know what you did.

If anyone has any ideas on how to get some detailed errors on why it is
hanging
here, please let me know and I'll post the results.

Thanks.

-Pete Schott



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.