How to call variable which name is stored in a temporary table...

Hi there!
Got a simple (?) question. I want to make an allocation like that:
n#.temp_z1  := temp#; with the only Problem that the name of the variable is stored in another variable or a temporary table:
temp#(1) := temp_z1; at the moment I have absolutly no idea how to resolve this Problem =( Need something like that (which don't work):
n#.temp#(1)  := temp#; anybody there who could help me? Thanks in advance

I think with dynamic SQL it won't work. Isn't there any solution just to handle this simple problem? =(
ok, some more details to my Program:
I have a table named "NN2_input" which will be filled dynamically. For the filling, a start and a finish number are given, and for every number between this, 3 columns will be created. Looks like that:
min = 3; max = 5;
=> Columns:
Z3_Gas, Z3_Dauer, Z3_Temp, Z4_Gas, Z4_Dauer, Z4_Temp, Z5_Gas, Z5_Dauer, Z5_Temp
after the structure of the table is given, it should be filled. To see which columns are given, I select them in a temporary table:
CREATE OR REPLACE PROCEDURE nn2_input_filling is
   type tab is table of VARCHAR2(15);
   gas#    tab;
   dauer#  tab;
   out#    tab;    
BEGIN
   SELECT column_name BULK COLLECT INTO dauer# FROM sys.user_tab_columns
     WHERE table_name = 'NN2_INPUT' AND SubStr(column_name,4,5) = 'DAUER' ORDER BY column_name;
   SELECT column_name BULK COLLECT INTO gas# FROM sys.user_tab_columns
     WHERE table_name = 'NN2_INPUT' AND SubStr(column_name,4,3) = 'GAS' ORDER BY column_name;
   SELECT column_name BULK COLLECT INTO out# FROM sys.user_tab_columns -- gibt auch ein Z7_OUT2 zurück o.O
     WHERE table_name = 'NN2_INPUT' AND SubStr(column_name,4,3) = 'OUT' ORDER BY column_name;
END;to fill this table, I must assign each field with this value. And that's where my Problem occurs...
so I know all of the columns except the Numbers...

Similar Messages

  • How to call a schema name using substitution name?

    Hi All,
    How to call a schema name using substitution menthod in odi?
    I was trying but I got the following error..
    ODI-1227: Task XXX(Procedure) fails on the source ORACLE connection YYY.
    Caused By: java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    Here xxx procedurename.
    yyy-schemaname
    Please do the needful..
    Thanking you in Advance.
    Regards,
    PP

      1  declare
      2  sql_string varchar2(2000);
      3  begin
      4  sql_string := 'select ' || func_name || ' into a from dual ';
      5  execute immediate sql_string;
      6* end;
    SQL> /
    sql_string := 'select ' || func_name || ' into a from dual ';
    ERROR at line 4:
    ORA-06550: line 4, column 28:
    PLS-00201: identifier 'FUNC_NAME' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
      1  declare
      2  sql_string varchar2(2000);
      3  func_name varchar2(30);
      4  begin
      5  func_name := 'some_func';
      6  sql_string := 'select ' || func_name || ' into a from dual ';
      7  execute immediate sql_string;
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00904: "SOME_FUNC": invalid identifier
    ORA-06512: at line 7
    SQL> desc some_func;
    ERROR:
    ORA-04043: object some_func does not exist
      1  create or replace function test_func
      2       return number
      3       is
      4       begin
      5          return 0;
      6*      end;
    SQL> /
    Function created.
      1  declare
      2  sql_string varchar2(2000);
      3  func_name varchar2(30);
      4  begin
      5  func_name := 'test_func';
      6  sql_string := 'select ' || func_name || ' into a from dual ';
      7  execute immediate sql_string;
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at line 7
    SQL> Set serveroutput on
      1   declare
      2   sql_string varchar2(2000);
      3   func_name varchar2(30);
      4   return_value number;
      5   begin
      6   func_name := 'test_func';
      7   sql_string := 'select ' || func_name || ' from dual ';
      8   execute immediate sql_string into return_value;
      9   dbms_output.put_line(return_value);
    10* end;
    SQL> /
    0
    PL/SQL procedure successfully completed.Hope that helps.
    Regards
    Raj

  • How can I check which documents are stored on iCloud?

    How can I check which documents are stored on iCloud?

    Welcome to the Apple Community.
    You can see in a number of ways, the easiest is probably by logging into your account at ...
    iCloud.com
    on your computer.

  • How to call a idoc in abap program and updates catsdb table

    how to call a idoc in abap program and updates catsdb table
    thank you,
    Jagrut BharatKumar Shukla

    Hi Kishan,
    You can refer to following help document,
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
    Regards,
    Meera

  • How to call & pass values to custom page from seeded page table region

    Hi All,
    can anyone tell me how to call & pass values to custom page from seeded page table region(Attribute is not available in seeded page VO)
    it is urgent. plssss
    Regards,
    purna

    Hi,
    Yes, we do this by extending controller, but you can also try this without extending controller.
    1. Create Submit Button on TableRN using personalization.
    2. Set "Destination URI" property to like below
    OA.jsp?page=/<yourname>/oracle/apps/ak/employee/webui/EmpDetailsPG&employeeNumber={@EmployeeId}&employeeName={@EmployeeName}&retainAM=Y&addBreadCrumb=Y
    Give your custom page path instead of EmpDetailsPG.
    EmployeeId and EmployeeName are VO attributes(Table Region)
    If you dont have desired attribute in VO, then write logic in your custom page controller to get required value using parameters passed from URL path.
    In this case, only personalization will do our job. Hope it helps.
    Thanks,
    Venkat Y.

  • How to call a function name stored in a a variable

    I am trying to call a function in a stored procedure based on the contents of a variable returned from a select statement. I have tried using:
    funcCall := 'SELECT ' || BRName || ' INTO bOut FROM DUAL';
    EXECUTE immediate funcCall;
    where BRName is the name of the function in the package I want to call and bOut is the boolean reutn from the function. Am I way off base in doing this like this?
    I am getting an invalid identifier error. Any help would be appreciated.

      1  declare
      2  sql_string varchar2(2000);
      3  begin
      4  sql_string := 'select ' || func_name || ' into a from dual ';
      5  execute immediate sql_string;
      6* end;
    SQL> /
    sql_string := 'select ' || func_name || ' into a from dual ';
    ERROR at line 4:
    ORA-06550: line 4, column 28:
    PLS-00201: identifier 'FUNC_NAME' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
      1  declare
      2  sql_string varchar2(2000);
      3  func_name varchar2(30);
      4  begin
      5  func_name := 'some_func';
      6  sql_string := 'select ' || func_name || ' into a from dual ';
      7  execute immediate sql_string;
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00904: "SOME_FUNC": invalid identifier
    ORA-06512: at line 7
    SQL> desc some_func;
    ERROR:
    ORA-04043: object some_func does not exist
      1  create or replace function test_func
      2       return number
      3       is
      4       begin
      5          return 0;
      6*      end;
    SQL> /
    Function created.
      1  declare
      2  sql_string varchar2(2000);
      3  func_name varchar2(30);
      4  begin
      5  func_name := 'test_func';
      6  sql_string := 'select ' || func_name || ' into a from dual ';
      7  execute immediate sql_string;
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at line 7
    SQL> Set serveroutput on
      1   declare
      2   sql_string varchar2(2000);
      3   func_name varchar2(30);
      4   return_value number;
      5   begin
      6   func_name := 'test_func';
      7   sql_string := 'select ' || func_name || ' from dual ';
      8   execute immediate sql_string into return_value;
      9   dbms_output.put_line(return_value);
    10* end;
    SQL> /
    0
    PL/SQL procedure successfully completed.Hope that helps.
    Regards
    Raj

  • How to determine the schema name from stored function or procedure

    Hi all
    I need to find the way to determine the name of shema in which the given stored procedure residing. This SP is created with AUTHID CURRENT_USER what means that expression like SYS_CONTEXT('USERENV','CURRENT_USER') or SYS_CONTEXT('USERENV','CURRENT_SCHEMA') will be return the name of user or schema of user which calls given SP.
    can somebody help me?

    What is the problem you are trying to solve?
    Presumably, when you're creating a stored procedure, you know what schema owns it. So it's pretty trivial to simply create a local variable L_OWNER in your procedure, assign it the value of the schema owner, and then use that owner. Most people don't really need to figure out at runtime what they already knew at compile time.
    Barring that, you could inspect the data dictionary as user130038 suggested. That requires that you know the name of the procedure (which would likely also have to be a local variable that is initialized to a hard-coded value. And if there are multiple users that own procedures with the same name, it may not be reliable.
    Inspecting the call stack is the most reliable and dynamic approach. But it is also the most costly in terms or runtime performance and in terms of code complexity.
    Justin

  • How to call procedure (procedure name is in text)

    For example
    Table1 is table field1, field2 is Table1's fields. Data 'procedure1' is In Field2 (Field2 is varchar2).
    procedure1 is stored procedure's name
    How to call procedure1 that selected from Table1.
    Please help

    Tables don't have fields.
    You need to find a 3GL forum.
    Thank you.
    Sybrand Bakker
    Senior Oracle DBA

  • How to call variable SlideID

    Hi all,
    I recently started using the export function for captions for translating purpose. That´s when I first saw the variable "Slide ID". It´s apparantly not a default user or system variable but I would like to use the Slide ID as reference for bigger projects as it´s unique and doesn´t change unlike slide number. I´ve tried messing around with the available system variables, adding SlideID instead of SlideNumber and stuff like but no luck so far. Does anyone know how to call that particular variable?
    Any help is appreciated.
    Thanks,
    goldmundig

    Aside from using AS3 in a widget, I'm not sure how you could accomplish it.  If you're using AS3, you can access the movieXML variable off of the maintimeline and that XML has unique identifiers for the slides as well.  But that only helps you in widget scenarios.  Maybe you could concatenate the slide label with some static text for a meaningful unique ID?  Possibly create a variable for each slide and assign the value on slide entry?... probably more work than it's worth.  It would be nice to have the Slide ID exposed...
    Jim Leichliter

  • How can I filter which records are displayed in my dynamic table?

    I have what I think is probably an easy question for anyone
    who is experienced with PHP/MySQL and Dreamweaver (which I am not).
    I have a website where users login, and then have access to
    their homepage which displays a dynamic table of all of the records
    that they have inserted into a database (this page also has a link
    to the form where they submit a record). However, right now I can
    only get to display all records that have been inserted instead of
    only the ones that they have inserted (which is what I want). How
    can I accomplish this?
    I already have a session variable, 'MM_username', which
    allows me to bind the user_ID to anything I need to, and when a
    user inserts a record, their 'user_ID' is already inserted into a
    column in that record for that table, so I'd like to display the
    dynamic table in a way that filters it out so it only shows the
    records that match the logged-in user's 'user_ID'.
    I've tried to use the filter function in the recordset dialog
    box, nut I just can't get it to work correctly. Any help on this
    would be much appreciated!

    I already tried that. I set the table to filter out and
    display only the records that match the landlord ID to the session
    variable(which I named 'Landlord_ID' not 'MM_username ' like I said
    earlier). When I tried to simply insert the session variable into
    the page just to see what data would show up, the result is just a
    blank space, so the session variable itself apparently has no data
    value to echo in the PHP form.
    Because of that, I have no idea how to tell dreamweaver to
    filter based on the Landlord_ID, even though I CAN echo the
    landlord ID variable in the recordset, I can't figure out how to
    put that runtime value in the filter.

  • How to call a function, which name is stored in table?

    Dear members,
    I have a function with return number, and store its name in a table.
    now I want to select this function name from table and run it and return the value to a variable in my form.
    here is my code in when-button-pressed trigger.
    DECLARE
         v_value number;
         V_FUNC VARCHAR2(100);
         V_PARAM VARCHAR2(100);
    begin
         select FUNCTION_NAME, PARAM
         INTO V_FUNC, V_PARAM
         from function_table
         where id =1;
         message('V_FUNC='||V_FUNC); pause;
         v_value := v_func||';'; --run_tb_function;
         :text01 := v_value;
    end;this code gives the following error:
    ora-06502
    regards:
    Edited by: user2040934 on Feb 2, 2013 9:47 AM

    Below is the modified code:
    DECLARE
         v_value number;
         V_FUNC VARCHAR2(100);
         V_PARAM VARCHAR2(100);
    v_cmd varchar2(1000);
    begin
         select FUNCTION_NAME, PARAM
         INTO V_FUNC, V_PARAM
         from function_table
         where id =1;
    -- create a valuetable with one column vval varchar2 type
         v_cmd := 'declare val varchar2(100); Begin val := '||v_func||'; delete from valuetable; insert into valuetable(vval) values (v); commit; end;';
    forms_ddl(v_cmd);
    begin
    select vval into :text01 from valuetable where rownum = 1;
    exception
    when no_data_found then
    -- do your action....
    null;
    end;
    end;
    Edited by: user5213229 on Feb 2, 2013 4:33 PM

  • How to read variable file name into ODI

    Hello everyone,
    I apologize in advance if this has already been answered - I've done searches both on Google and this OTN area and have not found an answer to my query.
    I would like to do the following via ODI:
    1) rename a file in a specific directory
    2) process the file
    2) move the file to a backup directory
    3) rename the file again
    The file name is going to change everytime this process runs, as date is appended to it. I could create a variable with a system date in it and concatenate that into the filename before processing it, but I am not sure when they will run the ODI routine. Therefore, I would prefer to play it safe by doing something like a wildcard search in DOS.
    Example:
    Filename = TestFile12072010.csv
    I would like to:
    1) rename TestFile12072010.csv to TestFile.csv
    2) process the file
    3) move the file to another directory
    4) rename the file to TestFile<processdate>.csv
    I was hoping to do the first step using a DOS command that reads in TestFile*.csv. Note: I would expect there to be only 1 file with this naming convention and file extension in the directory.
    I have tried creating a stored procedure that uses the Operating System type, but it runs without stopping. I have also tried ODIFileCopy and OS Command. Obviously, I am doing something wrong since I am getting errors.
    Any guidance would be much appreciated! :)
    Thanks!
    -OS

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

  • How to Call variable value in OLEDB Command SSIS

    Hi ,
    I am facing one issue in SSIS OLEDB Command.under OLEDB Command there is sql update query
        UPDATE dbo.ArchiveBBxFbapp
        SET LatestVersion = 0
        WHERE BBxKey = ?
    dbo.ArchiveBBxFbapp is the name of the table, which I want to change by dynamically on fly.
    table name I am getting from variable .
    I want to take same variable value instead of hard coded table name in update statement.
    suggest me the correct command
    thanks and regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    For that you've to first store the query itself inside a variable after setting EvaluateAsExpression as true.
    Then use expression as below
    "UPDATE dbo." + @[User::TableName] +
    "SET LatestVersion = 0
    WHERE BBxKey = " + @[User::ColumnValue]
    Use option as SQL command from variable for data access mode property
    Then map the variable containing query above inside this OLEDB command.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to call the column names into the prompt and display values dynamically

    Hi,
    i have a typical requirement where I have to call 3 columns into the AGE Prompt (I know we can use the Column Selector to call the columns) .Below is the Screen Shot.
    !http://i46.tinypic.com/2qjfukh.jpg!
    2nd Requirement)
    The three columns I have are order Date, Ship Date and Entry Date.
    Whenever I click on Orderdate from the Prompt, It should dynamically show its values in the report.
    and When I click on the Ship Date from the Prompt, it should display the corresponding values in the report.
    and so on with the Entry Date.
    Can anybody help me how to acheive this.
    Thanks a ton.

    Ok so then you can use a fake column prompt. Here's one quick approach (nicer and cleaner with LOV tables but I don't if you have any of those).
    - Create a fresh prompt using any column you want.
    - Open the column formula using the fx button and replace the formula with 'abc'.
    - Use "SqL Results" as the "Show" option.
    - SQL:
    select case when 1=0 the Markets.Region else 'Order Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Ship Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Entry Date' from Paint.Markets
    - Set Variable = Presentation Variable = @{vPresVarSelectedDate}{Order Date}
    - Label = Date
    Then in the request, you change the column formula for the date. I'm going to make it short and just assume you called your time dimension alias(es) like the lowest grain:
    "@{vPresVarSelectedDate}{Order Date}"."@{vPresVarSelectedDate}{Order Date}"
    Cheers,
    C.

  • How to call function which has input parameter type??

    Hi all,
    I am facing problem while
    executing select ftest1(123) from dual;
    and i am getting error
    ORA-006553:PLS-306 : wrong number or types of arguments in call to ftest1
    and this is the code for function;
    create package body pkg1 is
    type no_array is table of NUMBER index by binary_integer;
    end pkg1;
    CREATE OR REPLACE FUNCTION ftest1(lvdriver pkg1.No_arrray)
        RETURN VARCHAR2
    IS
        lv VARCHAR2(100);
    BEGIN
        FOR i IN lvdriver.first .. lvdriver.last LOOP
            SELECT last_nm
              INTO lv
              FROM person
             WHERE person_id = lvdriver(i);
            dbms_output.put_line(lv);
        END LOOP;
        RETURN lv;
    END;
    how to pass array values to function
    i need to pass multiple values to array here it is lvdriver(1,2,3,123,4,5)??

    Example...
    create or replace type tNums as table of number;
    create or replace function ftest1(nms tNums) return number is
      vResult number := 0;
    begin
      for i in 1 .. nms.count
      loop
        vResult := vResult + nms(i);
      end loop;
      return vResult;
    end;
    SQL> select ftest1(tNums(1,2,3,4)) from dual;
    FTEST1(TNUMS(1,2,3,4))
                        10

Maybe you are looking for

  • New icon on screen - yellow circle with white lines with a 1 next to it - what is it please?

    Hi. New to hear so please bear with me.. i have had my blackberry for about a month and a new icon has appeared (next to where the message icon normally sits). It shows a '1' next to a yellow circle with white lines through it.. I have a feeling it i

  • Installed Windows 8 now can't get into Mac OS

    NOOB MAC USER NEEDS IMMEDIATE HELP TO GET MACBOOK PRO WORKING AGAIN FOR SCHOOL!!! I'm a bit of a noob when it comes to Mac's.  I recently installed Windows 8 Consumer Preview Release on my desktop and thought it was really neat.  The thought popped i

  • 2 devices, 1 Itunes library

    Hello, Currently my wife has the IPhone4S and I have an IPAD.  I wish to set up both devices to sync wirelessly with the Itunes Library on our IMac(2011).  However I do not want the devices to sync to the same ICloud login.  For instance, contacts, m

  • BT Home Hub 3 GigE broken?

    I just got BT infinity installed today. All is working fine and getting 70/20 mb speeds, this is when I connect the cable to port 1, 2 or 3. However when I connect the cable to port 4 GigE it just drops connection. I open a dos command and ping a ran

  • IPhoto 6 albums

    I wish to access iPhoto albums when I import created albums into other photo apps. All I see are folders with dates. Can any offer any light on this annoying issue? Cheers