Solved

DTS questions

Posted on 2004-03-23
8
344 Views
Last Modified: 2013-11-30
Hi,
 
i have few question about DTS :
- how to pass  global variable to PL/SQL procedure (when i put "?" as one of arguments - it says -" sql statement does not contain any parameters"

- how to implement  "if/case -logic"
i want to analyze the value of global variable and depending on this value  execute one  or another step ....

- i am executing 10 transformation concurrently and sending success email if all of them succeed, now i need to send a failure email if at least one of these 10 transformations fails. how to do this ?

thanks in advance,
Irina
0
Comment
Question by:irinag
  • 3
  • 3
  • 2
8 Comments
 
LVL 14

Accepted Solution

by:
adwiseman earned 150 total points
Comment Utility
Using the parameters in SQL tasks is very limited as to what the Designer will allow you to implement.  There are a few workarounds.

First, only pass in the paramter once.  If you have some SQL that needs in in multiple places, do it like follows


Declare @v1 int, @v2 int

Set @v1 = ?
Set @v2 = ?

--- your SLQ, procedure calls using @v1, @v2


To get the designer to accept this code you must trick it.

Get the SQL task to accept your parameter by doing the following

SP_WHO ? --You will need sysntax that will alow you to enter all your parameters in a given order.

After you set your parameter for the above script, paste in your script, with the parameters Declared and set in the same order, and click ok.  It will now run.  I'm going to try and find my answer for this I gave a couple of months ago, it was step by step directions.

0
 
LVL 2

Author Comment

by:irinag
Comment Utility
but i am calling Oracle Pl/SQL procedure (actually packaged procedure) , not MS SQL sproc
0
 
LVL 34

Expert Comment

by:arbert
Comment Utility
The above still goes.  YOu have to trick the driver into thinking you have a parsible SQL Statement--then you can add the parms.

If you need to evaluate the global variable, you probably want to read the global variable in an ActiveX script and then call the PSQL proc from there.

As far as sending failure emails, just put an additional workflow constraint that fires "on failure"....
0
 
LVL 2

Author Comment

by:irinag
Comment Utility
oh well , the problem is how to trick it ....


about failure-if i connect several transformations
"on failure" with email task
theis failure email getting sent only if all transformations failed
but i need to do it if at least one fails
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 14

Expert Comment

by:adwiseman
Comment Utility
Add a AxtiveX task, that executes on completion of all steps in question.  Then do and

IF globalvariables.parent.task("SQL...task1").status = ...failure OR exp OR exp THEN
    main.status_fail
ELSE
    main.status_success
END IF


And add your mail task on the failure of this activeX script task.  It will execute if your

I don't have the exact syntax, but you get the idea.
0
 
LVL 14

Expert Comment

by:adwiseman
Comment Utility
Here's another example of how to trick it into accepting your parameters.

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20909916.html
0
 
LVL 34

Expert Comment

by:arbert
Comment Utility
"oh well , the problem is how to trick it ...."

All you have to do is put in a valid Oracle statement that will validate against the data source.  Once you choose the parms you want from the parameter dialog, you can go back and change the PSQL statement to whatever you want (as long as the number of parms  are the same).
0
 
LVL 2

Author Comment

by:irinag
Comment Utility
thanks guys,

looks like "tricking"  the parser works ...

About "AxtiveX task" - i am SOOO new to this ...
so it i have let's say  2 SQL tasks A and B - (no global  variables are modified there...)

I connect both  A and B to Active X task on completion and then what code  should i put ?

thanks in advance
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now