not able to pass the table name as parameter in the function

Hello

I am not able to move from tablename as parameter. I use the below function.
-------------------------------------------------------------------------------------------------

function count_test (tabname varchar2) return number is
l_count number;
Start

Select count (*) IN the tabname FROM l_count;

RETURN l_count;
END;

You can not do with static SQL.

The only way is to do it with dynamic SQL:

EXECUTE IMMEDIATE ' select count (*) FROM ' | tabname INTO l_count;

Kind regards.
Al

Published by: Alberto Faenza 10 may 2012 01:44
Misspelling

Tags: Database

Similar Questions

  • Series of printer HP Color LaserJet 2840: not able to configure the functionality of SCAN to e-mail or a folder

    Have a series of HP Color LaserJet 2840 printer on a local subnet for home with two computers that share.

    We can make regular features print very well.

    We cannot get the SCAN function to work for the scan to e-mail or in a folder.

    Went and used the HP Toolbox to set options analysis, but for some reason, they are not taken.

    The Guide of the user for this problem are usless (as usual with the documents of the user).

    I have spend too much time on this seemingly simple question, as usual.  (months of work on this periodically)

    I'm sure that's not that hard to implement.

    Can you please help or advise.

    Additional information:

    2 computers on the subnet local via 100MB ethernet switch and router (basic stuff)

    No problem of communication to the printer for print jobs or check on other orders of status.

    Some scanning configuration problems.

    Two client computers are running Windows Vista Home Premium SP1 32-bit

    I want to set up the printer so I can scan from the printer directly to a folder on the machine either or e-mail to each machine.

    I do the steps correctly, from what I can tell, but the info is not required or sent to the printer. ?

    If I add an e-mail through the box to tools, I can fill in the email field and the name field, but it will not show when I hit Add.

    Besides which should represent the box 'Host '?  The printer or my personal computer?

    If I try to add a file, it displays a browse box but never lets me select a folder to scan to?

    I don't understand.  Shouldn't be this embarrassing.  And if it is, (as usual), the stupid tech docs should do a better job MUUCCHH through it.  In fact, they don't even show or talk about the Host column.  So what is this for.

    Help, please...

    I'm sorry, but to get your question more exposure I suggest posting in the trade forums since it is a printer. You can do so at http://h30499.www3.hp.com/hpeb/

    I hope this helps.

  • Not able to use the function

    Hello Experts!

    I am trying to write a FUNCTION that can return a line when I provide an employee ID. I created a function I have it gets compiled successfully. Now when I try to call this function, I get the error message saying
    Error at startup on line 2 of the command:
    run get_employee (100);
    Error report:
    ORA-06550: line 1, column 7:
    PLS-00221: 'GET_EMPLOYEE' is not a procedure or is not defined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:

    I don't know why its not working. Can anyone help me please with it? I tried 2 different ways to call this function, but both give the same error (as above). Here are the ways I tried to call this function.

    -1 way
    Set serveroutput on
    run get_employee (100);


    -2 ways
    Set serveroutput on
    declare
    employees.employee_id%type ID: = 100;
    Start
    dbms_output.put_line (get_employee (ID));
    end;
    /
    print;


    And here's my functions
    create or replace FUNCTION get_employee (p_empid in employees.employee_id% TYPE)
    RETURN employees % rowtype as employees l_cust_record % rowtype;
    BEGIN
    Select * into l_cust_record
    employees
    where employee_id = p_empid;

    Return l_cust_record;
    end;


    Thank you very much in advance.

    Hello

    user10791378 wrote:
    ...
    -1 way
    Set serveroutput on
    run get_employee (100);

    Calling a user-defined function, that's like calling a built-in function.
    To call a function integrated, as ABOVE, you would say:

    cap_name := UPPER (name);
    

    To call a function of user-defined as get_employee:

    e_rec := get_employee (100);
    

    -2 ways
    Set serveroutput on
    declare
    employees.employee_id%type ID: = 100;
    Start
    dbms_output.put_line (get_employee (ID));
    end;

    Dbms_output.put_line argument is a VARCHAR2. The value returned by get_employee is used. ROWTYPE. These are two very different data types. You cannot use one when the other is needed.
    If one of the columns (ename, say) of emplyees is a VARCHAR2, then you can say:

    DECLARE
        e_rec    employees%ROWTYPE := get_employee (100);
    BEGIN
        dbms_output.put_line (e_rec.ename);
    END;
    

    or

    BEGIN
        dbms_output.put_line (get_employee (100).ename);
    END;
    
  • How can I get my photoshop saved again when I'm not able to disable the function on the old computor

    Hi there at - there someone who can help me - my old computor totally crushed. I bought photoshop CS5 in December and it loaded on my old computor before the crash. Now, I am unable to turn it off before re - save on my new computor.

    Thanks Ria

    Hi Ria,

    Please contact customer service and they would be able to increase the number of activations for you as an exception in this case.

  • I'm not able to use the export to ftp in Muse. When I enter my host, the name and the password, I get a long interlude of the Rainbow wheel, and finally, the message that my host ftp can not be found. I checked the name and it is port 21. Can I export a H

    I'm not able to use the export to ftp in Muse. When I enter my host, the name and the password, I get a long interlude of the Rainbow wheel, and finally, the message that my host ftp can not be found. I checked the name and it is port 21. I can export to HTML and use another ftp client to download (on the same server), but it's tedious and minor changes is painful. Have you come across this and found a solution?

    Yes I have - thanks for thinking.

    Starting to think that it is a computer / connection problem. I had to move the machines to connect to the Adobe forum.   Plu MacBook thin. New macbook dead ends. These seem too coincidental independent.

    Susan

  • Not able to get the value of the type defined in the other program

    Hi all

    I have create a type in a single package spec (Globally), now I'm using the same type in another package. Simply I'm calling the first package and try to store the value in the Type and use the same type in the second package.

    But I'm not able to get the value

    Type declaration

    Declared in package Spec
    
    TYPE t_aa_derive_tbl_type IS TABLE OF xxxx%ROWTYPE;
       t_aa_derive t_aa_derive_tbl_type;
    

    Package 1

    Package1. PROCEDURE name(
    some parameters);
    is
    Cursor
    c1 is Select * from dual;
    
    begin
          OPEN c_aa_derive;
            FETCH c_aa_derive
            BULK COLLECT INTO t_aa_derive;
            CLOSE c_aa_derive;
           
         END get_aa_derive;
    

    In my second package

    I'll call you

    Package1. PROCEDURE name(
    some parameters);
    
    and then i am trying to
    
    for i in 1 .. package1.t_aa_derive.COUNT
      LOOP
    
    ....
    
    ....
    ...
    
    end loop;
    

    I can not entered the loop for some reason any.

    Could someone guide me if anything I missed.

    See you soon,.

    San

    And what did you like refcursor c_aa_derive in the call to package1.name? Is it returns all rows? If this isn't the case, COUNT will be 0.

    SY.

  • Time machine is unable to perform a backup. Not able to access the sparsebundle. Problem occurred first on snow leopard OS. Followed Dragon upgrade to El Capitan. Only difference has error code of 109 changed to null. What about someone?

    Time machine is unable to perform a backup. Not able to access the sparsebundle. First of all, there is problem with the Snow Leopard operating system. Dragon followed in the upgrade to El Capitan. Only difference was error code 109 changed to 'null '. What about someone?

    We need some info.

    You can access from the finder Time Capsule? If this isn't the case, then Time Machine will not work.

    You upgrade the computer snow to El Capo and keep the same name?

    If you want to backup, it is best to start again... clean the new backup any attempt to add a previous backup failed.

    I recommend that you actually erase the TC... do a complete factory reset and start again.

    The previous backup if necessary can be archived on a USB drive connected to the TC assuming that Airport utility can still access it. Airport utility accesses the TC?

    With update installs all sorts of things can go wrong... so tell me more if you can not get anywhere.

  • Hello friends, I am not able to record the songs in music in ios 9.3, please give me the solution.

    Hello friend

    I'm not able to record the songs in music in IOS 9.3, please give me the solution.

    Click on album artwork, not the name of the song as you used to. the album art will fade to black revealing the old side thing.

  • Not able to keep the IP STATIC address' 'Windows '.

    Hello.. I'm not able to change the static IP address in my Windows Server 2012 Standard R2 64 bit system.

    I follow the steps below:
    1. disable the Ethernet (name of the VM network)
    2. access to the IPv4 properties;
    3. setting the following value:
    (i) use the following IP address:

    a. intellectual property:

    b. subnet Mask: 255.255.255.0
    c. default Gateway:<>
    (ii) use the following DNS server address:
    a. preferred DNS server: 127.0.0.1
    (iii) validate the output parameters: true
    4. click on Ok.
    5. click on Ok.

    After that, he tries to change the IP address. But the DHCP service is disabled; Internet no longer works and he asks that "let windows detect the settings of the system." If you click ok, the IP address is once again is changed in 192.168.2.17.

    But if I change the IP from 192.168.2.18 to 192.168.2.15, and then also in the internet stops working.

    Seuugest nicely.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • I have a Kyocera FS-820, but I could not able to install the USB Port in windows 7

    I need to install my old printer is the Kyocera FS-820 printer which works properly on Windows XP, but when I bought a new laptop which has Windows 7 Home printing USB no longer works. I tried to install the driver, but unfortunately I could not able to find the USB port.

    When I plug the usb PRINTER cable gives me an error of USB DEVICE NOT RECOGNIZE.

    Can someone help me what are the installation step by step in my printer thank you

    It seems that Kyocera has a driver for Windows 7 which you can download from their support site (download file - make sure the file name and where it is being recorded and then search for and double-click on the downloaded file to install it): http://usa.kyoceramita.com/americas/jsp/Kyocera/resource_details.jsp?pid=13988&rid=22655

  • Not able to perform the calculation on the data base not tabular column

    Hi all

    I have a master's degree and a tabular form of retail that has of the following requirement:

    • If I choose two feel in my element Type of trip in my master form, no. tickets in my detailed tabular form must have doubled this IE. 2 * number of tickets
    • The number of tickets is a field display text (does not state) so I'm not able to select the value of the field in jquery.

    Kindle help me with this.

    Thank you and best regards,

    Madonna

    Hello Nicolette,

    I solved by creating a function of database and used in the source region of the form of the table with the column attribute as display text (does not save the State).

    Thank you for your help.

    Kind regards

    Madonna

  • I am not able to create the dimension in awm

    Hello

    I am not able to create the dimension in awm.

    Error:

    The transaction is not pensionable: "an error has occurred on the server.
    Class of error: failure of the Express
    Server error descriptions:
    DPR: failed to create the server-side, generic cursor at TxsOqDefinitionManager::generic < CommitRoot >
    INI: XOQ-01801: CREATE a privilege is required for the 'PRODUCT' schema 'OLAP' object., generic TxsOqTopLevelObject::lockExclusive
    "
    at oracle.olap.awm.dataobject.dialog.PropertyViewer.doCreateAction (unknown Source)
    at oracle.olap.awm.dataobject.dialog.CreateDialogHostActionThread.doAction (unknown Source)
    at oracle.olap.awm.ui.dialog.ThreadedDialogActionThread.run (unknown Source)

    He tells this schema user u to connect have create table privilege.

    Connect as sys as sysdba and grant create table privilege to your schema user.

    This command occurs

    GRANT CREATE TABLE ;

    Mark correct or useful if this can help,

    Kind regards
    Rayan Vieira

  • Not able to specify the location of file

    Dear all

    I use PCM 13.1 and we are not able to specify the path to the file by using the PCM admin login page, when I open in the browser and that goes to content management and click on the name of the project, and then Add specifies the location of the folder, I can put the name of the location but when I try to insert in the location of the file that I can't type or the pop-up window does not come to specify the location of the path I checked IE and other browsers but same effect, I also PCM site added to trusted sites and must change is low security, disable all POP-UP blocker. but no results, someone has an idea
    I thank in advance

    I had the same problem, it is with Java JRE installed on the machine.
    I uninstalled Java and installed Version 6 Update 26 and it worked fine

  • Not able to change the password by using the query. Select APPS.fnd_web_sec

    Not able to change the password by using the query.
    Select APPS.fnd_web_sec.change_password ('username', 'password') 'RES' double;

    Can someone tell why and what privileges and subsidies have flexibility to the user non-apps while it can change the password using fnd_web_sec.change_password.



    Concerning

    the information above does not solve my problem, I get the message

    Because you do not have permission on all objects that are referenced by the API (see below).

    Select FND_WEB_SEC. CHANGE_PASSWORD ('MARSHAD', 'mohammad @123') "RES" of the double

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    ORA-06512: at the 'APPS '. FND_CORE_LOG', line 25

    ORA-06512: at the 'APPS '. FND_CORE_LOG', line 432

    ORA-06512: at the 'APPS '. FND_PROFILE', line 110

    ORA-06512: at the 'APPS '. FND_SSO_MANAGER", line 227

    ORA-06512: at the 'APPS '. FND_WEB_SEC', line 1425

    ORA-06512: at line 1...

    can you please list me what are the grants and other Jules Destrooper I should give to a user so that he can change password.

    I don't have the list of objects and you should get yourself by consulting the site code and eTRM API.

    by changing the DDT in the user non-apps after the grant, will, it may be able to change the password.please tell this syntax is correct or not.
    Select applications. FND_WEB_SEC. CHANGE_PASSWORD ('user', 'pwd') "RES" of the double

    What is the point of using 'FND_WEB_SEC. CHANGE_PASSWORD' and not FNDCPASS or FND_USER_PKG API?

    Thank you
    Hussein

  • could not able to open the repository in online mode after changing

    Hi friends,

    Currently, I open a file of RPD called SH in online mode... Since Inorder for it to open, I made the following changes in the configuration file of TNA , and also in instanceconfig.xml file...

    Shortly after this change after giving a user name and password of the RPD SH file I opened the repository of the HS in online mode...

    And also if I give the username and the password of RPD HS in presentation services I can able to connect to the BI responses to view reports of SH...

    Now I have to open another file such as APP.rpd RPD, before I edited in the configuration file of TNA as well as in the instanceconfig.xml file...

    After that, change if I give the respective user name and the password of the average APP RPD file, it is not to open the repository in online mode...

    He throws the error as

    nqserror: 37001 couldnot connect to the instance of oracle BI server
    nqserror: 43001 authentication failed for Star repository administrator: username/password invalid

    Since the error trying to tell that the user name and password is incorrect for the file APP.rpd...

    But if I tried to open the APP.rpd file in offline mode means, is opened giving the username and password of it... But in online mode, why he does not accept the same user name and password...

    Because the APP.rpd does not open in online mode, I could not able to open the presentation...

    How do I open the APP.rpd instead of SH

    What may be the problem...

    Help me friends,

    GTA...

    Hi, GTA,

    Did you reboot of Oracle BI Server?

    Thank you.

    Daan Bakboord
    http://obibb.WordPress.com

Maybe you are looking for