Declare
type v_year_arr is varray(100) of emps%rowtype;
v_deptid emps.department_id%type :=90;
v_rem1 number(5,2);
v_rem2 number(5,2);
v_rem3 number(5,2);
v_year v_year_arr;
Begin
select * bulk collect into v_year from emps where department_id = v_deptid;
v_rem1 := MOD(v_year.yof,4);
v_rem2 := MOD(v_year.yof,100);
v_rem3 := MOD(v_year.yof,400);
for i..v_year loop
If (v_rem1=0 and v_rem2=0 and v_rem3=0)
then
DBMS_OUTPUT.PUT_LINE('Leap year :'||v_year.yof);
else
DBMS_OUTPUT.PUT_LINE('Not a Leap year :'||v_year.yof)
End if;
end loop;
end;
getting ORA-06550 error
83 Views Asked by user2664165 At
1
There are 1 best solutions below
Related Questions in PLSQL
- How to send message to syslog agent in plsql
- In PLSQL, How to fetch "User Tables" but not limited to Owner wise only, that have been created under different Schemas of different Users
- How to add the decimal point based on the condition in oracle?
- I am writing the sql query to get the latest supervisor and their job
- How to pass a array object to an oracle stored procedure?
- Difference between an "IS" or "AS" function/procedure declaration PL/SQL
- Best way to create a conditional SQL query? CASE, DECODE, or IF/THEN?
- Can anyone please post working code to send email using sendgrid on Azure databse using PLSQL procedure
- Retrieve record specific date and time in Oracle SQL
- Need to use join result into second cursor in PL/SQL
- ORACLE: Build 'INSERT INTO' statements from 'SELECT *' results
- ORACLE: Build 'INSERT INTO' statements from SELECT * results
- Error in Syntax - Oracle APEX - apex_authorization.is_authorized function
- How to convert CLOB to varchar , and separate them by comma
- Please, my Oracle EBS query when creating a custom report still contains duplicate data,
Related Questions in ORACLE10G
- Whatever the data available in previous record it should add to the new record
- Is there a database agnostic way to perform an ISNUMERIC check in a query?
- Using FND_FUNCTION.EXECUTE
- ERROR at line 19: PLS-00103: Encountered the symbol "¿"
- how connecting to web by utl_http in oracle10gr2?
- How To Recover Oracle 10g Database From A Hard Disk Crash
- creating DAT file in Oracle SQL
- LPX-00601 Invalid token in Oracle 10g XMLTABLE with namespaces
- Historical SQL queries
- how to return multiple values if a condition satisfy in oracle sql
- Timestamp in Oracle
- hibernet and spring data jpa version compatible with oracle 10g database
- Table in Oracle which will store the Server count on monthly basis
- in oracle db how does comparision workks when we provide the string in place of a number?
- Oracle reports repeating frame
Related Questions in VARRAY
- How to get Oracle VARRAY data type details
- To get the exact amount of data between specific date range and insert in table in oracle plsql procedure using varray type collection
- Declaring a varray of custom records and using Extend method(which gives a syntax error??)
- createArrayOf Not supported, How to insert or update anonymous type in oracle?
- Using arrays in Oracle SDO_GEOMETRY
- Pass UDT array from C# to Oracle SP
- Convert SDO_ORDINATE_ARRAY to string using a function (for a function-based index)
- Convert SDO_ORDINATE_ARRAY to built-in VARRAY (to create function-based index)
- Use negative number to extract element at end of varray list (in a custom member function)
- Use Query Result Cache in query with varray
- Extract vertices from SDO_GEOMETRY lines and store as points in SDO_GEOMETRY_ARRAY
- Get varray values as concatenated text list
- Replace value in SDO_ELEM_INFO_ARRAY varray
- Convert VARRAY to text (for concatenation)
- Oracle : Convert NCHAR column value into Hexadecimal when fetching VARRAY in XML format?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you'd be better off writing this using a cursor FOR loop, as in:
This eliminates the potential problem of having more than 100 rows returned by the
SELECT...BULK COLLECT INTO...statement. I also took the liberty of correcting your leap year determination.Share and enjoy.