Name of column to function

Can I refer name of column to function oblicz pasted below?
How can I do this?
nazwa - name of column from table pracownicy witch some float variables
PS:thanks 4 every help.
Greets Mike.
------begin function-----
create or replace function oblicz (nazwa varchar)
return number
is
l number(2);
begin
select avg('nazwa') <----- in here!
into l
from pracownicy;
return l;
end;
--------end function--------
Message was edited by:
axis_81

Aren't the two exactly the same? No:
declare
  l number(2);
begin
  execute immediate 'select avg(empno) into :1 from emp' using l;
end;
Error at line 2
ORA-01745: invalid host/bind variable name
ORA-06512: at line 4
or
declare
  l number(2);
begin
  execute immediate 'select avg(empno) into :l from emp' using l;
end;
Error at line 2
ORA-01006: bind variable does not exist
ORA-06512: at line 4

Similar Messages

  • Dynamically pass Table name, Column Name and rownum to function

    Hi Guys
    I wanted to pass the table name, column name and rownum to function and get the relevant value for it. Please guide me to achieve this task
    Thanking You
    Regards
    Lakmal

    Thanks,
    Here is my test function
    CREATE or replace FUNCTION GET_COLUMN_VALUE (tab_name VARCHAR2,column_name VARCHAR2) RETURN varchar2 AS
    strsql varchar2 (500);
    ColVal varchar2;
    BEGIN
    strsql:='select '||column_name||' from '||tab_name|| ' Where rownum = 1' ;
    EXECUTE IMMEDIATE strsql into ColVal;
    RETURN ColVal ;
    END;
    Message was edited by:
    Lakmal Marasinghe

  • Policy name and column name inside a policy function

    I have the following function associated with a policy in the employee table for SSN and SALARY columns
    FUNCTION empid_policy_fn (object_schema IN VARCHAR2, object_name VARCHAR2)
    end;
    When the policy fires, the schema name and the name of the table are passed onto this function which we can use inside this function but is there a way to get the policy name and the column name which invokes this function?. The problem here is, I'm using same function (common) for multiple policies in different tables and that's why I need to get these details.
    Thanks
    -Krishnamurthy

    Inside your policy function you can query V$VPD_POLICY along with V$SESSION, V$SQL and USER_SEC_RELEVANT_COLS
    to get the fired policy name and column_names.
    Something like
    SELECT v.POLICY, .........
                   FROM v$session ss, v$sql s, v$vpd_policy v
                  WHERE ss.SID = (SELECT SID
                                    FROM v$mystat
                                   WHERE ROWNUM = 1)
                    AND s.address = ss.sql_address
                    AND s.address = v.paraddr
                    AND s.hash_value = v.sql_hash
                    AND s.child_number = 0HTH

  • Query to find out the table name and column name..

    Hi Experts,
    I have an Oracle DB in which has more than 50 tables and 100,000 records. I want to get the record which contains *"ITxtVarValue references a non existing text"* the text.
    Is there any query there to find out the table name and column name of this particular record where it reside?
    Please help. Any help will be rewarded.
    Thanks,
    G

    Using this forum's search function, I found a thread that should give you an idea: How to find out a tablename
    C.

  • How to view technical name of a planning function in IP?

    Hi,
    I have 2 aggregation levels created with 2 planning functions by someone else.
    I want to view technical name of that planning function so that I can include it in my WAD template.
    Please provide the info.
    Thanks & Regards,
    Rashmi.

    Hi Rashmi,
    In the Planning functions tab you click on the button right side of the window.
    Then you will get a window where you can select the columns to display. Pull the technical name window to display columns.
    Then you can see the technical name of that planning function.
    Regards,
    Ravi Kanth

  • Names of column appearing in alv output after changing layout in alvgrid?

    Hi all
    I have a requirement where I am displaying 20 fields using alv grid(cl_gui_alv_grid). Now each time when I run I can change layout and can display any number of columns in output using change layout option.
    My requirement is i need to know the column names of the fields which are displayed upon changing layout in output. Using this column names I have to write some logic in code. Each time number of column may vary as per the user selection. Is there any method or way to get the names of columns selected in output display?
    Please help me in this regard.

    Hi,
    During run time you will get the ALV layout info using this function module.
    REUSE_ALV_GRID_LAYOUT_INFO_GET
    Regards,
    Anversha

  • Intermittent : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.

    I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.
    The first step in the wrapper is to create a Transcript file using following code
    if ($Host.name -ne "Windows PowerShell ISE Host") # Transcript does not work within ISE
    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    $path = "c:\corp\$timestamp" + "_$pid.txt"
    Start-Transcript -path $path -append
    As expected the folder contains files with timestamp & pid in name
    08/08/2013  11:00 AM            14,388 2013-08-08-11-00-01.158_1620.txt
    08/08/2013  11:00 AM            12,506 2013-08-08-11-00-01.485_936.txt
    08/08/2013  11:00 AM            12,994 2013-08-08-11-00-01.735_9328.txt
    08/08/2013  11:00 AM            12,024 2013-08-08-11-00-01.766_8624.txt
    08/08/2013  11:00 AM            13,902 2013-08-08-11-00-01.860_1756.txt
    08/08/2013  11:01 AM            15,142 2013-08-08-11-01-31.392_10120.txt
    08/08/2013  05:00 AM            14,982 _1692.txt
    However note the last file, it has a zero length date time value in the name
    The error recorded by PowerShell is
    get-date : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Corp\Powershell\DMPRun-ScheduledTask.ps1:171 char:18
    +    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    +                  ~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (get-date:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    IE get-date has failed and returned a zero length field as the timestamp
    Can anyone think of a good reason why get-date would fail intermittently?
    Do I have to code defensively for base Powershell functions?

    I implemented David's suggestion and now I intermittently get
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_08_55_02.ps1:15 char:1
    + import-module Microsoft.Powershell.Utility
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand
    I added a trap chain (My Powershell skills do not yet include recursive trap coding, any suggestions welcome)
    trap {
        trap {
            "Trap1"
            "Exception: " + $_
            "Error: " + $Error[0]
            "Message: " + $_.Exception.Message
            "InnerException: " + $_.Exception.InnerException
            "StackTrace: " + $_.Exception.StackTrace
            "FailedItem: " + $_.Exception.ItemName
            import-module Microsoft.Powershell.Management
            import-module Microsoft.Powershell.Security
            import-module Microsoft.Powershell.Utility
        "Trap2"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        import-module Microsoft.Powershell.Management
        import-module Microsoft.Powershell.Security
        import-module Microsoft.Powershell.Utility
    import-module Microsoft.Powershell.Management
    import-module Microsoft.Powershell.Security
    import-module Microsoft.Powershell.Utility
    trap {
        "Trap3"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        exit 1
    get-date
    Now I intermittently get ..
    Trap2
    Exception: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Error: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Message: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    InnerException:
    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
       at System.Management.Automation.AnalysisCache.CacheExportedCommands(PSModuleInfo module, Boolean force, ExecutionContext context)
       at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags,
    PSModuleInfo& module)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
    FailedItem:
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_09_19_52.ps1:26 char:1
    + import-module Microsoft.Powershell.Security
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime?
    I look the properties of items in help and found nothing about this!
    It's possible?

    Hi,
    an other solution is change the block property QUERY_DATA_SOURCE_TYPE from "Table" to "Sub-query" , than change at run time the property QUERY_DATA_SOURCE_NAME.
    First create block and add items
    The QUERY_DATA_SOURCE_NAME will be for ex. "Select 'A' as col1, 'B' AS col2, 'C' as col3 from dual"
    Set into items the column name property to col1 , col2 ...
    At run time change the query to "Select 'Z' as col1, 'X' as col2 , 'Y' as col3 from dual"
    in this way you can change the source of column value.
    Caution because if you change value type from varchar2 to date you must cast date into varchar2.
    May be that this way is valid only for view data not for insert-update, i don't remember.
    bye
    Message was edited by:
    Killernero

  • New-MaiboxRestoreRequest is not recognized as the name of a cmdlet, function, script ?

    I have restored successfully an exchange 2013 mailbox database from backup to the recovery database, but when i try to recover a user's mailbox I receive the following error
    New-MaiboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox "testuser" -TargetMailbox [email protected]
    The term 'New-MaiboxRestoreRequest' is not recognized as the name of a cmdlet, function,
    script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
     I already have the "mailbox import export" management role assigned to the logged in administrator.
    Anand_N

    silly me i spelt the command wrong
    Anand_N

  • [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2"

    I am using SSIS to extract fixed width data into a flat file destination and I keep getting below error. I have tried almost everything in this forum but still no solution. can anyone help me out to solve this problem.
    [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2".
    [SSIS.Pipeline] Error: component "Flat File Destination" (220) failed the pre-execute phase and returned error code 0xC0202095
    Thanks

    Hi Giss68,
    Could you check the Advanced tab of the Flat File Connection Manager to see whether the InputColumnWidth and the OutputColumnWidth properties of the Column2 has the same value? Please refer to the following link about the same topic:
    http://stackoverflow.com/questions/10292091/how-do-i-fix-failed-to-write-error-while-exporting-data-to-ragged-right-flat-fil 
    If it doesn’t work, please post the sample data and the advanced settings of Column2 for further analysis.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Function module to get the name of all the function module used

    I want to populate a internal table with the name of all function module used in the submitted program?? Is there any function module which return the name of all the function module used?

    Hi Priya
    Try this one RPY_FUNCTIONMODULE_READ.
    Ranga

  • How to know  columns and table name  whose column size are modified

    Hi guys
    I want to know which all columns in the tables are modify
    i.e. list of columns and table name whose column size are modified
    Step1 :
    CREATE TABLE employees
    ( employee_number number(5) ,
    employee_name varchar2(50) ,
    department_id number(10)
    CREATE TABLE Supplier
    ( Supplier_number number(5) ,
    Supplier_name varchar2(50) ,
    CREATE TABLE customers
    ( customer_id number(10) not null,
    customer_name varchar2(50),
    address varchar2(50),
    city varchar2(50),
    state varchar2(25),
    zip_code varchar2(10),
    Step2 :
    Alter table employees
    MODIFY employee_number number(10)
    ALTER TABLE supplier
    MODIFY supplier_name varchar2(100)
    step3
    query to dispaly
    columnname table name
    employee_number employees
    supplier_name supplier
    How to know columns and table name whose column size are modified
    could you please provide query
    Thanks in Advance

    09:35:50 SQL> desc dba_objects
    Name                            Null?    Type
    OWNER                                  VARCHAR2(30)
    OBJECT_NAME                             VARCHAR2(128)
    SUBOBJECT_NAME                         VARCHAR2(30)
    OBJECT_ID                             NUMBER
    DATA_OBJECT_ID                         NUMBER
    OBJECT_TYPE                             VARCHAR2(19)
    CREATED                             DATE
    LAST_DDL_TIME                             DATE
    TIMESTAMP                             VARCHAR2(19)
    STATUS                              VARCHAR2(7)
    TEMPORARY                             VARCHAR2(1)
    GENERATED                             VARCHAR2(1)
    SECONDARY                             VARCHAR2(1)
    NAMESPACE                             NUMBER
    EDITION_NAME                             VARCHAR2(30)LAST_DDL_TIME can be utilized

  • In the top, calendar sheet, there are job names in column B. In the sheets below are individual job, tracking sheets. I need a formula to link the sheets by job name so I don't have to go back and edit as I go.

    file://localhost/Users/georgegalli/OFFICE/Time%20sheets/September%202013%20copy. numbers
    I hope I'm asking this the right way......
    Sheet "31 Day diary" is linked to sheet "Caramainco". So, no matter what job we are on, the days are always recorded to the Caramanico sheet.
    Is there a formula that will recognize the job name in column B sheet 1 and link to a sheet below of the same name?

    This is a part of the linked sheet from one job.....( Caramanico ) notice where i had to delete days where we weren't there.
    Date
    George
    Aaron
    Mike
    Wed, Aug 28, 2013
    0.00
    0.00
    0.00
    Thu, Aug 29, 2013
    0.50
    1.00
    0.00
    Fri, Aug 30, 2013
    0.50
    1.00
    0.00
    Sat, Aug 31, 2013
    0.00
    0.00
    0.00
    Sun, Sep 1, 2013
    0.00
    0.00
    0.00
    Mon, Sep 2, 2013
    0.00
    0.50
    0.50
    Tue, Sep 3, 2013
    0.00
    0
    0
    Wed, Sep 4, 2013
    0.00
    0
    0
    Thu, Sep 5, 2013
    0.00
    0.00
    0.00
    Fri, Sep 6, 2013
    0.00
    0.50
    0.00
    Sat, Sep 7, 2013
    0.00
    0.50
    0.00
    Sun, Sep 8, 2013
    0.00
    0.00
    0.00
    Mon, Sep 9, 2013
    0.50
    1.00
    0.00
    Tue, Sep 10, 2013
    0.00
    0.00
    0.00
    Wed, Sep 11, 2013
    0.00
    1.00
    0.00
    Thu, Sep 12, 2013
    1.00
    1.00
    1.00
    Fri, Sep 13, 2013
    1.00
    1.00
    1.00
    Sat, Sep 14, 2013
    0.50
    0.00
    0.00
    Sun, Sep 15, 2013
    0.00
    0.00
    0.00
    Mon, Sep 16, 2013
    0.50
    1.00
    1.00
    Tue, Sep 17, 2013
    0.00
    0.00
    0.00
    Wed, Sep 18, 2013
    0.00
    0.00
    0.00
    Thu, Sep 19, 2013
    0.50
    0.00
    0.00
    Fri, Sep 20, 2013
    0
    0
    0
    Sat, Sep 21, 2013
    0
    0
    0
    Sun, Sep 22, 2013
    0
    0
    0
    Mon, Sep 23, 2013
    0
    0
    0
    Tue, Sep 24, 2013
    1.50
    1.50
    1.50
    Wed, Sep 25, 2013
    0.00
    0.00
    0.00
    Thu, Sep 26, 2013
    1.00
    1.00
    1.00
    Fri, Sep 27, 2013
    1.00
    1.00
    1.00
    Sat, Sep 28, 2013
    1.00
    0.00
    0.00
    Sun, Sep 29, 2013
    0.50
    0.00
    0.00
    Mon, Sep 30, 2013
    1.50
    0.00
    1.50
    Tue, Oct 1, 2013
    1.00
    1.00
    1.00
    Wed, Oct 2, 2013
    0.50
    0.50
    0.00
    Thu, Oct 3, 2013
    1.00
    1.00
    1.00
    Fri, Oct 4, 2013
    Sat, Oct 5, 2013
    0.00
    0.00
    0.00
    Sun, Oct 6, 2013
    0.00
    0.00
    0.00
    Mon, Oct 7, 2013
    0.00
    0.5
    0.00
    Tue, Oct 8, 2013
    0.00
    0.00
    0.00
    Wed, Oct 9, 2013
    0.00
    0.00
    0.00
    Thu, Oct 10, 2013
    0.00
    0.00
    0.00
    Fri, Oct 11, 2013
    0.00
    0.00
    0.00
    Sat, Oct 12, 2013
    0.00
    0.00
    0.00
    Sun, Oct 13, 2013
    0.00

  • How to compare index names and columns from different user?

    I am using below query to compare two indexes from 2 different users but even though index name and columns are same... result shows me they are different.. what I am doing wrong? Thanks
    WITH t AS
            (SELECT COUNT (DISTINCT index_owner || index_name || indexed_cols)
                       cnt
               FROM (  SELECT index_owner,
                              index_name,
                              listagg (column_name, ',')
                                 WITHIN GROUP (ORDER BY column_position)
                                 indexed_cols
                         FROM dba_ind_columns
                        WHERE index_name='XPKTBL_A'
                     GROUP BY index_owner, index_name))
    SELECT CASE
              WHEN cnt > 1 THEN 'Indexes are different'
              WHEN cnt = 0 THEN 'Indexes dont exist'
              WHEN cnt > 1 THEN 'Indexes are identical'
           END
              commnt
      FROM t
    Result:
    Indexes are different
    but Actually if you check below they are same After when I run this query:
    SELECT index_owner,
             index_name,
             listagg (column_name, ',') WITHIN GROUP (ORDER BY column_position)
                indexed_cols
        FROM dba_ind_columns
       WHERE index_name='XPKTBL_A'
    GROUP BY index_owner, index_name;
    Result:
    Index_owner
    Index_name
    Index_cols
    USER1
    XPKTBL_A
    FIELD_A1
    USER2
    XPKTBL_A
    FIELD_A1

    Hi,
    Erhan_toronto wrote:
    I am using below query to compare two indexes from 2 different users but even though index name and columns are same... result shows me they are different.. what I am doing wrong? Thanks
    WITH t AS
            (SELECT COUNT (DISTINCT index_owner || index_name || indexed_cols)
    So index_owner is 'USER1' in one case, and 'USER2' in the other; right?
    A string that starts with 'USER1' will be distinct from a string that starts with 'USER2', no matter what the rest of the string contains.  Maybe you don't want to compare the owners, or maybe you meant to use some other column (such as table_name) instead of index_owner).
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE, CREATE INDEX and CONNECT statements), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • In OS X Lion, Finder will not "Arrange By Name" in "Column view".

    If I select "Arrange By > Name" in "Column View" in any window, nothing happens. This is a massive inconvenience. I attached an image of a finder window of my applications below, in which the Column view with arrange by Name is configured, but the applications haven't been resorted by name.
    It will arrange by name in Icon and List views, but not in Column view. Does anyone know how to solve this? Is it a glitch inherent to OS X Lion that Apple didn't catch?

    There seem to be a few glitches in the Arrange/sort model.
    You can actually Arrange by and Sort By separately. You can get to the Sort options by holding down the Option key while selecting the Arrangement button.
    However, there aren't any sort options when you Arrange by Name. And it doesn't change the sort by option when you switch to Arrange by Name.
    Try setting the Arrange by to None. Then, hold down the option key and press the Arrange button. What is it sorted by?

Maybe you are looking for

  • Making Playable DVD From Disc Image

    A friend of mine has an iDVD project but his mac cannot burn dvds. So he gave me the file as a disc image. I dragged and dropped the disc image to the dvd and hit burn. It does not play as a dvd in a player or in frontrow on my mac. When I double cli

  • IPod won't recognize music on my computer

    Hi..tried to get help last night with problem and no luck yet... The history: I plugge IPod Nano into my computer at home and a message square came up asking if I wanted to switch libraries, or something...stoopid me said yes and in blink of an eye t

  • Safari 2.0.4 - Uses a lot of memory  ??

    Hello, I own an Intel iMac MA200. I noticed after Safari's 2.0.4 update that it uses a lot of memory, sometimes even as much as 200MB The cure I found is to restart Safari. Sometimes, I need to even Force Quit it. When I finish using my iMac, and clo

  • How do I get rid of Fuzzy Sound created by the iTunes upgrade?

    So I upgraded to iTunes 7.0.0.70 and now I get static on my head set. I have an Anycom 2.0 Bluetooh adapter and Plantronics P590 headset that works fine with everything else including videos on yahoo, skype, Webex, and more. Can I go back to the old

  • I have found a bug in Logic Pro 10.0.3.

    In the Environment Window, go to "Clicks & Ports" & create a new object. Go to Fader/Specials/Cable Switcher. In the parameter window- Set the Style to "As Text", then change the Range to anything other then 0-127. Instant crash every time. Also, if