Query output into ODI variable

Hi,
I want to take the output (multiple rows and multiple columns) into an ODI variable of Text type.
I have created the variable and put the query and set the variable type as Text type. But when I send the value of this variable to other variable, it comes as blank.
Can anyone tell me how can I do that
Thanks in advance
Arun

Hello Neha,
Though i have been working with APDs since some time. But havent actually been involved in designing one. But you could find many documents for the APD on web. And as far as i know, you will need a program to save file from APD.
I have a document which explains how you can use APD in  process chain. can forward you the same if you want.
I am sorry as i wasnt of much help for you, as i havent worked on similar requirement before, but this thing just striked in my mind.
Regards,
Anuj

Similar Messages

  • Can we assign jython variable value into ODI variable?

    Hi Team,
    We are trying to save jython variable value into ODI variable so that ODI variable can use in later steps.
    we are facing failure regards same.
    Please suggest us so that we can use ODI variable value in later steps.
    Thanks
    Ankush.

    See if this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.

  • Linux file name into ODI variable

    Hello All,
    I have a situation where we have files in one directory in linux ,I want to import the file name into a ODI variable.
    Ex : A_B_C_2014_01_20.zip (inside this zip file are the flat files with data) is the file name in /u02/source_files location , i want this into a ODI variable and once the data loading is complete ,i want to log it saying
    A_B_C_2014_01_20.zip complete
    A_B_C_2014_01_21.zip complete.
    So my other shell script will look for the complete flag and copy the next file into the ODI pick up location.In this case I need to pick up A_B_C_2014_01_22.zip and start the data loading.
    How do i implement this functionality in ODI. Please let me know.

    Issue was due to a syntax error. Case closed.
    Thanks!
    -OS

  • Query output into cfmail

    I need to send an individual email to about 100 names fetched
    from an Access 2003 database. I am fetching the distinct emails
    from the database and getting each Project owned by each distinct
    email address.
    I created the correct output on a test web page where the
    query will list every distinct email address with each email
    address having their own Project Title listing. Now the question is
    how do I use my output to send an individual email to each of the
    distinct email addresses I got in my query??
    For example someone with the email Address of
    [email protected] would get one email with his Project Title
    listings that could be 3 or 4 titles. The next distinct email
    address of [email protected] will get his own email with his
    Project title listings.
    Here is my attempt but the #userEmail# has everyones email
    address.
    <cfoutput query = "theQuery" group = "userEmail">
    <cfmail to: #userEmail# subject: Project Listing
    <cfoutput>Project Listing:
    #ProjectTitle#</cfoutput>
    <cfmail>
    </cfoutput>
    Please help.

    Jazzy has the correct answer. And if your project listings
    reside in seperate tables, you need to run a seperate query within
    the loop BUT outside of the cfmail in order to retrieve those. So
    that would then be...
    <cfquery name="rs_read" datasource="xxx" >
    SELECT *
    FROM #session.sometable#
    WHERE whateverid = '#variables.whateverid#';
    </cfquery>
    <cfloop index="loopcount" from="1"
    to='#rs_read.RecordCount#' step="1">
    <cfquery name="rs_projects" datasource="xxx" >
    SELECT projects
    FROM #session.sometable#
    WHERE email = '#rs_read.email#';
    </cfquery>
    <cfset variables.proj = ''>
    <cfoutput query="rs_projects">
    <cfset variables.proj = variables.proj & ' ' &
    rs_projects.projects>
    </cfoutput>
    <cfmail from="[email protected]" to="#rs_read.email#"
    subject="#rs_projects.whatever#">
    bla bla #rs_read.anyvariable#
    PROJECTS: #variables.proj#
    </cfmail>
    </cfloop>
    REMEMBER: You can not nest outputs in outputs, that's why you
    can not run the query output inside CFMAIL because CF regards
    cfmail as an output routine.

  • How can I turn this output into a variable

    I have a script to query all the servers in AD
    Import-Module active*
    $rtn = $null
    Get-ADComputer -Filter {operatingsystem -like "*server*"} |
    ForEach-Object {
    $rtn = Test-Connection -CN $_.dnshostname -Count 1 -BufferSize 16 -Quiet
    IF($rtn -match 'True') {write-host -ForegroundColor green $_.dnshostname}
    I want to make the output a variable
    Easy way would be:
    $Servers = Get-ADComputer -Filter {operatingsystem -like "*server*"}
    Problem is this would waist time waiting for queries against disabled/powered off machines to error out
    I don't know how to use if statements in variables

    Hi,
    You can do something like this:
    $aliveServers = @()
    Get-ADComputer -Filter "OperatingSystem -like '*Server*'" | ForEach {
    If (Test-Connection -ComputerName $_.Name -Count 1 -Quiet) {
    $aliveServers += $_
    $aliveServers | Sort Name
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Query Output Into a Text File

    Hello Experts,
    There is a situation where i need ur help.My query is :
    Can I export the output of more than one queries into a * Single Text File * ?
    Also can it be possible to automate these Queries Output to export into the Text File ??
    I also want this Text File Output to mail the end users by using the Process Chain. So is this possible to create a process chain for sending this Text File to the Users via mail ??
    Thanks In Advance
    Neha

    Hello Neha,
    Though i have been working with APDs since some time. But havent actually been involved in designing one. But you could find many documents for the APD on web. And as far as i know, you will need a program to save file from APD.
    I have a document which explains how you can use APD in  process chain. can forward you the same if you want.
    I am sorry as i wasnt of much help for you, as i havent worked on similar requirement before, but this thing just striked in my mind.
    Regards,
    Anuj

  • Get the file name into a Odi variable

    Hi,
    I need to get the file name into odi variable like ..A/ETC/file.txt
    For eg.the filename file.txt should get store in a variable.
    Then i want to compare the file name stored in the variable with some other value.
    Please suggest.
    Thanks.

    in package,
    declare the variable, then evaluate it with another variable, generally using # syntax
    if the variable is date type, suggest to use : syntax, because # will treat the variable value as text value
    in loadplan
    use case when syntax,

  • Problem fetch data from oracle table to ODI variable

    Hi
    I created a procedure in ODI to fetch a record from oracle table and store it into ODI variable. In table all columns have values but those values are not storing in to ODI variables when ODI execute procedure
    After execution, i am getting following exception
    java.lang.Exception: Variable has no value: ORACLEEBIZ_PAS_BULK_LOAD_PROJECT.PVV_ORGANIZATION_CODE
         at com.sunopsis.dwg.dbobj.SnpVarSess.getValue(SnpVarSess.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.bindSessVar(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.bindSessVar(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskPreTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    My Procedure: (Please let me know the following ODI procedure correct or not)
    begin
    select
    item_number,
    primary_uom_code,
    organization_code,
    best_by_date,
    expiration_date,
    lot_number,
    origination_date,
    retest_date
    into
    '#PVN_LOT_NUMBER',
    '#PVV_PRIMARY_UOM_CODE',
    '#PVV_ORGANIZATION_CODE',
    '#PVV_BEST_BY_DATE',
    '#PVV_EXPIRATION_DATE',
    '#PVV_LOT_NUMBER',
    '#PVV_ORIGINATION_DATE',
    '#PVV_RETEST_DATE'
    from (select rownum r,b.* from apps.MTL_OPSM_LOT_EXPORT_V_TEST b) where r='#PVN_ROW_COUNT';
    end;
    Please help me to resolve the issue
    Thanks in advance
    Regards
    Phani
    Edited by: Phanikanth on Jun 29, 2010 6:36 AM
    Edited by: Phanikanth on Jun 30, 2010 3:43 AM
    Edited by: Phanikanth on Jun 30, 2010 3:59 AM

    SSIS Import/Export Wizard is the best choice:
    http://www.sqlusa.com/bestpractices/ssis-wizard/
    Alternative is linked server:
    http://www.sqlusa.com/bestpractices/linktooracle/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to use odi variable in java code.

    Hi,
    I am trying to calculate check sum of a file and need to capture that in a odi variable...
    I wrote code like this(selected technology as java bean shell)
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    #checksum = cis.getChecksum().getValue();
    }@>
    But I am not able to get that value...
    I tried in another way like this
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
         long result;
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result= cis.getChecksum().getValue();
    @>
    In odi variable refreshing mode i selected schema as memory_engine and wrote
    select '<@=result@>' from dual;
    even this wont work for me :(
    Anyone pls help me in this...
    Thanks in advance
    Pavan

    Hi Phani,
    Thanks for the reply. I resolved this. The mistake is I wrote java code in a class,in main function. I removed class and main function. Now I am able to capture value into Odi variable...
    I modified code as
    <@
    import java.io.*;
    import java.util.zip.*;
         long result;
    FileInputStream fis = new FileInputStream(new File("C:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result=cis.getChecksum().getValue();
    @>
    finally retrieving result value from dual
    select '<@=result@> from dual
    Edited by: 908443 on Jan 16, 2012 10:42 PM

  • Mapping proc output to vars gets error extracting result into a variable of type (DBTYPE_UI2)

    Hi, we run std 2012.  I have a proc (sets nocount on) whose params r shown in the first block .   My execute ssis sql task mapping is shown in the block following that (same order as shown, the param sizes are all -1).  The variable
    characteristics and initial values are shown in the 3rd block.  The execute sql task command is
    exec usp_fileArrivalStatus ?,?,?,?,?,? output,? output,? output
    when I run the proc in ssms followed by a select on the output fields, I get stat 0, instance id -1 and file name empty string (aka tick tick aka '')
    The error is:
    [Execute SQL Task] Error: Executing the query "exec usp_fileArrivalStatus ?,?,?,?,?,? output,? ou..." failed with the following error:
    "An error occurred while extracting the result into a variable of type (DBTYPE_UI2)".
    Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Does anybody know what is wrong?
    CREATE PROCEDURE [dbo].[usp_fileArrivalStatus] @NewFilePattern varchar(500),
    @PkgName varchar (257),
    @appid int,
    @MsgHistCreateDate date,
    @messageFriendlyName varchar(500),
    @arrivalStatus int output,
    @instanceId bigint output,
    @fileName varchar(500) output
    VariableName Direction DataType ParamName
    User::TranFilePattern Input VARCHAR 0
    System::PackageName Input VARCHAR 1
    User::AppID Input SHORT 2
    User::todaysDate Input DATE 3
    User::TranFileArriveStatus OUTPUT SHORT 5
    User::TranFileInstanceId OUTPUT LARGE_INTEGER 6
    User::TranFileName OUTPUT VARCHAR 7
    User::TranFileFriendlyName Input VARCHAR 4
    User::TranFilePattern,string,tranfile05-Nov-2014
    User::fileDate,string,05-Nov-2014
    System::PackageName,
    User::AppID,int32,12
    User::todaysDate,DateTime, set by select getdate()
    User::TranFileArriveStatus,int32,0
    User::TranFileInstanceId,Int64,0
    User::TranFileName,string
    User::TranFileFriendlyName,string,Tran File

    I may have gotten past this.  The ui showed the first execution of that proc as the aborting component but when I looked at my error code (-1073548784), and component name in the
    message sent with notification email, I noticed the second component name.  It too executes that proc and still had ushort for appid in sql task mapping and long for instance id.  I changed these characteristics to match what I posted and got green
    on the seq container that runs both.
    I think I go thru this kind of adventure every time I try to map proc output to ssis vars.   

  • How to use ODI procedures into a ODI variable

    Hi,
    I have the below condition
    select c1 from table where c1>#ODIVAR1 and use the output of this query in a variable to define the package flow
    If output=0 package flow goes as XXX
    else
    flow goes as YYY.
    So please suggest how to use a ODI variable to capture the procedures putput and use it in package flow in this case.
    Thanks,
    Naveen.

    Step1 . Refresh the variable in the package, which have this query select c1 from table where c1>#ODIVAR1
    Step2. Evaluate above variable (operator = , value 0 )
    Step 3. If true Package flow xxx , else false yyy
    Please close the thread once you get the required flow.

  • Get query into a variable

    Hi,
    See attached code.
    Now, when you would run this query (and if you've turned your
    CF debugger on), you would see the following in your browser under
    your SQL Queries section:
    select id_product, product_name
    from tbl_product
    where id_supplier in (1,2,3)
    and is_ordered_by = 'Telephone'
    In other words you can see what the query has processed
    exactly.
    Now, this is just a simple query that I took as an example.
    What I want to do is NOT to execute the CFQUERY.
    Instead, I want to store the processed part of the query i.e.
    select id_product, product_name
    from tbl_product
    where id_supplier in (1,2,3)
    and is_ordered_by = 'Telephone'
    into a variable.
    Is this possible?
    I've tried doing the following:
    <cfset querypart = "select id_product, product_name from
    tbl_product where id_supplier in (" & variables.supplierIDs
    & ") " & <CFIF variables.isElectronic eq 1>"and
    is_ordered_by = 'Electronic'"<CFELSE>"and is_ordered_by =
    'Telephone'"</CFIF>>
    But it's giving me an error "<".
    It's as if it can't process the <CFIF> inside the
    <cfset>
    Please advise.
    Thanks and regards,
    Yogesh Mahadnac

    You could set a session variable to the results of your
    query, then use that session variable as if it were a query:
    <!--- Query products --->
    <cfquery name="qProduct" datasource="db1">
    select id_product, product_name
    from tbl_product
    where id_supplier in (#variables.supplierIDs#)
    <cfif variables.isElectronic eq 1>
    and is_ordered_by = 'Electronic'
    <cfelse>
    and is_ordered_by = 'Telephone'
    </cfif>
    </cfquery>
    <!--- set session variable equal to query results --->
    <cfset session.querypart = qProduct>
    <!--- now list your "query" results using your session
    variable--->
    <cfoutput query="session.querypart ">
    #id_product# #product_name# <br>
    </cfoutput>
    Of course, once you use your results, you should set your
    session variable to NULL to clear the query.
    <cfset session.querypart = "">
    <edit> I believe that I misread your post, and thought
    that you wanted to store the result of your query, not the query
    itself.</edit>
    Phil

  • How to store the File Name from a Unix Directory into a ODI variable?

    Hi,
    I have built a ODI package with the following steps:
    1. ODI is polling for a flat file in a Unix directory. I have used OdiFileWait tool for this purpose. Here the file name is not fixed, so I am using wild character (*) to poll for file. Example: DF*ABC1*.DAT where the first wild character denotes 1 letter and the second wild character denotes 2 digits.
    2. In the second step, if the file is found, I am moving the file to ODI file server path (../oracledi/demo/file). Here I have used ODIFileMove tool.
    3. Then I am using an ODI Interface to Load the file data into a Oracle database table.
    4. I am using a Process log table to keep the log for each step I am executing in ODI that is ODIFileWait, ODIFileMove, Interface etc. for each file. In this table a row needs to be inserted after ODIFileWait tool gets the file, with the File Name and File Date. Later on this row will be updated as the consequent steps are executed.
    Here is my concern, I need to get the exact File Name of the file after ODIFileWait gets the file and I need to insert that in the Process Log table after the ODIFileWait step gets a file. So if I can store the File Name in a ODI Variable, I can insert it into the Process log table at this point. This I am not able to do.
    The files are coming in a different directory (not in ODI file server path), So after getting the file it is moved to ODI file server path (../oracledi/demo/file)
    The Files which I am processing are fixed length format. Also, the File name and File Date is stored in the 1st Record(Header record) of the files.
    Kindly provide me suggestions to implement this in my code.
    Thanks and Regards,
    Anik
    Edited by: 809820 on Nov 10, 2010 11:36 PM

    Look at this link -http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory
    change the command to fetch the ls command and write into File and then using either java or jython break the data and fetch the file name and date and insert into log table.
    (or)
    you can use the os.system command and get the complete ls command into string and then process and insert it.
    Let us know if you need any other help.

  • How to output a query results into a text file

    How to output a query results into a text file instead of outputing it to the screen..
    is there a way for us to write a SQL query which specifies to output the query results to a text file.
    Pls let me know how to do it
    Thanking u in advance
    regards
    Muraly

    Muraly,
    If you are using SQL*Plus 8.1.6 or later, you can also spool output to a file in HTML format, eg
    SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON
    SPOOL c:\temp\report.html
    SELECT DEPARTMENT_NAME, CITY
    FROM EMP_DETAILS_VIEW
    WHERE SALARY>12000;
    SPOOL OFF
    SET MARKUP HTML ENTMAP OFF
    In iSQL*Plus 9.0.1 (the browser-based interface to SQL*Plus) onwards, you can also send the HTML output to a new web browser window, or an html file -- much easier than the command line method.
    Alison

  • HOW TO CALL A PACKAGE VARIABLE INTO ODI

    Hi,
    Please help me with a solution for capturing a variable from a package into odi. I have seen the solution given by cezar in odiexperts.com but we are not looking for a package creation thru odi. Please suggest any other method.
    Thanks
    Venkat

    Pass it to the SP as a variable
    - there are examples in the cf docs

Maybe you are looking for

  • Runtime.exec() - how to open new window for new program?

    Hi, I have searched through the forums but haven't found an answer to this one yet. I am using runtime.exec() to start up a new java program. At first I thought it wasn't running properly but, after checking task manager, I have discovered that the n

  • How can I delete an old icloud address I cannot access?

    My new iphone has signed me in to an old icloud account that I do not know the security settings for, and I cannot access the email address it is linked to. How can I get rid of it?!?! Can Apple delete it for me?

  • Need help in unix regular expressions

    Hi All, I'm new to shell scripting. Please help me in achieving this I am trying to a find regular expression that need to pick a file with begin with the below format and mask variable is called in xml file. currently the script accepts: mask="CLIEN

  • Trying to buy in app purchase but says it cannot be completed

    Bought in game purchase this morning I've tried to do it again but now it says could not complete and refers me to support page

  • Acrobat 11.0.7 Fails to Update on Windows 7

    Have Acrobat Pro Education Edition.  Recent update resulted in error 1321.  Resolved this error only to have error 1603 Fatal Error on Installation appear. Tried "Installation Repair", and deleted temp files. Still the installation fails. Cannot dele