Can i send table_name and field_name as function arguments.

hi,
i need to get the maximum column value for a field in the required table at run time. i need to send the table name as a parameter to the function.
my code is,
create or replace function (tname in varchar2, fldname in varchar2)
is
val number,
begin
select max(fldname) into val from tname;
end;
but its not working.
and i tried with this,
select max(<fldname>) into val from <tname>;
select max(:fldname) into val from :tname;
both of these not working.
i need ur suggestions.
regards
pavan.

SQL> create or replace function maxval(
  2    table_name in varchar2, col_name in varchar2)
  3    return number is
  4  m number;
  5  begin
  6   execute immediate 'select max('||col_name||') from '||table_name into m;
  7     return m;
  8   end;
  9   /
Function created.
Elapsed: 00:00:00.04
SQL> select maxval('EMP','SAL') from dual;
MAXVAL('EMP','SAL')
               5000
Elapsed: 00:00:00.00

Similar Messages

  • Can Not send pictures and documents with my webmail, the link is Not visible on Safari Browser

    Hello, i can Not send pictures and documents wit my tele2 webmail, the link to so this is Not visible. I tried Safari, Opera, and Dolphin.

    Safari doesn't support the attaching/uploading of files. If you want to send documents or photos that you have stored on the iPad then you can use the Mail app - if you've set up your email account on it, then you should be able to start in the app that contains the document, and then use that app's functionality to select the document and attach it to an email e.g. in the Photos app you can use the icon of the box with the arrow coming out of it to select and email a picture

  • Can i play music and use mirroring function at same time from ipad2 to apple tv

    can i play music and use mirroring function at same time from ipad2 to apple tv

    Yes, any audio during the "mirroring" funtion will forward to the appletv. This includes all system audio, games, apps, ect. If you slide the mute botton the side of your ipad to mute then you can block app audio and just get Music audio or Pandora if you are using pandora.

  • On my iPad I can only send email and messages to apple products.how can I send and receive from other devices other than Apple?

    On my iPad I can only send email and messages to apple products.how can I send and receive from other devices other than Apple?

    Vallakat wrote:
    On my iPad I can only send email and messages to apple products.
    There is a huge difference between sending email and sending messages.
    Yes, I believe you when you say you can only send messages to other Apple products.  The iPad is not a telephone, and therefore, it cannot text message.  It can only iMessage, which means it can send and receive messages to/from other Apple products if they are on WiFi or an iMessage capable cellular network.
    Email, however, is a whole different category.  I don't really think you can only exchange email with other Apple products only.  Make sure you have correctly identified the symptoms.

  • I can't send SMS and do Tethering

    Hello Guys! On last Friday I was traying to lock and erase my iPhone by iCloud.com (Just to investigate and know what happens) using obviously my Apple ID. Then, I could erase and lock my iPhone and I can't come back to the normality! After that, I restore the iPhone by iTunes in my PC and now my iPhone is working again but I can't send SMSs and do Tethering! In the SMS App I have the message "Not Sent" and I don't have the option for do Tethering in Settings. I'm using the last version of iOS. Can you help me?
    Sorry for my bad English. Thanks.

    As those are carrier features, the first thing you need to do is contact your carrier and make sure that your account it properly set up. Do this even if it used to work just fine. Glitches happen.

  • Can't send texts and all my former texts are gone

    Without any warning, all my texts have been erased.  And I can't send any new ones.  I sent a text this morning without any problems.  Didn't touch the phone after that and when I tried to send another text, I couldn't.

    the solution that i did was use itunes to restore the phone. and did the "use as new phone" option,instead of restoring it from the back up....
    here's the whole story.
    what happened was,i have to phones,iphone 4 and 4s,i swapped the sim cards,backed up itunes for bothe in different comps and did a reset on both of em'... then suddenly the Iphone 4s wasnt able to txt or call out but can receive call and text,it just cant call out thats it....
    so i did a phone reset one last time,then i used itunes to do a factory reset and after that it worked,i didnt use the old back up,i used the use as new phone,though its a bit tiring to arrange all those downloaded apps again,its worth it coz im able to text or call again after that...
    by the way,before i did the itunes reset,i already did all the other troubleshooting steps for 2 days,none helped but this...

  • Can i send music and audiobook to an ipod without syncing?

    I am wanting to get my newly blind grandmother, who lives across the country from me, an ipod so she can listen to music and audiobooks. Her facility caregivers can start and stop the music and books, but there is no way to sync the ipod to upload new material after I send it to her. I will upload music initially. But after it's with her is there a way I can a) send new music and b) more importantly, get her access to books?? e.g. If I used the audible.com app, will it magically send the books to her ipod without plugging into a computer (like the kindle does?). Any other ideas??
    Thanks.

    - You can purchase and redownload audio.com books on the iPod..  Thus you know the username and password for the account you can purchase them on a computer and or other place and she or someone else can redownload it on her iPod. The audio.com books will show on her device (if signed into the account tht purchased them) so it is easy to redownload.
    http://mobile.audible.com/faqiPhone.htm
    - Music is harder. To get music into the iPod's music app you either have to sync (via USB or wif (have to be on the same network so you can't do it remotely) or purchase the music from iTunes. If y ouse the same iTunes account, she can redownload iTunes purchases.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I can't send mail and I can't delete mail.

    I just can't send mail but receive it just fine.
    As well, deleting mail is a problem.

    When this happened on my iPhone, I had to go into the mail, contacts, calendars settings and then put my password into the outgoing mail server. Not sure if this is a solution to your problem but it's always worth having a look

  • Lion Mail can't send/receive and requiring Force Quit.

    After Lion 10.7 , Mail Version 5.0 (1244.2/1244.3) can't send or receive (to smtp or pop servers) as usual with Snow Leopard. In addiction, Mail seems hanged and is not quitting graciously... requiring Force Quit.
    Today I noted a lot of users reporting Mail problems after Lion, and Apple site says there was only a minor changes at Mail authentication methods. I tried everything they said... and everything communities said. Nothing works. 
    Is Apple really working on Mail reported problems ?

    I get emails with my sbcglobal and ymail but i cannot send any email!! this is getting very annoying.  It used to work just fine on snow leopard. I even tried using the same setup that I have on my iPhone, same smtp etc and nothing seems to work...

  • Mail can't send now and still no sound.

    As well as no new mail sound , now I can not send mail, it asks over and over for the outgoing server password.
    I am using Leopard 10.5.5 and Mail 3.5 on my Mac Mini G4
    Mail is just getting worse, why do we have to use other email programs, when we pay for Leopard ? I'm getting so sick of this.

    Rodney,
    Who is the provider of the SMTP you are using? Some ISP (notably Comcast) have recently changed how they handle even the SMTP they provide.
    Ernie

  • Can't send messages and normally can't log in

    I've been havinga problem for a couple of days that I can't send messages; they just say pending, and when I log back on they're gone completely. Also i've been having another problem for months that I normally can't log in because it says that i'm already logged in on this computer. I try to restart the pc but that doesn't help at all. I try on other devices which also don't help. It's getting really frustrating please help me with this problem.
    I'm using windows 8 x64 and using the desktop version of skype on the latest version on skype. It used to work perfectly fine.

    Have you tried uninstalling and reinstalling your SKype application?

  • How can I send an email when a function returns false?

    Im trying to make this code work, but i still receive an email when the function is equal to false. Can anyone assist me in finding the issue? What the program does is look for servers that has a set limit (in GB) on specific drives.
    #This Program goes through all the servers and informs any level below the limit
    $ErrorActionPreference = "SilentlyContinue";
    $scriptpath = $MyInvocation.MyCommand.Definition
    $dir = Split-Path $scriptpath
    #=================Function============
    Function isLow($server, $drive, $limit)
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'";
    [float]$size = $disk.Capacity;
    [float]$freespace = $disk.FreeSpace;
    $sizeGB = [Math]::Round($size / 1073741824, 2);
    $freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
    if($freeSpaceGB -lt $limit){
    return $true;
    else{
    return $false;
    #================Servers==============
    #------------------###server1--------------
    $server = "###server1";
    $drive = "C:";
    $lim = 25;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    $server = "###server1";
    $drive = "D:";
    $lim = 35;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    #-----------------###(more servers ect.)--------------
    #================EMAIL===============
    $smtpServer = "192.168.x.x"
    $ReportSender = "[email protected]"
    $users = "[email protected]"
    $MailSubject = "ALERT!!! Low DiskSpace"
    foreach($user in $users){
    if($true){
    Write-Host "Sending Email notification to $user"
    $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
    $msg = New-Object Net.Mail.MailMessage
    $msg.To.Add($user)
    $msg.From = $ReportSender
    $msg.Subject = $MailSubject
    $msg.IsBodyHTML = $True
    $msg.Body = $Alert
    $smtp.Send($msg)
    else($false){
    Write-Host "No one is pass the limit"

    Using a CSV is good.  Just load the "$servers" hash array from a CSV and the rest will work the same. The overall structure would work better if it was more like this.
    Function isLow($server, $drive, $limit){
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'"
    if($disk.FreeSSpace -lt $limit){
    $true
    }else{
    $false
    $servers=@()
    $servers=@{
    Server="###server1"
    Drive='C:'
    Limit=25Gb
    $servers=@{
    Server="###server2"
    Drive='D:'
    Limit=15Gb
    $servers=@{
    Server="###server3"
    Drive='C:'
    Limit=50Gb
    $results=foreach($servers in $servers){
    if(isLow $server.Server $server.Drive $server.Limit){
    '{0} || {1} is low<br>' -f $servers.Server,$server.Drive
    if($results){
    Write-Host 'Sending Email notification' -fore green
    $mailprops=@{
    SmtpServer='192.168.x.x'
    From='[email protected]'
    To=$users
    Subject='ALERT!!! Low DiskSpace'
    Body=$results
    BodyAsHtml=$true
    Send-MailMessage @mailprops
    }else{
    Write-Host 'No one is past the limit' -ForegroundColor green
    The biggest issue is to realize that this is a computer.  If you type the same thing more than once then consider that the computer can do it for you.  Once you learn to think like a computer all of this becomes easier.
    ¯\_(ツ)_/¯

  • I can't send emails and Safari has issues

    I am unable to send emails from one of my mail accounts. This occurs every so often. I have tried what Mail Help suggests, however, it is not successful. I have tried taking all accounts online and I have changed the port numbers in advanced settings. What else should I try?
    On another note, my Safari has problems. Whenever I want to download something (including the new Flash player or Google Chrome), Safari will begin the download and then will crash. What can I do to resolve these problems? Thanks!

    Try these steps and see if they help.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    If that doesn't help, close all aps and then try settings, contacts and mail again.
    To close all apps - Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus (-) sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • Can receive, send new and forward but cannot reply or reply all in mail all

    I'm using Tiger 10.4.11 and am suddenly experiencing a problem with Mail. I can receive emails and send new but cannot reply or reply all. When I click either the reply or reply all button, nothing happens, not even the spinning ball of death. Have tried the dropdown menu and the keyboard shortcut but same issue.
    Anyone else experienced the same problem or know how to fix this please?

    Ms. Gibbs, welcome to the discussion groups!
    Mail accesses Address Book to make sense of addresses, etc., whether or not you have anything in Address Book. When you start Address Book, are there any problems?
    Another thing to try after that, is kind of a "standard Mail fix to try": rebuild the Envelope Index.
    To do this, quit Mail. Then in Finder, find ~/Library/Mail/Envelope Index and move it to Trash. (~ is your Home Directory.) Then start up Mail. It will say something about importing mail... it is just rebuilding the Envelope Index file.
    -fred

  • I've changed my Apple ID email and password. now I can't send texts and so many things happening on my Iphone 5

    please any one can help?

    Hi Diboo,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots.
    Apple ID: What to do after you change your Apple ID
    http://support.apple.com/kb/HT5796?viewlocale=en_US&locale=en_US
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    I hope this information helps ....
    Happy Holidays!
    - Judy

Maybe you are looking for

  • How do I transfer photo's from a Samsung wave mobile phone to my mac

    I have a Samsung Wave mobile phone and want to transfer the photo's and video's onto my desktop Mac computer (iPhoto). Does anybody know how to do this without transferring any other information? If possible I would like to use a USB cable. Grateful

  • Make JFrame bigger than screen size

    I have a JFrame which has several components. I need to print all the contents of this JFrame, but to do that I need to be able to make the JFrame bigger than the screen's resolution. When I change the size of my JFrame to anything bigger than the sc

  • Dynamic Link in CC

    Dynamic link is greyed out in CC? Do I need to activate it in come way.

  • Smooth integration of iWorks documents between iMac and iPad

    I have an iMac with Lion 10.7,4 and an iPad 5.1.1.  I would like to work with iWork files on both devices, and move the files between both devices.  This seems simple but isn't.  I've tried Webdav but can get it to run.  I'm getting very frustrated w

  • Elements 3 won't recognize a camcorder

    Have version 3 installed. It won't recognize a Sony digital camcorder which it has in the past. Used both USB and firewire. Firewire works with Microsoft Movie Maker Using Windows XP. Also have version 4.0 but didn't install it because of the negativ