Dynamic Resource Name in  DataStore

Hi,
I have situation like this, i need to generate dynamic filename based on the input date passed. For example i have package with following steps
1. inputDate - inputParameter to the interface
2.vFileName - name of the output file generated by the Interface
3. Interface - business logic interface
The Target Data Store for interface is GENERIC_FILE_TEST. The output file needs to be changed based on input date.
May be i could use evaluate variable. Not sure about the right syntax.
Theoritically the logic would
be
if(inputDate=xx)
vFilename==zzz;
else
vFileName=vvcv;
and then use vFileName in resource name field of Target Data Store.
Appreciate providing correct syntax/technique.
Thanks

Hi,
let me suggest something....
1 - at package, receive the parameter in the variable (named inputDate for instance)
2 - write an sql query that solves what you need, like, in a oracle example: (the variable refers to itself)
select case when #inputDate=xx
then zzz
else vvcv
end
from dual
3 - after the step 1 at package, just add the variable again in refresh mode
4 - execute the interface.
Make any sense?
Cezar Santos
http://odiexperts.com

Similar Messages

  • Dynamic Resource name for Excel/csv files

    Hi All,
    Reading from a source excel (as well as csv) file, I tried passing the resource name via a variable which is set to contain the name of the file (refresh). However, on execution, the file name shows up with an additional "\" character without being specified in the variable text causing the interface to face on load step.
    The error says:
    ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection <ConnNameHere>.
    Caused By: java.sql.SQLException: ODI-40438: File not found: C:\DirectoryNameHere\ /OTD.
    Is this expected behavior where one needs to escape the special character?
    I've verified that the extra / is not present in either the variable value or the directory for the Physical Schema.
    TIA.

    http://youtu.be/-QMV6cElgsk
    http://youtu.be/V7OzzZ3kYdc
    http://youtu.be/hNqqbZ4sJWA
    http://youtu.be/TMHzhtEwgrA
    http://youtu.be/REJDi584jh8
    http://youtu.be/jE6k5OfWqi0
    http://youtu.be/P3EKyykseps
    http://youtu.be/-QMV6cElgsk
    http://youtu.be/Gl7YvZohVVA
    http://youtu.be/zb1ue5BP9mI
    http://youtu.be/NhPDcc8n4VU
    http://youtu.be/tD_kw5QXmps

  • Issue using variable in Datastore Resource Name

    I am trying to use a variable - let's call it MyVar - in the resources name of a datastore as the value for a database link that is dynamically generated.
    Let's say I have a hypothetical table called MyTable that may exist in multiple databases and in the Resource Name field of the DataStore definition I have the following syntax: MyTable@#GLOBAL.MyVar
    So I would assume that if the value of MyVar is 'DBLINK' then the end result would be that it would resolve to MyTable@DBLINK
    The issue is that when it is used in an interface where I am trying to create a view from this datastore I get an error because it puts the following value in the FROM clause: "MyTable@#MyVar" . It resolves to that exact value with quotes and all and doesn't resolve the variable name. My question is why is the variable not being replaced with the correct value and also why is it putting quotes around the Resource Name value when using it in an interface.

    Can you try to change the variable name and put it in upper case as well ? Same thing for your table if possible.
    I guess you're using 10g. It's a good practice to always use upper case for your variables because 11g only allows upper case.

  • Datastore Resource Name Variable

    Hello Experts,
    In the past, we have successfully implemented the use of a variable name inside the resource name of a Datastore to dynamically change the name of the table. This technique has been always useful to loop through a set of files assigning the name of the file to a variable and then using this value within the resource name of a Datastore.
    When trying to implement the same technique in ODI 11g, it looks like the value of the variable is not being use by ODI when executing the package. When I look at the execution code the FROM clause is using the name of the variable instead of the value assigned to that variable IE:
    select *
    from #NameOfVariable
    Is this a known issue in 11g? or is there a new way to implement variables for Datastore resource names?.
    The variable that i'm using has been set to Alphanumeric type and I'm assigning a static value inside my ODI package.
    Thanks for your help.
    Pablo C.

    better you can store all the resource names into one db table after that with helping of the refresh variable u can get file name one by one ,better declare a loop for this dynamic variable.
    if you have any doubts please revert back this.
    Regards,
    sh

  • Reg: Dynamic  Queue name

    Hello Experts,
    Although I am not  a PI expert i would like to ask ,
    Can I have Dynamic Queue name generation on the basis of the payload which i am receiving
    Quality of service my be any EO or EOIO .
    For example My pay load stream my contain  Data for Purchase Req. Creation   / and change its a known fact that Creation payload should come first and then change so my Question is can i have my queue name on basis of the Document which i am processing ?

    I dont thnik this is possible in PI for generating queue names based on payload. As Queue should be utilized proper way and based on the PI resources like work processes,.
    But for your scenario, you can use EOIO and specify queue name accordingly for both scenarios.
    And you can do Queue prioritization to assure the creation payload followed by change payload.
    --Divyesh

  • Dynamic file name from input payload (RFC 2 flat file)

    Hi,
    I have an RFC to flat file scenario. The output flat file has not an XML structure, it's just a plain text file generated with abap mapping.
    In my source interface (RFC), I have a field called <FILENAME>, I want to use the value of that field to create the target file using dynamic file name. But if  in variable substitution I use payload:ZRFC_NAME,1,FILENAME,1 It doesn't work because the dynamic variable substitution try to access to output payload, not the source one...
    What can I do?

    Hi Marshal,
           You can add a extra node to your target strucutre like
    FileName- Node
    --FileName - Element.
    do the mapping from the field filename of RFC to FileName field in u r target strucure. And use this  field path at Refrence in variable subtituion.
    In the Content converison add the Name & Values as below
    FileName.fileldNames -- FileName
    FileName.fieldFixedLengths -- 0
    FileName.fixedLengthTooShortHandling -- Cut
    So the extra field in u r target structure would not populate in u r target text file.
    Cheers
    Veera

  • Old visa open, error code 1073807343, using VISA with a GPIB device, and VISA resource names

    Hi everyone,
    I'm trying to get a SRS model SR720 LCR meter (manual on this page) working with LabView, connecting it to my PC with an Agilent 82357A GPIB/USB interface (manual on this page). I'm running MAX version 14.0, and NI-VISA version 14.0. I'm running LabView version 13.0f2, 32 bit.
    I followed the directions on this page, and I'm pretty confident I can communicate with my LCR meter, because I can go to NI MAX->GPIB0::17::INSTR under "devices and interfaces", then go to the VISA test panel, go to the I/O tab, and I can enter a few commands from the SR720 manual, like changing the frequency, and I see the light on the LCR meter change to what I just told it to do. Here is a picture, just to illustrate it:
    Also, if I do the *IDN? command, it returns "
    9: Write Operation (*IDN?)
    Return Count: 5 bytes
    10: Read Operation
    Return Count: 41 bytes
    StanfordResearchSystems,SR720,08087,1.03\n
     So, that's good too. I also made the alias of this device "MyLCRmeter", but that shouldn't matter for now.
    Now I'm trying to get it to work in a more usable way. The SR7xx drivers that LabView found for me came with a couple sample programs, one called "Getting Started.vi". I tried to just simply see if it worked, changing the "instrument descriptor" field to "GPIB0::17::INSTR", since that's the one that seemed to be the right device in MAX. Here is a picture of the front panel of "Getting Started.vi":
    Trying to run it like this gave me this error (code -1073807343):
    Old VISA Open in SR715/720 Initialize.vi->SR715/720 Getting Started.vi
    Doing a bit of searching on these forums, I found these few threads (1 2 3), which seem to tell me that, since this program was written, the way you open VISA has changed. In the 2nd of those links, one guy said:
    You just have to replace the Old VISA Open function with the VISA Open that is on the Instrument I/O>VISA>VISA Advanced palette. When you do that, the wire to the string that was used for the resource name will be broken. Delete the string and make the actual VISA Resource Name visible on the front panel. Wire the VISA Resource Name control to the connector pane where the string control was (upper left connection).
    So, I went into the sub-VI Initialize.vi, and did that. Here is a picture of what the front panel and block diagram of the sub-VI Initialize2.vi (I changed the name in case I screwed things up, but I'm pretty sure the new one is the one being called by Getting Started.vi) looked like before I changed anything (you can see the Old VISA Open):
    and here it is after replacing that with the regular VISA Open, deleting the instrument descriptor string and replacing it with a VISA resource, and connecting that to the VISA Open:
    However, as you can see in the image above, and it seems like someone else had this problem in the 2nd thread linked above, I don't see my device listed in the drop-down menu (even if I refresh), only "LPT1" (I don't even know what that is):
    No, I wasnt able to select the visa resource from the pull down menu. somehow it seems disabled or something.
     If I just enter the VISA resource name from MAX manually, GPIB0::17::INSTR, and save and try running that, I get the error(code -1073807346):
    VISA Open in SR715/720 Initialize2.vi->SR715/720 Getting Started.vi
    So I'm not sure where to go from there, or why it's not in the drop down menu to begin with. I'm sorry if I've missed something but I've searched about as far as I can go. If I had to guess, maybe one thing could be that in MAX, under Tools->NI-VISA->VISA Options->My System->Conflict manager, I have both Agilent VISA and NI VISA enabled; I know sometimes problems arise from conflicts between different software fighting over the same hardware. Is this okay, or do I need to change it?
    Thank you and please let me know if there is any other code/screenshots I could provide that could help!

    Hi, I did indeed enable NiVisaTulip.dll under MAX->Tools->NI-VISA->VISA Options->My system->Passports->List of passports. Sorry, I should have mentioned that explicitly.
    By install as primary, do you just mean as it is here, where it is selected as the "Preferred VISA"?
    Or somewhere else? I installed NI-VISA first I believe, and then the Agilent one, and during the installation of the Agilent one, I'm pretty sure I made it not the primary. Here's what I have in the Agilent (it's called Keysight now) Connection Expert software:
    I also have this under the "Keysight 488 options" tab:
    Should that be checked? I don't actually know the role of VISA vs 488 here...
    What could I try?
    Thank you!

  • How to change recordset bahaviour to accept dynamic column names in the where clause

    Hi
    im using php-mysql and i make a recordset and i want to make the column names in the where clause to be dynamic like
    "select id,name from mytable where $tablename-$myvar";
    but when i do this my i break the recordset and it disappear
    and when i use variables from advanced recordset it only dynamic for the value of the column not for the column name
    and when i write the column name to dynamic as above by hand it truns a red exclamation mark on the server behaviour panel
    so i think the only way is to change the recordset behaviour is it? if so How to make it accept dynamic column names?
    thanks in advance.

    As bregent has already explained to you, customizing the recordset code will result in Dreamweaver no longer recognizing the server behavior. This isn't a problem, but it does mean that you need to lay out your dynamic text with the Bindings panel before making any changes. Once you have changed the recordset code, the Bindings panel will no longer recognize the recordset fields.
    Using a variable to choose a column name is quite simple, but you need to take some security measures to ensure that the value passed through the query string isn't attempting SQL injection. An effective way of doing this is to create an array of acceptable column names, and check that the value matches.
    // create array of acceptable values
    $valid = array('column_name1', 'column_name2', 'column_name3');
    // if the query string contains an acceptable column name, use it
    if (isset($_GET['colname']) && in_array($_GET['colname'], $valid)) {
      $col = $GET['colname'];
    } else {
      // set a default value if the submitted one was invalid
      $col = 'column_name1'
    You can then use $col directly in the SQL query.

  • How to retrieve resource name in JSP page

    Hello,
    I have the following scenario:
    User wants a new resource to be provisioned to himself, he makes standard steps; chooses one resource from the list of available resources and sends a request. After that a summary page is displayed - my goal is to create an url to external application on that summary page (i.e. tjspRequestSubmitTiles.jsp) that should be displayed depending on the name of the resource, e.g. if user requests for a ResourceA - link appears, but when he requests for a ResourceB - link does not appear.
    So far I have created a link with a sample if statement - it works.
    My problem is how to make a real condition - retrieve the resource name that request deals with. Anybody know how to do that, which API to use etc.?
    Regards,
    Maciej.

    After adding the code to tjspProvideDataShowInfoTiles.jsp file, nothing has been improved, I am still facing the same result (on the console):
    RO: null
    It seems that file (tjspProvideDataShowInfoTiles.jsp) does not take part in the process.
    I have tried to pass some sample session attribute in tjspRequestVerificationTiles.jsp and this works, but I do not know how to retrieve resourceName in this file.
    I was trying to make some code retrieving resourceName in tjspRequestSubmitTiles.jsp, e.g.
    tcRequestWizardForm tcReqWizForm = (tcRequestWizardForm)session.getAttribute(requestWizardForm);
    String requestID = tcreqWizForm.getRequestID();
    ...and what to do now to retrieve resourceName?

  • Printing Resource Name Form View

    Hi there,
    I am using Project 2013 Professional on SP1 with all the updates applied.
    I am trying to print the resource name form so I can give all the business users involved in the project a list of thier tasks, when they are due, and how much effort is expected of them.
    I get the view fine.
    I then go +File +Print and get the print page but there is a message saying "Print is not currently available". I tried printing anyway, but as expected nothing happens.
    I can print some views but not others so it is not a generic printing issue, but seems to be related to not being able to print particular views.
    Has anyone experienced the same issue? Is there a fix? Am I doing something wrong?
    Thanks in advance
    Tony

    Backwardsit --
    Yup, I am experienced the same problem as you.  I cannot print the Resource Name Form view in Microsoft Project 2013, SP1.  If it were me, I would customize the Resource Usage view with the columns you want to print (such as Start, Finish, and
    Work) and then print the Resource Usage view.  Just a thought.  Hope this helps.
    Dale A. Howard [MVP]

  • Saving result from sp_executesql into a variable and using dynamic column name - getting error "Error converting data type varchar to numeric"

    Im getting an error when running a procedure that includes this code.
    I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql
    DECLARE @retval AS DECIMAL(12,2)
    DECLARE @MonthVal VARCHAR(20), @SpreadKeyVal INT
    DECLARE @sqlcmd AS NVARCHAR(150)
    DECLARE @paramdef NVARCHAR(150)
    SET @MonthVal = 'Month' + CAST(@MonthNumber AS VARCHAR(2) );
    SET @SpreadKeyVal = @SpreadKey; --CAST(@SpreadKey AS VARCHAR(10) );
    SET @sqlcmd = N' SELECT @retvalout = @MonthVal FROM dbo.CourseSpread WHERE CourseSpreadId = @SpreadKeyVal';
    SET @paramdef = N'@MonthVal VARCHAR(20), @SpreadKeyVal INT, @retvalout DECIMAL(12,2) OUTPUT'
    --default
    SET @retval = 0.0;
    EXECUTE sys.sp_executesql @sqlcmd,@paramdef, @MonthVal = 'Month4',@SpreadKeyVal = 1, @retvalout = @retval OUTPUT;
    SELECT @retval
    DECLARE @return_value DECIMAL(12,2)
    EXEC @return_value = [dbo].[GetSpreadValueByMonthNumber]
    @SpreadKey = 1,
    @MonthNumber = 4
    SELECT 'Return Value' = @return_value
    Msg 8114, Level 16, State 5, Line 1
    Error converting data type varchar to numeric.

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql <<
    This is so very, very wrong! A column is an attribute of an entity. The idea that you are so screwed up that you have no idea if you want
    the shoe size, the phone number or something else at run time of this entity. 
    In Software Engineering we have a principle called cohesion that says a model should do one and only one task, have one and only one entry point, and one and only one exit point. 
    Hey, on a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, your mindset is that level of sillyity and absurdity. 
    Do you know that SQL is a declarative language? This family of languages does not use local variables! 
    Now think about “month_val” and what it means. A month is a temporal unit of measurement, so this is as silly as saying “liter_val” in your code. Why did you use “sp_” on a procedure? It has special meaning in T-SQL.  
    Think about how silly this is: 
     SET @month_val = 'Month' + CAST(@month_nbr AS VARCHAR(2));
    We do not do display formatting in a query. This is a violation of at the tiered architecture principle. We have a presentation layer. But more than that, the INTERVAL temporal data type is a {year-month} and never just a month. This is fundamental. 
    We need to see the DDL so we can re-write this mess. Want to fix it or not?
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • The specified resource name cannot be found in the image file.

    Dear Experts,
    I have developed an import too and it imports many of the Business Objects from a temporary data base to SAP B1. It was running fine for more than 6 months now.
    Currently when the Tool is importing Credit Notes in to SAP B1, the following error is thrown.
    The specified resource name cannot be found in the image file.
    And I have no Clue about the error. Any one had any experience regarding the above error???
    Thanks in Advance,
    Vasu Natari.

    Hello VAsu,
    Somethimes this unexpected, ununderstandable eroor messages caused by corrupted observer dll.
    Do a clean up (delete %TEMP%SM_OBS_DLL) folder, and see the result ! (i had several issues in the past with some strange messages...)
    Regards
    János

  • ActiveSync Input Form -- To take AD Resource name from Database column

    Hi All,
    My authorative source is a database table called dbTable.
    I am using an input form to provision into Active Directory. The Active Directory resource name is stored in a dbTable column. I first tried to hardcode the name of AD and do the provisioning, it worked. But wen I tried to take the name of the AD from my dbTable column using
    <Field name='waveset.resources'>
    <Comments>Add the AD account user inducted.</Comments>
    <Expansion>
    <block trace='true'>
    <filterdup>
    <appendAll>
    <ref>waveset.resources</ref>
    <list>
    <ref>activeSync.resourceNm</ref>
    </list>
    </appendAll>
    </filterdup>
    </block>
    </Expansion>
    <Disable>
    <block trace='true'>
    <neq>
    <ref>feedOp</ref>
    <s>create</s>
    </neq>
    </block>
    </Disable>
    </Field>
    It didnt work.
    Plz, can anyone tell me how to bring the name of the AD resource in my input form for provisioning into that AD.
    I need help. Plz treat it as urgent coz i can't move further without this being solved.

    Hello, first try to trace the value, using <ref>activeSync.resourceName</ref> should work,
    also read the example in Identity Manager documentation (PDFs) called: "Example: Disabling Accounts through ActiveSync Capable Adapters"
    Regards,
    Edgar Torres

  • How to set dynamic table name in sql query?

    I want set dynamic table name by parameter in sql query,just like:
    select * from :tbname
    but run report is error,BI P report table name is invalidation.
    What can i do? Thanks!

    Hi,
    that's only possible inside a data template with a lexical parameter.
    Regards
    Rainer

  • Problem with Dynamic Table Name

    Hello all,
    I am having trouble using a dynamic table name. I have the following code.....
    declare l_cur sys_refcursor;
    l_ID int;
    l_tableName varchar(30);
    BEGIN
    open l_cur for
    select hkc.ColumnID, mapping from &HKAPPDB_Schema_Name..doctablemapping ddm
    inner join &HKDB_Schema_Name..HKColumns hkc on hkc.doctablemappingid = ddm.id
    where ddm.id > 0;
    LOOP
         FETCH l_cur into l_ID, l_tableName;
         EXIT WHEN l_cur%notfound;
         -- update missing VerbID in DocumentDocMapping table
         UPDATE &HKAPPDB_Schema_Name..IndexedDocument
         SET VerbID = (SELECT t.VerbID
                             FROM (SELECT DocRef, VerbID, DateUpdated
                                  FROM &HKAPPDB_Schema_Name..l_tableName dd        - this is where the dynamic table name is used
                                  WHERE dd.VerbID is not NULL))
         WHERE HKColumnID = l_ID AND VerbID is NULL;
    END loop;
    end;
    /When I try to execute this i get an error
    ORA-00942: table or view does not exist
    What am I doing wrong?
    Regards,
    Toby

    redeye wrote:
    I only started about 6 weeks ago, with no tutorials and learning it on the fly; Same here.. only my introduction was to a 12 node Oracle OPS cluster all those years ago.. and required a whole new mind set after using SQL-Server extensively. But it was fun. Still is. :-)
    but thats what you get when a company throws you in at the deep end with a ridiculous time constraint to migrate a whole MSSQL DB.Migrating SQL-Server to Oracle is not a simple thing. A lot of best practices in SQL-Server are absolutely worse practices in Oracle - they are that different. Simple example is lock escalation - an issue in SQL-Server. In Oracle, the concept of a lock being escalated into a page lock simply does not exist.
    In terms of getting the migration done as quickly and painlessly as possible I try to reuse all the logic as it appears in the MSSQL code - in this case it was using dynamic table names. I do not doubt that i am probably shooting myself in the foot in the long run.....As long as you do not splatter too much blood on us here.. not a problem :D
    Seriously though - just keep in mind that what works in SQL-Server may not work as well (or even at all) in Oracle. So do not hesitate to refactor (from design to code to SQL) mercilessly when you think it is warranted.

Maybe you are looking for