Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8299441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:09:19+00:00 2026-06-08T16:09:19+00:00

i have written a oracle query in Script Task and assigned it to string

  • 0

i have written a oracle query in Script Task and assigned it to string variable. This is my query

string oracle_query = "SELECT bank_ID, Branch_ID, Trans_NUM, Trans_DT, convert(Varchar(25),quantity) AS quantity  FROM OPENQUERY(orcale_server_name,  'SELECT * "
                + "FROM oracletable" +
                 " where bank_ID =''" + Dts.Variables["User::bank_ID"].Value.ToString() + "'' AND Trans_DT = ''" + Dts.Variables["User::Trans_DT"].Value.ToString() + "'' AND quantity = " + Dts.Variables["User::quantity"].Value.ToString() + " AND Branch_ID = ''" + Dts.Variables["User::Branch_ID"].Value.ToString() + "'' ')"; 

the result of this query has been assigned to string variabl which i have declared in my package

Dts.Variables["oraclequery"].Value = oracle_query; .  

output of this query is

bank_ID  Branch_ID  Trans_Num  Trans_DT   Quantity  
12         13       12AS566    2012-01-01  4000     

Based on Trans_Num column i need to update one more table.

Instead of script task i can use oledb TranFormation, but while passing Running parameters in Oledb Source, no data is coming.

So the result of script task i have assigned to OracleQuery varibale and passed as source variable in Execute Sql Task and resultset as Full Result Set .

This Execute SQl Task resultset i have passed to for each loop container and inside varibale index i have assigned OracleQuery Varibale.

but still no data is populating

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:09:22+00:00Added an answer on June 8, 2026 at 4:09 pm

    1.First you need to create variables for the column being retrieved from your oracle query

    2.Then the variable oraclequery should be of type System.Object

    3.In the resultSet tab of Execute SQL task assign the result to the variable oraclequery

    ResultName    VariableName 
     0            oraclequery 
    

    4.Then in the ForEach Loop use ADO Enumerator and select ADO Object SourceVariable to oraclequery and click the radio button Rows in the First Table

    In the variable mapping of for each loop, map the columns in the same order as it is being retrieved from the query .

     Variable     Index 
      BankId       0
      Branch_ID    1 
     ....          ..
    

    Now you can access these variable inside inside a DFT placed in the Foreach loop and then use OLEDB component to update another table based on the Trans_Num

    For more details refer this article and this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a PHP script to pull a query from an Oracle database
As I had written in title, I have SQL query, run on Oracle DB,
I have written the following query using the documentation at: Oracle Documentation to copy
I need a SINGLE query that does this sequence in oracle. select count(*) from
have written this little class, which generates a UUID every time an object of
I have written a bash script which installs a number of packages, however for
I have written this code inside a servlet to delete certain records from three
I have written this code in JavaScript and works perfectly fine when I include
we have written a C# 3.5 client talking to an Oracle database (11g) using
Can we have multiple SQL* PLUS connections in a shell script? I have written

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.