Using the 'LOG' Function in a Formula Column

If I write the following SQL statement at the SQL prompt, it works :
SELECT LOG(sal,10) FROM emp ; But, if I write a similar statement in the formula column of a report, then it does not work :
SELECT LOG(sal,10)
INTO x_variable
FROM emp
WHERE empno = :empno ;
return (TRUE) ;
It would be great if someone can help.

Try This..
In the formula columns pl/sql place the following:
function cf_1Formula return number is
num number;
begin
num := log(sal, 10);
return ( num );
end;
-- cf_1 is the formula col name
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
If I write the following SQL statement at the SQL prompt, it works :
SELECT LOG(sal,10) FROM emp ; But, if I write a similar statement in the formula column of a report, then it does not work :
SELECT LOG(sal,10)
INTO x_variable
FROM emp
WHERE empno = :empno ;
return (TRUE) ;
It would be great if someone can help. <HR></BLOCKQUOTE>
null

Similar Messages

  • Using the IF function with a range of numbers

    I am working with the IF function and trying to get it to work "if" the number I'm examining is within a range of numbers.
    Example:
    If a wigit costs between $1000 and $1999, then a discount of $100 is given
    If a wigit costs between $2000 and $2999, then a discount of $150 is given
    If a wigit costs between $3000 and $3999, then a discount of $225 is given
    And so on.
    If cell A1 always holds the current cost of the wigit being sold.
    cell B1,B2,B3 holds the value of the discount values respectively.
    In cell C1 I would like to return what the current discount value is to be given for the wigit price in cell A1?
    How do I do this using the IF function or is there another way?
    Thanks,
    Ryan

    HI Ryan,
    In this post you have, except for the issue noted by Badunit, the basis for the discount table described by Wayne:
    I'm trying to devise a way of knowing what Cash Card a customer will receive depending on the amount of the purchase, based on the following table:
    $0         to $999 purchase         =      $50 Cash Card
    $1,000 to $1,999 purchase     =     $100 Cash Card
    $2,000 to $2,999 purchase      =     $200 Cash Card
    $3,000 to $3,999 purchase      =      $300 Cash Card
    $4,000 to $4,999 purchase      =      $400 Cash Card
    $5,000 to $5,999 purchase      =     $550 Cash Card
    $6,000 to $6,999 purchase     =      $700 Cash Card
    $7,000 to $7,999 purchase      =     $850 Cash Card
    $8,000 to $8,999 purchase     =      $1,000 Cash Card
    $9,000 to $9,999 purchase     =     $1,200 Cash Card
    $10,000 to   UP   purchase     =     $1,500 Cash Card 
    To take care of the issue noted by Badunit, you need to revise the top line to state the minimum purchase necessary to earn a cash card, then add a line above that to handle purchases under that amount. I've arbitrarily chosen a $500 minimum, which results in these two lines:
    $0             to $499 purchase        =      $0 Cash Card
    $500         to $999 purchase         =      $50 Cash Card
    To write this as Wayne's table, you need to remove all of the text (including the $ currency markers), the top end of each range, and the = sign. What you're left with is two columns of numbers: The bottom number of each range of values, and the number telling the dollar amount of the cash card for that range. Here's your table, edited to make it work with LOOKUP:
    Here is a second table (Main), containing only the labels and the two cells involved in the calculation of the cash card amount. The Purchase amount is the amount used in your example. The Cash Card amount is produced by the LOOKUP formula below the image.
    Purchase price is in cell B1 of the table "Main". The LOOKUP formula is in B2:
    B2: =LOOKUP(B1,CC Amt :: A,CC Amt :: B)
    LOOKUP acts essentially as you request in your post containing the iPad image with the time shown as 1:46. But it takes a much simpler approach.
    Here's the syntax:
    LOOKUP(search-for,search-where,return-from)
    LOOKUP gets the search-for value (2535) from cell B1.
    It looks in column A of the table "CC Amt" for the largest value less than or equal to the search-for value, and finds 2000.
    It returns the value from the same line of column B (200).
    Below are two more examples. Main-2 and Main-3 are copies of the Main table. Both contain exactly the same formula as Main, but have had a different Purchase price amount entered. LOOKUP uses the same CC Amt table as is used above, and returns the appropriate Cash Card value for each of the two new amounts:
    You may, as implied in your 1:46 post, use a pair of cells to calculate the Cash Card amount for each widget in the purchase, then total the Cash Card amounts, or you may use a single pair of cells, one containing the total purchase amount, the other containing the Cash Card amount due for that total. That choice is yours. The formula is the same for either case.
    Regards,
    Barry

  • Procedure to use the COPY function in Realignment

    Hi Gurus,
    Can anyone explain me the sequential procedure to use the COPY function in the Realignment...
    Thanks

    Hi,
    In the Realignment start screen, you can set the flag u201CActivate Application Logu201D. This will help you to see and analyze  the log.
    Please check if you can see the copy step.
    When you click u201CMaintain Entriesu201D , you will see the screen of u201COverview of Copy Tableu201D.
    Therein you should see the steps you have maintained.
    Check the Step Status . It should be u201CCope Step is ready to be performedu201D.
    The validity date (fourth column) should be either todays date or earlier date.
    Copy Validity Date:The validity date from which a copy step is taken into account during a copy run. Only copy steps  whose validity date is before the date of the copy run job are taken into account.
    Regards
    Datta Kadam

  • How to use the CMS functionality in Sun Portal Server 7.2

    Hi All,
    How to use the CMS functionality using the ccd.war(Portlet) which is available in the library as i could add it to my channel but not able to show the functionality as it is showing the error msg "You are currently not logged in. Please login." should I create userid and there respective roles inorder to use the CMS functionality.
    Has any one used this as I could this in glass fish server.
    Any Input is appreciated.
    Thanks & regards
    Srikanth

    Have a look at the "*Roles*" section of the portal server 7.2 content management system guide
    http://docs.sun.com/source/820-4275/index.html . You can also look at [project mirage|https://mirage.dev.java.net] for some screencasts
    Alternatively,
    1. ccd.war has 3 portlets in it:
    (a) custom content definition portlet
    (b) custom content portlet
    (c) workflow portlet
    2. Inorder to work with these portlets, user needs to be in anyone of the below roles:
    (a)Consumer (b) Editor (c) Approver (d) Administrator (e) Submitter (f) Contributor (g) Publisher
    3. By default ccd.war gets deployed using a default roles file (/var/opt/SUNWportal/tmp/ccd.roles.properties)
    Note: In windows, you may not find this file
    4. Access the portlets as a user in any of the role mentioned in the ccd.roles.properties
    (OR)
    you can use a new roles file which has mapping to your custom roles. For this , undeploy existing ccd.war and deploy again with a new roles.properties file
    Hope this helps!

  • How can I use the "EvalScript()" function? I am trying to send text to a Director app from the web browser, but the console in the browser just responds "Uncaught ReferenceError: evalScript is not defined ".

    I am trying to control a Shockwave app form another machine, using "Pusher" service (websockets), and everything is ok so far; but when I try to send the shockwave app the text recieved from another machine, using the "EvalScript()" function (as documented), I only get the message "Uncaught ReferenceError: evalScript is not defined" in the browser's console. What am I doing wrong?
    'm using the following script in the webpage where the shockwave object is located:
      <script type="text/javascript">
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) {
            window.console.log(message);
        var pusher = new Pusher('abc963cf3e6g678879e');
        var channel = pusher.subscribe('Galileo_channel');
        channel.bind('Galileo_event', function(data) {
          evalScript(data.message);
      alert(data.message);
      </script>
    The "alert" is working fine, but I can't get JavaScript to recognize the EvalScript (I even tried calling the shockwave object, ie: "extev01.evalScript()", since the object's ID is extev01, but it doesn't work, either).
    Help!

    Thanks Sean.
    I tried your suggestion first, using getNetText to poll the server and read a text file. The drawbak is that I had to poll the server constantly, since I could not know in advance when the text file was going to change (and it's not practical to stump the server and connection).
    I've kept trying the EvalScript, asigning the Shockwave object to a variable first, then calling the EvalScript() in the object, but it doesn't work, either. I think I will simply use JavaScript and forget about shockwave altogether, since everything is working fine up to that point (although it would be nice to be able to use Lingo for the rest of the app).

  • How to use the RV_EXPORT_CONTROL function (via 2LIS_11_VAITM extractor)

    Hi guys,
    I use the 2LIS_11_VAITM extractor to load R/3 data to BW.
    On this extractor, there is an user exit which filled many fields.
    I have to add the export control status of items, the value we can find in VA03 (Extras -> Export Licence -> Log -> Status green or Red).
    I added a specific fields ZZEEXPCTRL (CHAR(1)) in my extraction structure as a field only know in Customer exit.
    This flag will be empty if status is green or 'X' if status is red.
    I'll try to use the RV_EXPORT_CONTROL function in my exit but it doesn't work.
    When I execute in debug the 2LIS_11_VAITM extractor in RSA3, I can display the screen we have in VA03 (Extras -> Export Licence -> Log -> Status green or Red).
    Maybe I use the bad parameters ?? But I tried many option, without result
    Could you please help me and explain me how to use this function to have my result or if there is another way to do this ?
    Thanks
    Joris

    Hi Namrata and Debjani,
    Thank you for your suggestion. We are considering those options as well.
    However, we are trying to aim for consistency between the "old" and the upgraded system. Therefore we are trying to find whether it is all possible to remove those two fields. If it is not possible at all to remove them, then we will do what you both suggested.
    Best regards,
    Fen

  • Certain LinkedIn functions are not working. Browser keeps on looping, for instance when using the search function

    I go to LinkedIn and type in a name in the search box, for instance "Peter" and hit enter.
    Normally, this will return with a list of people with the first name "Peter", listed according to degrees connectivity.
    Instead the web site never loads the next page. It appears that it keeps loading the page over and over again, but with no result.
    In the end I have to press back or use another browser (Safari) to load the page and use the search function.

    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    1. Bypass Firefox's Cache
    Use Command+Shift+r to reload the page fresh from the server. Any difference? If not...
    2. Clear Firefox's Cache Completely
    Edit > Preferences > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    3. If needed, remove your linkedin.com cookies
    While viewing a page on the site:
    Tools > Page Info > Security > "View Cookies"
    Remove each cookie then try reloading the page. You probably will need to log in again. Does that help?

  • Using the lookup function in Numbers '09

    I'm looking for the way to have the lookup function in Numbers '09 return an error for a non-exact match.  Eg. I want an invalid part number to state this, but currently all I can get is the return of data for the closest match.  Thank you.

    when you use the VLOOKUP() function the last, optional, argument can request and exact match.  When an exact match is not available VLOOKUP() will return an error.
    you can use the IFERROR() function to trap errors like this:
    =IFERROR(<FUNCTION_TO_TRY>, "NOT FOUND")
    In your case.... if <FUNCTION_TO_TRY> is you VLOOKUP(<WHAT_TO_FIND>, <RANGE>, <COLUMN>, 0), the "0" specifies exact match and you could then place all this in the IFERROR() like this:
    =IFERROR(VLOOKUP(<WHAT_TO_FIND>, <RANGE>, <COLUMN>, 0) "NOT FOUND")
    <WHAT_TO_FIND> is what to look for,
    <RANGE> is where to look,
    <COLUMN> is the number of the column in the range you want to return

  • Using the SVDEx function in LabWindows​CVI

    Hello,
    I am writing an application in LabWindows CVI to display and analize data that we obtain in an optical experiment.  The data is a matrix where the subsequent rows represent spectra collected a different times. There are about 200 columns and 100 rows in each matrix. I want to use singular value decomposition using the  SVDEx function. I get an error every time i try to execute the code in debugguing mode:
    FATAL RUN-TIME ERROR:    The program has caused a 'General Protection' fault at 0x0342BC16.
    I believe that I am passing the incorrect arrays to SVDEx. I  was wondering if there is any example code available, so I can learn how tro do do this.
    Here is a fragment of the code where I call the function SVDEx:
    //declare the arrays to hold S U V
    double *U,*S,*V;
    int isizeS=Y_DATA_POINTS;
    int i;
    int AnalisisError=0;
    if (X_DATA_POINTS<Y_DATA_POINTS) {isizeS=X_DATA_POINTS;}
    //Allocate arrays
    U=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    S=malloc(2*isizeS*sizeof(double));
    V=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    AnalisisError = SVDEx (adAbsMap, Y_DATA_POINTS, X_DATA_POINTS, FULL_SIZE, U, S+isizeS, V);
    FATAL RUN-TIME ERROR:   "Visualize_12.c", line 2451, col 17, thread id 0x00000E18:   The program has caused a 'General Protection' fault at 0x0342BC16.
    Any help will be very much appreciated.
    J. Hodak

    Hi,
    Thanks for trying to find an answer. I just realized now where the probem was. My mistake was when i allocated the arrays for holding the matrices. Because i was assking SVDEx to carry out FUL SIZE decomposition I must declare the arrays U and V to be , Y_DATA_POINTS*, Y_DATA_POINTS doubles and X_DATA_POINTS*, X_DATA_POINTS doubles respectively. My code was wrong, I was declaring the sizes to be smaller than necessary and  "Visualize_12.c", line 2451, was the call to SVDEx, and col 17 was pointing t that mistake. It took me a while to realize this because the error message did not exlicitly specify that the size or the array passed was too small. Now it is working well. But I believe that it will help to have an example to get started with this.
    Thanks again,
    Fundadero.

  • Using the Ago Function

    Hi,
    I have a time dimension with levels AllTime, Year, Month, Week, Day. I set the chronological key to the day and created an Ago Measure in my fact. The repository global consistency was successful. However when I used it in answers, I got the following error message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22040] To use AGO function, the storage level of the query ('[DIM_DATE.DIMENSION_KEY]') must be a static level. (HY000)
    SQL Issued: SELECT DIM_DATE.CALENDAR_YEAR_NAME saw_0, F_TEST.MEASURE saw_1, F_TEST.YearAgoMeasures saw_2 FROM WMS ORDER BY saw_0
    Does anyone have any idea please? Note that the DIM_DATE.DIMENSION_KEY is the primary key of the time dimension table.
    Thanks a lot
    Marija

    Hi Wildmight,
    I restarted everything and got the "must be a static level. (HY000)" error fixed. Then I checked the chronological key in the level "year" but it seems not to be working. It's taking a long long time to show the results (I finally cancel it).
    Reviewing the nqquery log file, I don't really get how obi retrieves the todate info, it uses the analytic function: ROW_NUMBER() OVER (partition by....), do you get the same?
    Thanks again.

  • Using the MSG_* Function Modules

    Hello,
    I want to use the MSG_* function modules (e.g. MSG_OPEN, MSG_ACTION ...) and the MAC_MSG_* macros in my own programs, but they are not documented. Are there any docs about it?
    Regards
    Stefan

    Hi,
    Check this link
    http://wwwcs.uni-paderborn.de/cs/heiss/lehre/pg/intern/docs/bc_xbp_45.pdf
    Also see Re: Read Application Log
    Thanks & Regards,
    Judith.

  • Rounding down using the floor function

    I need some help rounding down to the nearest 5 using the floor function.
    My code appears to be correct but I'm not getting the wrong result.
    create or replace
    TRIGGER "SALE_CALC" BEFORE
    INSERT OR
    UPDATE ON Prs FOR EACH Row
    BEGIN
    :New.Prsvf9c := (floor((:New.Prsprsc - :new.prsvf1c)/5)*5);
    END;
    *:New.Prsprsc = 100.00 and :new.prsvf1c = 46.00*
    After the trigger executes I get a result of *54.00*, which is the result before the rounding should take place. The result should be *50.00!*
    What am I doing wrong?

    The code you posted appears to produce the results you expect if the data is what you say it is
    SQL> create table prs(
      2    Prsvf9c number,
      3    Prsprsc number,
      4    prsvf1c number
      5  );
    Table created.
    SQL> create or replace
      2  TRIGGER "SALE_CALC" BEFORE
      3  INSERT OR
      4  UPDATE ON Prs FOR EACH Row
      5  BEGIN
      6
      7  :New.Prsvf9c := (floor((:New.Prsprsc - :new.prsvf1c)/5)*5);
      8
      9  END;
    10  /
    Trigger created.
    SQL> insert into prs( Prsprsc , prsvf1c )
      2    values( 100, 46 );
    1 row created.
    SQL> select * from prs;
       PRSVF9C    PRSPRSC    PRSVF1C
            50        100         46If you're seeing something different, it would be very helpful if you did something like I did here and post a reproducible test case.
    Incidentally, I'm not sure why you would have columns named prsvf1c and Prsvf9c but if that implies that you've denormalized your table to store 9 values rather than creating a child table with up to 9 rows, that's unlikely to be a reasonable solution.
    Justin

  • Adding two cells using the Offset function

    Hi There, I would like to use the Offset function to add the value of the cell just to the left of the current cell to the one dirrectly above the current cell. I would also like to do this without using an absolute referance for the base cell
    For example the normal SUM formula would be =SUM(A2+B1) with the base cell being B2
    Hope that's clear enough, thanks in advance
    Ali

    Ali,
    Before answering your question, I'll comment that adding the value to the left to the value just above, with cell B2 being where the result would be displayed would normally be programmed as:
    =A2 + B1
    The use of the SUM function is completely unnecessary. It won't hurt, but there is no reason to use SUM.
    Using OFFSET, you would write:
    =OFFSET(B2, 0, -1) + OFFSET(B2, -1, 0)
    In this case, B2 is a relative reference, not an absolute reference.
    Jerry

  • How to log to a file using the log-configuration.xml?

    Hello *,
    I created following log-configuration.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
    <log-configuration>
         <log-formatters>
              <log-formatter name="DefaultFormatter" pattern="%25d %-60l %s: %m" type="TraceFormatter"/>
         </log-formatters>
         <log-destinations>
              <log-destination count="10" effective-severity="ALL" limit="1000000" name="DefaultDestination" pattern="FDLB_GUI.%g.trc" type="FileLog">
                   <formatter-ref name="DefaultFormatter"/>
              </log-destination>
         </log-destinations>
         <log-controllers>
              <log-controller effective-severity="ALL" maximum-severity="FATAL" minimum-severity="DEBUG" name="DefaultController">
                   <associated-destinations>
                        <destination-ref association-type="LOG" name="DefaultDestination"/>
                   </associated-destinations>
              </log-controller>
         </log-controllers>
    </log-configuration>
    From a Web Dynpro view I want to use the log-controller. I'm using the default logger:
    Logging location.
      private static final com.sap.tc.logging.Location logger =
        com.sap.tc.logging.Location.getLocation(EinstiegView.class);
    In the wdInit method I want to log a simple message:
      public void wdDoInit()
        //@@begin wdDoInit()
        logger.setEffectiveSeverity(com.sap.tc.logging.Severity.ALL);
        logger.fatalT("test logging to new file logger");
        //@@end wdDoInit()
    I see the message in the defaultTrace.0.log, but my own log file doesn't appear.
    How to address the log-controller of my log-configuration.xml?
    Thanks in advance,
    Jürgen Dufner

    Hi,
    I guess the follwing part of your log-configuration is wrong:
    <log-controller
    effective-severity="ALL"
    maximum-severity="FATAL" m
    nimum-severity="DEBUG"
    name="DefaultController">
    Try to change in log-configuration the value for name in <log-controller> to the start sequence of the packages to be logged. E.g., all our packages should start with com.yourcompanyname.projectname
    To log all messages from classes in these packages make the name = com.yourcompanyname.projectname.
    Hope that helps,
    Regards, Astrid
    Therefore I list

  • How to use the Table Function defined  in package in OWB?

    Hi,
    I defined a table function in a package. I am trying to use that in owb using Table function operator. But I came to know that, owb R1 supports only standalone table functions.
    Is there any other way to use the table function defined in a package. As like we create synonyms for functions, is there any other way to do this.
    I tryed to create synonyms, it is created. But it is showing compilation error. Finally I found that, we can't create synonyms for functions which are defined in packages.
    Any one can explain it, how to resolve this problem.
    Thank you,
    Regards
    Gowtham Sen.

    Hi Marcos,
    Thank you for reply.
    OWB R1 supports stand alone table functions. Here what I mean is, the table fucntion which is not inculded in any package is a stand alone table function.
    for example say sample_tbl_fn is a table function. It is defined as a function.It is a stand alone function. We call this fucntion as "samp_tbl_fn()";
    For exampe say sample_pkg is a package. say a function is defined in a package.
    then we call that function as sample_pkg.functionname(); This is not a stand alone function.
    I hope you understand it.
    owb supports stand alone functions.
    Here I would like to know, is there any other way to use the functions which are defined in package. While I am trying to use those functions (which are defined in package -- giving the name as packagename.functionname) it is throwing an error "Invalid object name."
    Here I would like know, is there any other way to use the table functions which are defined in a package.
    Thank you,
    Regards,
    Gowtham Sen.

Maybe you are looking for

  • Sites ending with .gov.sg appear to be blocked. How do I gain access?

    I have not been able to access these sites for 2 days. The sites are actually up, I can still access them from my AT&T smartphone. So Verizon appears to be blocking them. I regularly need to access these sites, so I would probably need to change prov

  • Mobile Network dropping and automatically not turning back on

    My blackberry looses its signal in basement car parks or lifts and will not automatically swictch back on. Is there any solution to this issue

  • After Software Update, asked to choose printer?

    My daughter cannot troubleshoot. She install everything when prompted by Software Update, including 10.4.8. Her printer is now not working. She is finally telling me at some point she was "asked to choose a printer". She stated she did not see her pr

  • WEP issue

    Hi, I am running a Brand new MBP 2.4 duo 160gig When I try to connect to the wireless office network it times out instantly. Password is good (Hexidecimal 64 BIT) Tried it again with a character wrong and it immediately told me that the passkey was w

  • Dad needs help with setting up shuffle on different account

    Hi all ..I have a daughter with a Ipod video, and a wife with a Ipod shuffle. How can I make them work with different itune libarys on the same computor? The ipod video side is all set up. I need to get the shuffle up and running. I opened another us