We are processing spatial data from another source to display in our GIS environment. The data is a set of multi lines. The gtype is 2006. A typical geometry looks like:
Now, this is not an actual multiline... it's just encoded as a multi line, but if you look at the coordinates you'll see that the end point of the first line is the same as the beginning of the second line (105094.84, 195084.96).
I would like to write a query on USER_SOURCE that can display the number of code lines for each procedure/function in a package. Is it possible to write such a query? Maybe by using analytical functions?
for example in the following example i would like to count the lines between
"PROCEDURE proc1 IS" and "END proc1;" and between "PROCEDURE proc2 IS" and "END proc2;" SQL> select text from user_source where name='PKG_TEST' and type='PACKAGE BODY';
TEXT -------------------------------------------------- PACKAGE BODY PKG_TEST IS /************************************************* ****/ PROCEDURE proc1 IS BEGIN update t1 set EDITION_NAME = 'AAAAAAA'; commit; END proc1; [code]....
we are generating Entity beans at java appication. where application is connecting to DB and copy Table structure in Java class file. when this process start, oracle process takes 100% CPU. while there is no wait event at DB level. only queries are fired on oracle sys tables.(user_tables,user_constraints,etc..)
On trial and error based, we have changed this parameter and that java process works fine. how this parameter effect the on oracle system table.
My query is suppose to capture the student's number, date of birth, and number of students which that students mentors. I am suppose to show only the 5 oldest students
SELECT s.std_num, s.birth_date, COUNT(s2.mentor_num) From Student s left outer join Student s2 on s2.mentor_num=s.std_num GROUP BY s.std_num, s.birth_date ORDER BY s.birth_date ASC;
This function works but the problem is in displaying the five records because whenever I apply the rownum<=5 function the counter returns incorrect results. I tried writing another query to fix it but I could not dispay the counter anymore
SELECT ROWNUM as SENIOR, s.std_num, s.birth_date, COUNT(s2.mentor_num) FROM (SELECT s1.std_num, s1.birth_date, COUNT (e2.super_id) From Student s left outer join Student s2 on s2.mentor_num=s1.std_num GROUP BY s1.std_num, s1.birth_date ORDER BY s1.birth_date ASC) S WHERE row_num<=5;
This code only works if I remove the count in the first line but I need to display the number in my result.
is there any way to force SQL*Plus to provide the actual line number in the source file whenever there is an error? I often put at the first line of my script SET SQLBLANKLINES ON so that I may be able to put several consecutive blank lines lines in my code (I do this sometimes, when I find it to be appropriate in order to make my code more readable or to group a sequence of instructions which I believe make their logical link more understandable for the reader) Now the problem is that SQL*Plus ignores these blank lines and whenever there is an error, the line number provided in the error message, doesn't correspond to the actual line number in the source file but it seems to be the last non blank line in the file. Consider the following example:
SET SQLBLANKLINES ON;DECLARE var PLS_INTEGER := 10;BEGIN var := 20END;/ In the above code at line 9
(by counting also the blank lines) there is an error (no semicolon at the end of var := 20) but when I run the script inSQL*Plus here is the error message that I get
SQL> @myscript.sql;END;*ERROR at line 8:ORA-06550: line 8, column 1:PLS-00103: Encountered the symbol "END"
when expecting one of the following:* & = - + ; < / > at in is mod remainder not rem<an exponent (**)> <> or != or ~= >= <= <> and or like like2like4 likec between || multiset member submultisetThe symbol ";" was substituted for "END" to continue.SQL> So as you can see the error message indicate that the error was found at the line 8 whereas in the file it is really at the line 9 As long as the number of lines in the script is limited, this may not be a problem and one can find rapidly the actual line number in the code raising the error but for a code including hundreds (or even thousands) of lines and with many comments and blank lines, finding the actual line number given by SQL*Plus error message becomes tricky. Is there any way to make SQ*LPlus trace correctly the line numbers as they appear in the source file?
i want to replace 4 digit number in a given string with the same number incremented by 10000.
That mean in the given sting 1201 should be replace by 11201 (Icremented BY 10000).
Input String:
<query><matchAll>true</matchAll><row><columnId>1201</columnId><dataType>31</dataType><op>Like</op><val>North America - Houston</val></row><row><columnId>1212</columnId><dataType>31</dataType><op>!=</op><val>Agreement Date Mismatch</val></row><row><columnId>1212</columnId><dataType>31</dataType><op>!=</op><val>Facility Type Mismatch</val></row><row><columnId>1224</columnId><dataType>31</dataType><op>Like</op><val>y</val></row></query>
Required output :
<query><matchAll>true</matchAll><row><columnId>11201</columnId><dataType>31</dataType><op>Like</op><val>North America - Houston</val></row><row><columnId>11212</columnId><dataType>31</dataType><op>!=</op><val>Agreement Date Mismatch</val></row><row><columnId>11212</columnId><dataType>31</dataType><op>!=</op><val>Facility Type Mismatch</val></row><row><columnId>11224</columnId><dataType>31</dataType><op>Like</op><val>y</val></row></query>
Actually I am getting the following error while running my script.
Error:(Error): ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 9
Seems to be getting eror in the following line but not sure why its coming."select adary.dilution_strategy_seq.NEXTVAL into :dil_strat_seq_new from dual;"
Code snippet: --------------------------------------------------------------- declare dil_strat_seq_new NUMBER :=0; disc_conc_seq_new NUMBER :=0; disc_fold_seq_new NUMBER :=0; begin
How to find the line number along with package name or procedure name (for ex. in Oracle 10g DBMS_UTILITY.FORMAT_ERROR_BACKTRACE ) where exactly error is coming in forms.There is plsql code written and while executing the code, ORA-01722: invalid number error is coming. For easy tracing the error, any way is there ?
I searched in Google before posting in this forum and found that ON-ERROR trigger if we write DBMS_ERROR_TEXT it will display the ling number along with package or procedure name. But it is not working and this is only giving me error name no line number.
how to write this in sql command lineDisplay CUSTOMER number, name, rep, balance, and credit limit for all CUSTOMERs of Rep 20.
In addition, display this information for CUSTOMERs of rep 65 who have a $10,000 credit limit. Arrange the output by credit limit descending within rep ascending. no more than two decimal digits
I want to print two record of emp table in same line number in tabular format report.
For example if i have emp table and I want to print empno,ename,sal columm only,In tabular format report, Two record should print per line. so If emp table have 14 record report should be printed on 7 rows.
so the output in print preview should be like this
EMPNO ENAME SAL EMPNO ENAME SAL ------ ---------- ---------------------------------------------- 7369 SMITH 800 7499 ALLEN 1600 7521 WARD 1250 7566 JONES 2975 7654 MARTIN 1250 7698 BLAKE 2850 . . . .
However, I need to have the total of no of records displayed for the sql statement and I need it in one sql statement with the one above so that I can display the total no of records along with the information for each field.
I need to count number of elements in the same catagory of an array.. For example, an array consists of {'a','b','c','c','a','d','c'} means, i need to display like a=2, b=2, c=3, d=1.
I have written the below code.
declare type array_val is varray(10) of varchar2(15000); counter number:=0; SMQ_NAME ARRAY_VAL:=ARRAY_VAL(); begin
[code]....
But its not showing exact output as my requirement..
ct_id and limit_id is match column used for mapping.
now i want the total count of no of records in test_master in which test_master column value not exceed limit master column limit value if any one column exceeds its limit then the same row will be in my count criteria.
I have been asked to show the names and room number according to students who have 4 classes in a room.
select s.name, r.room_no from s, r where r.room_no = u.room_no and e.unit_code = u.unit_code GROUP BY s.name, r.room_no HAVING COUNT(DISTINCT s.stu_no) > 4;
However I get the error 'ERROR at line 4: ORA-00904: "U"."UNIT_CODE": invalid identifier'