Need help to debug a function

Hi people,

Can someone please report the error to the next PL/SQL function

Environment: Oracle 10g (Rel 2)

Error message:

SQL > show errors
Errors for the SECTIONS_TAUGHT FUNCTION:
* 13/3 PL/SQL: statement ignored *.
* 13/7 PLS-00320: the declaration of the type of the expression is incomplete or incorrect *.

Code:

SET SERVEROUTPUT ON;

FUNCTION to CREATE or REPLACE sections_taught
* (i_instructor_id IN section.instructor_id%TYPE)*
RETURN VARCHAR2
AS
v_sections_taught NUMBER;
v_status VARCHAR2 (100);
BEGIN
SELECT count (). *
IN v_sections_taught
ARTICLE
WHERE INSTRUCTOR_ID = i_instructor_id;

IF (v_sections_taught = > 3)
THEN
v_status: = ' instructor: ' | i_instructor_id |' sign '. v_sections_taught | "sections" and needs a break;"
ON THE OTHER
v_status: = ' instructor: ' | i_instructor_id |' sign '. v_sections_taught | 'elements '.
END IF;

RETURN v_status;
EXCEPTION
WHILE OTHERS
THEN
v_status: = ' there is an error in the function ".
RETURN v_status;
END;
*/*

DESC SECTION;

Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
SECTION_ID NOT NULL NUMBER (8)
COURSE_NO NOT NULL NUMBER (8)
SECTION_NO NOT NULL NUMBER (3)
START_DATE_TIME DATE
LOCATION VARCHAR2 (50)
INSTRUCTOR_ID NOT NULL NUMBER (8)
CAPACITY NUMBER (3)
CREATED_BY NOT NULL VARCHAR2 (30)
CREATED_DATE NOT NULL DATE
MODIFIED_BY NOT NULL VARCHAR2 (30)
MODIFIED_DATE NOT NULL DATE

Thanks in advance

rogers42

Hello

Is the more-than-or-equal operator to > =,-not online.
On line 13, I think you meant:

IF (v_sections_taught >= 3)

Tags: Database

Similar Questions

  • Newbie need help with string concatenation function.

    I'm totally new to LabView and am trying to work on a project that someone worked in the past.  I came to a string function concatenated on one of the existing provisions and only seen on some entries of the string function has an order of 'rel' and 'g '.  I don't know if it's a common command or what it is.  This is VI is that it requires a user to enter a base dimension (x-axis starting point and end point) and executes the steps in the sample desired within the "point of departure" and "end point".  "a3" is the name of the x-axis.  but I'm not sure of the meaning 'rel' and 'g '.  I posted part of the diagram.  Any help would be appreciated.  Thank you!

    This isn't a question of LabVIEW, but very specific to the device connected to the other end of the serial port. Do you have any documentation for it?

    Basically, the program needs form a consiting of command of a delimiter character, value and end of key word, etc. for example.

    Who wrote this program. It seems too complex and convoluted. Under certain conditions, it seems to send two commands at the same time, and there is no way to determine the order in which they run. Maybe it doesn't matter, but maybe it does. Most likely, what you need is a single structure dealing with a case for each condition and a unique series in the end writing. You can reach the actual program? There are also a lot of duplicate code. What is the purpose of the operations 1 x? Is this a Subvi?

  • Need help with the listagg function

    Hi all

    I try to use Listagg in the query below, but not able to get the answer. It is throwing an error message saying ORA-00979: not a GROUP BY expression.

    If I try to remove the Group By function and run the query, I get the following error ORA-00937: not a function of simple-group.

    Help, please.

    Select Distinct V.User_X, V.Original_Request_Id, (V.Support_Group_Name, ',') listagg Group (order of V.Support_group_name) as Group1,

    T.Individualassignedto, T.Status, T.Groupassignedto, T.Ticketcategory, T.Tickettype, T.orgcompany, T.submitter,

    T.Orgassignedto, T.Urgency

    Display V

    INNER JOIN K_TICKET T ON T.TICKETNUMBER = V.ORIGINAL_REQUEST_ID

    V.Original_Request_ID group

    Because you use a GROUP BY, you don't need SEPARATE.

    All the columns you are not aggregate (list) should be in the GROUP BY.

  • New to pix, need help with "debug access list of all the" command

    I have a pix 515 v6.3. I am tring to use then "debug access list of all the" command to see what traffic is stopped by my access list. However, I don't get any output. I turn execution of the command, but nothing happens. Other debug commands give the console. Perhaps, I do not understand what "debug to access list of all the" is used for. Any help that can be provided would be greatly appreciated.

    Tim

    Also try following the commands of logging

    LOGG on

    LOGG buff 7

    term Lun

    M.

  • Need help with the analytical function select maximum and minimum of the results of the column

    Hey there OTN.

    I have an interesting application that I was hoping you would be able to help me with. I have a requirement to conditionally select the max and min of a column in bi-editor and since my editor works from an OBIEE analysis, I need store MAX and MIN of the column values in separate columns to match with. See the example below. You will notice that there are 4 stores including today's sales. I must have OBIEE through all the results of the column for sales, then choose the max of the dataset object. I can't use MAX here because he will choose the MAX of the line which will return only sales of this line. Instead, one must analyze all sales results and choose the appropriate column. Any idea on how to do this in OBIEE/publisher? Or is this not possible.

    Day Store Sales Sales of MAX Sales MIN
    05/11/15Store 1500080001000
    05/11/15Store 2750080001000
    05/11/15Store 3100080001000
    05/11/15Store 4800080001000

    I'm waiting for your answers. Thanks in advance!

    PS: I will always mark messages that are useful and eventually mark it as correct answer if we come to a resolution!

    See you soon.

    You can't do the same thing with RANK ("dirty")?

    Rank ("dirty") = 1: the max value in the result of sales

    RANK (-1 * "Sales") = 1: the min in the result of sales value

    I guess you can and then format the cells based on these values, where a value of 1 is the max or min according to the RANKING formula you used...

  • Need help with the analytic function

    I want to get the highest employee details and the 2nd highest employee for a particular service. But also the Department should have more than 1 employee.
    I tried the query and it gave me the correct results. But I wonder if there is another solution than to use the subquery.

    Here is the table and the query result:
    with t as
    (
    select 1 emp_id,3 mgr_id,'Rajesh' emp_name,3999 salary,677 bonus,'HR' dpt_nme from dual union
    select 2 ,3 ,'Gangz',4500,800,'Finance' from dual  union
    select 3 ,4 ,'Sid',8000,12000,'IT' from dual  union
    select 4 ,null,'Ram',5000,677,'HR' from dual  union
    select 5 ,4,'Shyam',6000,677,'IT' from dual union
    select 6 ,4 ,'Ravi',9000,12000,'IT' from dual   
    )
    select * from 
    (select emp_id, mgr_id, emp_name, dpt_nme, salary, row_number() over (partition by dpt_nme order by salary desc) rn from t where dpt_nme in 
    (select dpt_nme from t group by dpt_nme having count(*) > 1)) where rn < 3

    Hello

    You need a subquery, but you don't need more than that.
    Here's a way to eliminate the additional subquery:

    WITH     got_analytics     AS
    (
         SELECT  emp_id,     mgr_id,     emp_name, dpt_nme, salary
         ,     ROW_NUMBER () OVER ( PARTITION BY  dpt_nme
                                   ORDER BY          salary     DESC
                           )         AS rn
         ,     COUNT (*)     OVER ( PARTITION BY  dpt_nme
                                       )         AS dpt_cnt
         FROM     t
    )
    SELECT  emp_id,     mgr_id,     emp_name, dpt_nme, salary
    ,     rn
    FROM     got_analytics
    WHERE     rn     < 3
    AND     dpt_cnt     > 1
    ;
    

    Analytical functions are calculated after the clause WHERE is applied. Since we need to use the results of the analytical ROW_NUMBER function in a WHERE clause, which means that we have to calculate ROW_NUMBER in a subquery and use the results in the WHERE clause of the main query. We can call the COUNT function analytical in the same auxiliary request and use the results in the same WHERE clause of the main query.

    Would what results you if there is a link for the 2nd highest salary in some Department? For example, if you add this line to your sample data:

    select 7 ,3 ,'Sunil',8000,12000,'IT' from dual  union
    

    ? You can use RANK rather than ROW_NUMBER.

  • Need help to debug the ACL

    Hi people,

    I'm trying to set up an access control list. So that I can access with success the service network as user sys, but not as long as the user test1.

    I was just wondering, if anyone can be able to take a look at my code and point out my error.

    DB version: * 11.2.0.1.0 *.
    Platform: Windows 7 (64-bit)

    Creation of ACL code:
    # Create a user
    CREATE USER test1 IDENTIFIED BY xxxxxx;
    GRANT CONNECT TO test1;
    
    
    # Create the ACL
    BEGIN
      dbms_network_acl_admin.create_acl (
        acl                  => 'test_acl_file.xml',
        description          => 'A test of the ACL functionality',
        principal            => 'TEST1',
        is_grant             => TRUE,
        PRIVILEGE      => 'connect',
        start_date           => SYSTIMESTAMP,
        end_date        => NULL);
        
      COMMIT;
    END;
    /
    
    # 
    BEGIN
      dbms_network_acl_admin.assign_acl (
        acl       => 'test_acl_file.xml',
        host      => 'dbaexpert.com',
        lower_port  => NULL,
        upper_port  => NULL);  
        
    END;
    /
    Test results:
    User: sys
    
    SELECT utl_http.request('http://www.dbaexpert.com')
    from DUAL;
    
    Output:
    
    UTL_HTTP.REQUEST('HTTP://WWW.DBAEXPERT.COM')                                                                                                                                                                                                   --------------------------------------------------------------------------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml"><head>                                                                                                                                                                                                                                                                       ...... 
    </head>
    User: test1

    The statement above as a user 'test1 '.
    Output:
    
    Error starting at line 1 in command:
    SELECT utl_http.request('http://www.dbaexpert.com')
    from DUAL
    Error report:
    SQL Error: ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1722
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at line 1
    29273. 00000 -  "HTTP request failed"
    *Cause:    The UTL_HTTP package failed to execute the HTTP request.
    *Action:   Use get_detailed_sqlerrm to check the detailed error message.
               Fix the error and retry the HTTP request.                                                       
    Validation test:
    select ACL,
           PRINCIPAL,
           privilege,
           IS_GRANT
    from DBA_NETWORK_ACL_PRIVILEGES;
    
    Output:
    
    ACL||','||PRINCIPAL||','||PRIVILEGE||','||IS_GRANT  
    /sys/acls/test_acl_file.xml,TEST1,connect,true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
    Thanks in advance

    rogers42

    Hello

    www.dbaexpert.com differs from dbaexpert.com ACL configuration must match exactly, host names

    Greetings,

    Damage ten Monkshood

  • Need help with rewrite PLSQL function EVALUATE

    Hi all

    I'm trying to convert some PLSQL (from Discoverer) in a column of answers and I can't seem to get the correct formula.

    The original formula:
    MIN (Processed_Date) MORE (SCORE OF Business_Area, product, Serial_No)

    I guess that this must be done in an evaluation function, but I can't work on the correct syntax.

    This formula:
    Evaluate ('MIN (%1) OVER (PARTITION OF 2%, 3%, 4%)) ", Business_Area, Processed_Date, Serial_No, product)
    Has generated this error:
    [nQSError: 10058] A general error occurred. [nQSError: 22027] Union of incompatible types. (HY000)

    I do not know what causes the error, and tried casting explicitly throughout the column, but still getting errors.


    I am open to any suggestion.

    Thank you.

    Published by: jasonr on Dec 14, 2010 09:54

    Jasonr,

    highlighted in bold is the change
    Try this EVALUATE ('MIN (%1) OVER (PARTITION OF 2%, 3%, 4%)) AS the DATE, Processed_Date, Business_Area, product, Serial_No)
    update if it solved your problem.

    -bifacts
    http://www.obinotes.com
    J

    Published by: bifacts on December 14, 2010 21:52

  • Need help for debugging CSS for IE6 and IE7

    I'd appreciate anyone with a bit of free time to give another pair of eyes. I tried a number of hacks found on this forum and other places to ensure that IE plays well with this site of two columns, I've been thinking, but according to BrowserLabs, there are still problems with IE6 and IE7. Naturally, all other browsers, including IE8 (!), goes as planned.

    The initial attempt, I settled on is here: http://www.patriciayoungquist.com/pages/public/welcome.html . (This page is representative, as all other internal pages are built the same way.) According to BrowserLabs, pageContent and copyright divs rather than show beside and below (respectively) drop-in IE6 and IE7. I still think there's a simple solution here, but I was not able to hit on him

    So I started a new model and CSS to see if I could work out another way and came with http://www.patriciayoungquist.com/pages/test/PYPAtemplate.html . Curiously, this still works in all and now works in IE6 but not in IE7. In IE7, the sidebar is displayed on top of the pageContent.

    I don't know there is something obvious that I'm missing. Work in CS4, and I know the pages validate. So, if anyone has any suggestions, I'd like to try.

    Thank you

    Chris

    Using your first link as an example, I see several things that are not fair.

    (1) do not use positioning.  For the majority of your layout of the site, you must use default CSS that is not positioning at all.

    (2) a fixed positioning does not work in older IE on any container except the body.  It's playing havoc with your left sidebar.  Solution is to remove position: fixed and replace by float: left.  In addition, you may need to add a clearing for your footer float.

    (3) height is a restriction.  Remove height of containers with text in them.

    (4) to align elements on the page, use the margins, padding, or floats - not absolute, fixed or relative positioning.

    Learn CSS positioning in 10 easy steps-
    http://www.Barelyfitz.com/screencast/HTML-training/CSS/positioning/

    Float tutorials-

    http://CSS.maxdesign.com.au/Floatutorial/

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • Need help with the INSTR function

    I try to use SUBSTR and INSTR function to parse a variable without breaking to the top of the variable. As you can see that the problem is space, negotiating
     
    DECLARE
         blank_space NUMBER(2);
         full_name VARCHAR2(30) := 'Robert P. Simmons');
         first_name VARCHAR2(30);
         last_name VARCHAR2(30);
         
    BEGIN 
         blank_space := INSTR(full_name, ' ');
         first_name := SUBSTR(full_name, 1, (blank_space -1));
         DBMS_OUTPUT.PUT_LINE( 'Your first name is ' || first_name);
         last_name := SUBSTR(full_name, (blank_space + 1),
         (LENGTH(full_name) - blank_space));                
         DBMS_OUTPUT.PUT_LINE( 'You have ' || 
         LENGTH(last_name) || ' characters in your last name!');
         
    END;     
    How can I enter the number of characters in name only? It lists just to the right of the 1st blank_space.

    Thank you
    SQL> declare
       blank_space   number (2);
       full_name     varchar2 (30) := 'Robert P. Simmons';
       first_name    varchar2 (30);
       last_name     varchar2 (30);
    begin
       blank_space := instr (full_name, ' ');
       first_name := substr (full_name, 1, (blank_space - 1));
       dbms_output.put_line ('Your first name is ' || first_name);
    
       dbms_output.put_line ('You have ' || length (substr (full_name, instr (full_name, ' ', -1) + 1)) || ' characters in your last name!');
    end;
    /
    Your first name is Robert
    You have 7 characters in your last name!
    PL/SQL procedure successfully completed.
    
  • Need help with debugging collection in bulk and loop forall

    Hi people,

    I was wondering if someone can look at my PL/SQL code and tell me where I'm wrong.

    Environment
    =========
    10g (Rel 2)

    Algorithm of
    =======

    A slider lets collect records
    The data block
    Bulk insert the data into a table

    Implementation
    ==========

    Set serveroutput on;

    declare

    cursor source_cur is
    Select * from
    from t1;

    -Define the variables and collection types to be used by the BULK COLLECT clause

    source_data_type type is the table of the source_cur % rowtype;

    source_data_table source_data_type;

    Start

    Open source_cur;
    loop
    extraction source_cur
    bulk collect into source_data_table;

    When the output source_data_table.count = 0;

    -Now, we print the data collected
    -for i in source_data_table.first... source_data_table. Last
    -loop
    -dbms_output.put_line (' company name: ' | source_data_table (i).) Company);
    -dbms_output.put_line ('Count: ' | source_data_table.) (COUNT);
    -end loop;
    end loop;
    close source_cur;


    Note: The statements above Print print the correct data and County

    -Now, bulk insert us the data into the target table

    dbms_output.put_line ('Count: ' | source_data_table.) (COUNT);

    Note: The print statement above indicates a number 0 =. Since there is no available record, FORALL loop below will not insert anything in the table

    ForAll idx in source_data_table. FIRST... source_data_table. LAST
    Insert into T2
    source_data_table (idx) values;
    end;
    /


    Thanks in advance

    rogers42

    You'll want to do something like this

    open source_cur;
    loop
    fetch source_cur
    bulk collect into source_data_table;
    
    exit when source_data_table.count = 0;
    
    forall idx in source_data_table.FIRST .. source_data_table.LAST
    insert into T2
    values source_data_table(idx);
    end loop;
    close source_cur;
    

    or even better:

    insert into target
    select col, col, col
      from source
    

    no need to COLLECT in BULK and FORALL
    ;)

  • Need help with the DECODE function

    Hello

    I try to use by default within the decode service and whenever I get a missing expression. I searched everywhere and can not know what I am doing wrong. Thank you

    Select decode (request_id, 0, "no file found", by DEFAULT)
    select decode (request_id,0,'No files found', request_id)...
    
  • Need help with debugging case manipulation statement &amp; date

    Hi people,

    Can you get it someone please let me know what I am doing wrong?

    Select to_date (23-seven.-10', 'DD-MON-yy') expiry_date,.
    TO_DATE (23-sep-09', 'DD-MON-yy') order_date,.
    TO_DATE (23-seven.-10', 'DD-MON-yy')-to_date (23-sep-09', 'DD-MON-yy') diff,.
    (case diff
    When < 365 then 'low '.
    When > 365 then 'high '.
    other 'similar '.
    end)
    Double;


    ORA-00936: lack of expression
    00936 00000 - "missing expression.
    * Cause:
    * Action:
    Error on line: column 5:18


    Thanks in advance

    rogers42

    Here you go

    WITH temp_tab AS
        (SELECT to_date('23-sep-09',      'DD-MON-yy') order_date,
             to_date('23-sep-10',      'DD-MON-yy') -to_date('23-sep-09',      'DD-MON-yy') diff,
             to_date('23-sep-10',      'DD-MON-yy') expiry_date
         FROM dual)
    SELECT(
    CASE
    WHEN diff < 365 THEN 'low'
    WHEN diff > 365 THEN 'high'
    ELSE 'same'
    END)
    FROM temp_tab;
    
  • Need help with the rtrim function

    Hi people,

    Honestly, I'm embarrassed to ask this, but I'm stumped

    Environment: 10 g Rel 2

    Entry:
    14:mm
    where mm can be no matter what integer between 0 and 9

    Desired output:
    I want to preserve the hours and to truncate the colons and minutes
    for example 14

    My attempt of the solution:

    Select rtrim('14:33',':')
    Double;

    Result: 14:33

    I would appreciate assistance from the Member

    rogers42

    Hello

    You can do this in several ways.

    1. If the 14:mm is a varchar2

    select substr('14:10',1,instr('14:10',':')-1) from dual
    

    2. If the 14:mm is a varchar2

    select to_char(to_date('14:10','HH24:MI'),'HH24') from dual
    

    Arun-

  • Help! User-defined function problem.

    Need help on using custom function defined in Essbase. Thanks in advance!

    I have not found a function of depreciation in Essbase, so thought I might create one in Java and save it as a user defined function. However, I can't get this to work.

    Here's what I did:
    1. I created a java class called depreciation.

    public class {depreciation

    public double Adeath (double r, int period, double LoanBalance) {}
    Double LBound = LoanBalance/period;
    Double UBound = LoanBalance;
    Double MBound =(LBound+UBound)/2;
    Double err = 0;
    int i = 0;

    Calculate amortization payment
    {}
    Double MBalance is PVCalc (r, Period, MBound);.
    ERR = MBalance-LoanBalance;
    If (err > 0) {}
    UBound = MBound ;}
    If (err < = 0) {}
    LBound = MBound ;}
    MBound =(UBound+LBound)/2;
    i ++ ;
    }
    While (err > 0.001 | err <-0,001 & & I < = 100);

    return (MBound);
    }


    define the present value
    public static double PVCalc (double rate, NPER, double PMT int) {}
    Double pvpmt = pmt;
    Double cpvpmt = 0;

    for (int j = NPM; j > 0; j-) {}
    for (int i = 1; i < = j; i ++) {}
    pvpmt = pvpmt /(1+rate/12);
    }
    cpvpmt = cpvpmt + pvpmt;
    pvpmt = pmt;
    }
    Return cpvpmt;
    }
    }

    2. copy the .jar to 'C:\Hyperion\AnalysticServices\java\udf '.
    3. has created a new MaxL file and run the script that runs:

    create or replace function '@Amortize' as
    'Amortization.Amort '.
    Spec "@Amortize (spleen, period, balance)"

    It shows: statement executed successfully.

    4 then I tried to test in the following statement:

    If (@isuda ("Time", "Test Date"))
    "Depreciation Payment"=@Amortize (0.06, 360, 10000000);
    endif;

    And I got an error message as below:
    Error compiling formula [amortization payment] (line 2): [)] without [()]

    Could someone help me with this issue? 1 million thanks!

    The udf.policy file is located in the hyperion\products\essbase\essbaseserver\java directory and put the security on the java interface with Essbase points if there is a dev environment you can open the file with Notepad and go to the bottom of it. You will find a line
    permission java.security.AllPermission;

    remove the / / (which comments out) and this will allow all java functions are allowed. After the change, you must restart the service Essbase

Maybe you are looking for

  • Cannot connect by Satellite Pro projector if more than 3-4 m cable

    We have several laptops - and we have never had any problems that they might know an external projector.The length of the cable is normally around 10 m. Our Toshiba Satellite Pro laptops can only connect to an external projector if the cable length i

  • A few Questions on the Qosmio G35-AV650 series

    I have some questions that I would ask to my Qosmio G35-AV650. 1: I've updated the BIOS to v1.4 (2005), to v3.3 (2007), to install Vista.Vista does not work so I removed it - I guess that I need to update the drivers again.In any case, I got my PC to

  • Cannot install Windows xp home edition OEM on the new Macbook Pro

    Hardcopy of XP OEM Home Edition was initially installed in my office, but the PC broke down and I bought a Macbook Pro laptop. However, could not proceed further after necessary press as the rest blue window configuration screen always with no respon

  • How to log on to windows xp sp2 after installation of critical security?

    Dear SirI have installed vital security last week. When I installed it, it is said that to restart or shut down my system so that I restarted. But when my system restarts, I can not connect on my windows with my administrator password. my windows is

  • Wheel/Trackball JDE 4.1

    All, I know this is an old topic, but I still have to find a solution that works. I developed an application that must run on devices both wheel and trackball. Because the wheel devices running OS 4.1, according to RIM, I have to use the JDE 4.1.  Un