Counting the number of lines for each procedure in a package
Hi,
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;
PROCEDURE proc2 IS
BEGIN
update t1 set EDITION_NAME = 'AAAAAAA';
commit;
END proc2;
END PKG_TEST;thanks for helping
onedbguru wrote:
Hopefully some idiot manager isn't trying to use this sort of thing to base their decisions on developer productivity. If so, they ARE idiots. Number of code lines NEVER, EVER, EVER!!! translates into an efficient application. If I were paid by the line, my code would look like:
select
1
from
dual
Based on the idiocy of this method of determining "performance" I would get paid $5.00 at $1.00/line. And trust me, I saw this back in the 80's and 90's and saw similar idiotic code and had to clean up the mess. Most of it wasn't efficient code to start with let alone the number of lines generated.Or the other extreme, when the PHB firmly believed that execution efficiency was gained by reducing the number of lines of code. So instead of nicely formatted, easy to read code:
*GET NEXT ORDER NUMBER
EXEC SQL
SELECT (MAX(ORDER_NUM) + 1)
INTO :NEXT-NUM:IND-NULL
FROM PART_ORDER
END-EXEC.
IF IND-NULL < 0
MOVE 1 TO NEXT-NUM.
EXEC SQL
INSERT
INTO PART_ORDER
(ORDER_NUM,
ORIGIN_LOC,
ORDER_TYPE,
ORDER_STAT,
CREAT_TIME)
VALUES (:NEXT-NUM,
:LOC, 'R', 'O',
CURRENT TIMESTAMP)
END-EXEC.
MOVE NEXT-NUM TO MASK0.
PERFORM HEADER-PROC THRU HEADER-EXIT.
CREATE-ORDER-EXIT. EXIT. You got this:
*GET NEXT ORDER NUMBER
EXEC SQL SELECT (MAX(ORDER_NUM) + 1) INTO :NEXT-NUM:IND-NULL FROM
PART_ORDER END-EXEC. IF IND-NULL < 0 MOVE 1 TO NEXT-NUM. EXEC SQL INSERT
INTO PART_ORDER (ORDER_NUM, ORIGIN_LOC, ORDER_TYPE, ORDER_STAT,
CREAT_TIME) VALUES (:NEXT-NUM, :LOC, 'R', 'O', CURRENT TIMESTAMP)
END-EXEC. MOVE NEXT-NUM TO MASK0. PERFORM HEADER-PROC THRU HEADER-EXIT.
CREATE-ORDER-EXIT. EXIT. Oh, wait! See the same thing all the time in this forum ... not because someone thinks fewer lines = faster code, but simply because people are sloppy.
INSERT INTO PART_ORDER(ORDER_NUM,ORIGIN_LOC,ORDER_TYPE,ORDER_STAT,CREAT_TIME) VALUES (:NEXT-NUM,:LOC, 'R', 'O',CURRENT TIMESTAMP) ;
Similar Messages
-
Count the number of lines in each file in a directory
Hello,
I would like to count the number of lines for each file in my directory and subdirectories.
I wonder how can I count the lines of the specified files?
Here is the program which is listed the files in the specified directory:
String path = "C:/User/Studies/Pracices/src/Pract1";
String files;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++)
if (listOfFiles.isFile())
files = listOfFiles[i].getName();
System.out.println(files);Ok so one more question.
Actually my path is pointing to one Directory and like here I can just read from one file that the name of the file should be specified in the path is it possible to help me in that part?
File f = new File("C:/User/Studies/Practices/src/Pract1/");
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
LineNumberReader ln = new LineNumberReader(br);
int count = 0;
while (ln.readLine()!=null)
count++;
System.out.println("no. of lines in the file = " + count); -
Dynamic Pie Chart: Counting the number of instances for each value
Hello my name is Tim and I am at a roadblock concerning a chart for a dashboard design.
I have a list with two fields:
Platform and Status. The list is customized in InfoPath. The
Platform field is located on the form as a drop-down menu with 6 entries.
Status is a choice field with 3 selection that is updated through the lifespan of the project (once item created, it is updated to "In process", once the project is closed, the field is updated to "closed."
My hurdle is viewing these dynamically in a Pie Chart. I am trying to display the number of project's "In process" for each Platform. So, if Platform A has 6 projects "In process" and Platform B has 3 projects "In process"
how can this be displayed in a pie chart?
At the moment, I figured there are two options: Chart View WebPart or importing an Excel worksheet.
Any ideas or solution on how to accomplish this?
-Tim DempseyThree options:
1. Create a list that holds your statuses. Then in your original list, create a lookup to the status list. In your status list, make a lookup to the lookup. This creates a circular reference which, for whatever reason, returns a count. You can then connect
a chart web part to this. Repeat for the other column.
2. Go to your sharepoint list and export to spreadsheet. Save the file. This is a query file that you can use as a data connection. From that file, set it to auto-update and then create a chart from a pivot table. Then use Excel Services Web Part to display
the file.
3. The other option is to use Google Charts API. Connect to the list, run some jQuery and JavaScript and then export out a chart. Pretty cool tool.
Andy Wessendorf SharePoint Developer II | Rackspace [email protected] -
Count the number of lines in a txt file
I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help
I need to count the number of lines in a txt file,
but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
This is because the txt file is double spaced. readLine() returns
null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read. -
How to count the number of lines dynamically,
In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINESIn the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINES
The display function is:
FORM DISPLAY_DATA .
ULINE.
WRITE : /1 SY-VLINE, 'check',
10 SY-VLINE, 'Plant',
20 SY-VLINE, 'Material number',
50 SY-VLINE, 'Follow up material',
70 SY-VLINE, 'Safety stock',
100 SY-VLINE, 'Partc'.
ULINE.
LOOP AT IT_MARC.
MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
IT_MARC-MATNR TO IT_REC-MATNR,
IT_MARC-NFMAT TO IT_REC-NFMAT,
IT_MARC-EISBE TO IT_REC-EISBE,
IT_MARC-PARTC TO IT_REC-PARTC .
APPEND IT_REC.
CLEAR IT_MARC.
ENDLOOP.
DATA: GV_TABIX TYPE SY-TABIX.
LOOP AT IT_REC.
GV_TABIX = SY-TABIX.
READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
NFMAT = IT_REC-NFMAT.
IF SY-SUBRC EQ 0.
IT_REC-PARTC = GT_TOTAL-PARTC.
MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
ENDIF.
ENDLOOP.
LOOP AT IT_REC.
WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
10 SY-VLINE, IT_REC-WERKS,
20 SY-VLINE, IT_REC-MATNR,
50 SY-VLINE, IT_REC-NFMAT,
70 SY-VLINE, IT_REC-EISBE,
100 SY-VLINE, IT_REC-PARTC.
AT END OF NFMAT.
ULINE.
ENDAT.
ENDLOOP.
ULINE.
ENDFORM. " DISPLAY_DATA
Solved -
Hi All,
I want to count the Number of lines that the user had entered in a multi-lined text box.
Because I want to restrict him up-to 6 lines.
How Can I don this.
Thanks in Advance,sql>select length('count no
of line
in the text')-length(replace('count no
of line
in the text',chr(10),'')) lines
from dual;
LINES
2
jeneesh -
Java Program+To count the number of lines in a method excluding comments???
Hi friends
can u plz help me out, the java program is counting the number of lines in a method excluding comments.
The first thing is how to identify a method, then there can be an inner method inside the parent method,
Please friends its urgent
Bye
SandyThere's no such thing as an inner method in Java. You can either write the code yourself to parse Java source, or maybe something like ANTLR can do it.
-
Count the number of Lines with in a method
I am trying to write a program that will report back the number of methods/types/names and proxies as well as the number of lines of code in each method... I can not figure out how to count each methods line of code separately thanks. each method is commented by
/* PROXY proxyname type */
/* METHOD method name*/
public class Assignment3
private static BufferedReader userInput = new BufferedReader (new InputStreamReader (System.in));
* @param args
* @throws IOException
* @param args
* @throws IOException
public static void main(String[] args) throws IOException
System.out.print("Enter the .java file name: ");
String input = userInput.readLine();
while (!input.equalsIgnoreCase("stop"))
System.out.println("Total Number of Lines: " + LOC(input) + "\n" + Method(input) + "\n" + Type(input));
System.out.print("\nEnter file name to search again or \"stop\" to terminate the program: ");
input = userInput.readLine();
public static int LOC(String inputFile) throws IOException, FileNotFoundException
int numLines = 0;
try
FileReader FileIn = new FileReader(inputFile);
Scanner scanLines = new Scanner (FileIn);
String line;
while (scanLines.hasNext())
line = scanLines.nextLine();
if (line.startsWith("/*"))
numLines--;
else if(!line.equals(" "))
numLines++;
FileIn.close();
catch(IOException IOE)
System.out.println("\nFile Not Found!");
return numLines;
public static int MethodLOC(String inputFile) throws IOException, FileNotFoundException
File FileIn = new File(inputFile);
Scanner scanLines = new Scanner (FileIn);
String line = null;
int methodLOC = 0;
while(scanLines.hasNext())
line = scanLines.nextLine();
if(!line.contains("/*"))
StringTokenizer st = new StringTokenizer(line, "\n");
methodLOC = st.countTokens();
return methodLOC;
public static String Method(String inputFile) throws IOException, FileNotFoundException
String line = null;
String name = null;
String info = null;
File FileIn = new File(inputFile);
Scanner scanLines = new Scanner (FileIn);
while(scanLines.hasNext())
line = scanLines.nextLine();
if(line.contains("METHOD"))
StringTokenizer st = new StringTokenizer(line, " ");
String proxy = st.nextToken();
String method = st.nextToken();
name = st.nextToken();
info = "Name of Method: " + name;
return info;
public static String Type(String inputFile) throws IOException, FileNotFoundException
String line = null;
String name = null;
String info = null;
String count = null;
File FileIn = new File(inputFile);
Scanner scanLines = new Scanner (FileIn);
while(scanLines.hasNext())
if(line.contains("PROXY"))
StringTokenizer st = new StringTokenizer(line, " ");
String proxy = st.nextToken();
String method = st.nextToken();
name = st.nextToken();
String type = st.nextToken();
info = "Name of Proxy: " + name + "\n" + "Type of Proxy: " + type;
count = info;
return count;
}Iterate through the lines and count the opening and closing curly braces. Whenever you see an opening one, increase the counter, when you see a closing one, decrease the counter. When the counter hits 0 again, you reached the end of the method.
I assume you know how to count lines while moving through a text line by line. -
How do I create a chart of the number of entries for each date?
I have a table which contains bookings for an event I am running, with one row for each booking and a column for the date of the booking. I am trying to create a line chart which shows me the progress of the number of bookings over time. So the X axis would have one label for each day of the month - even if there was no booking on that day, and the Y axis would have the number of bookings, i.e. the number of rows, matching the date.
I have tried a few things without success, so I wonder if someone could help with this?
Thanks,
NickThe top table is titled "Bookings" and the bottom table summariese the bookings by counting how many bookings fall on each day:
The bottom table:
B2=COUNTIF(Bookings :: $B, "="&A2)
select B2 and fill down as needed -
Count the number of lines in all of my java files.
I have created a reasonable size project with about 20 classes, rather than going through each and counting the lines are their any programs maby integrated into forte or another ide which can do this?
ThanksActually, if you are looking for kloc statitics, it is more complicated. You would not want blank lines counted. You may also want to separate out the counts for comments vs. code. Also seprations between JavaDoc comments and commented-out code. There are free and commercial programs which do this, or you can write your own.
-
Have EEM count the number of Lines
In *nix this is as simple as "wc -l" but unfortunately I can't seem to find a simple solution. For the purposes of this thread here is my test script...
event manager applet TEST authorization bypass
event syslog pattern "TRIGGER"
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "show log"
action 4.0 cli command "COUNT NUMBER OF LINES FROM SHOW LOG -- $_cli_result"
Can someone let me know what action 4.0 would be in order to complete this task?
Thanks!Actually, that parially worked. Perhaps you can help me troubleshoot the results I am getting.
Here is my test script:
edge2821a#show run | sec eventevent manager applet TEST authorization bypass event none action 1.0 cli command "enable" action 2.0 cli command "conf t" action 3.0 cli command "show ip nat trans" action 4.0 set LINES "0" action 4.1 foreach line "$_cli_result" "\n" action 4.2 increment LINES action 4.3 end action 4.4 puts "Number of NAT Translations: $LINES"
Here is my actual NAT translation table:
edge2821a#show ip nat translationsPro Inside global Inside local Outside local Outside globaludp 72.68.68.238:123 10.0.10.200:123 66.27.60.10:123 66.27.60.10:123tcp 72.68.68.238:4030 10.0.20.100:4030 --- ---tcp 72.68.68.238:4031 10.0.20.100:4031 --- ---tcp 72.68.68.238:23 10.0.20.105:22 --- ---tcp 72.68.68.238:80 10.0.20.105:80 199.248.199.110:59691 199.248.199.110:59691tcp 72.68.68.238:80 10.0.20.105:80 --- ---tcp 72.68.68.238:9090 10.0.20.201:8080 --- ---tcp 72.68.68.238:443 10.0.20.225:80 --- ---tcp 72.68.68.238:9022 10.0.21.230:22 173.70.201.69:49353 173.70.201.69:49353tcp 72.68.68.238:9022 10.0.21.230:22 --- ---udp 72.68.68.238:50817 10.0.21.231:50817 63.142.161.5:3997 63.142.161.5:3997udp 72.68.68.238:55703 10.0.21.231:55703 63.142.161.5:1194 63.142.161.5:1194udp 72.68.68.238:49917 10.0.30.30:49917 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:50011 10.0.30.30:50011 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:51973 10.0.30.30:51973 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:56512 10.0.30.30:56512 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:56639 10.0.30.30:56639 71.250.0.12:53 71.250.0.12:53tcp 72.68.68.238:57373 10.0.30.30:57373 64.12.24.171:443 64.12.24.171:443tcp 72.68.68.238:57404 10.0.30.30:57404 173.194.73.125:5222 173.194.73.125:5222Pro Inside global Inside local Outside local Outside globaltcp 72.68.68.238:57412 10.0.30.30:57412 173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:57413 10.0.30.30:57413 173.194.68.109:587 173.194.68.109:587tcp 72.68.68.238:57414 10.0.30.30:57414 173.194.68.109:465 173.194.68.109:465udp 72.68.68.238:57572 10.0.30.30:57572 71.250.0.12:53 71.250.0.12:53tcp 72.68.68.238:60348 10.0.30.30:60348 173.194.76.108:993 173.194.76.108:993udp 72.68.68.238:60413 10.0.30.30:60413 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:61461 10.0.30.30:61461 71.250.0.12:53 71.250.0.12:53tcp 72.68.68.238:61632 10.0.30.30:61632 17.149.36.76:5223 17.149.36.76:5223udp 72.68.68.238:62019 10.0.30.30:62019 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:63756 10.0.30.30:63756 71.250.0.12:53 71.250.0.12:53udp 72.68.68.238:65134 10.0.30.30:65134 71.250.0.12:53 71.250.0.12:53tcp 72.68.68.238:65188 10.0.30.30:65188 173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:65274 10.0.30.30:65274 173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:65310 10.0.30.30:65310 173.194.76.108:993 173.194.76.108:993tcp 72.68.68.238:65311 10.0.30.30:65311 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:65312 10.0.30.30:65312 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:65374 10.0.30.30:65374 173.194.76.108:993 173.194.76.108:993tcp 72.68.68.238:65429 10.0.30.30:65429 173.194.74.109:993 173.194.74.109:993tcp 72.68.68.238:65466 10.0.30.30:65466 74.125.226.195:80 74.125.226.195:80tcp 72.68.68.238:65467 10.0.30.30:65467 74.125.226.200:80 74.125.226.200:80tcp 72.68.68.238:65469 10.0.30.30:65469 173.194.43.7:443 173.194.43.7:443tcp 72.68.68.238:65470 10.0.30.30:65470 173.194.43.7:443 173.194.43.7:443tcp 72.68.68.238:65471 10.0.30.30:65471 173.194.43.7:443 173.194.43.7:443Pro Inside global Inside local Outside local Outside globaltcp 72.68.68.238:65472 10.0.30.30:65472 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65473 10.0.30.30:65473 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65474 10.0.30.30:65474 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65475 10.0.30.30:65475 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65476 10.0.30.30:65476 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65477 10.0.30.30:65477 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65478 10.0.30.30:65478 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65479 10.0.30.30:65479 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65480 10.0.30.30:65480 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65481 10.0.30.30:65481 173.194.75.99:443 173.194.75.99:443tcp 72.68.68.238:65482 10.0.30.30:65482 192.168.1.1:2555 192.168.1.1:2555tcp 72.68.68.238:65484 10.0.30.30:65484 206.46.232.12:465 206.46.232.12:465tcp 72.68.68.238:65485 10.0.30.30:65485 173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:65486 10.0.30.30:65486 173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:65487 10.0.30.30:65487 173.194.68.109:587 173.194.68.109:587tcp 72.68.68.238:52115 10.0.30.60:52115 204.8.241.230:443 204.8.241.230:443tcp 72.68.68.238:52523 10.0.30.60:52523 204.8.241.230:443 204.8.241.230:443tcp 72.68.68.238:52524 10.0.30.60:52524 204.8.241.230:443 204.8.241.230:443tcp 72.68.68.238:52525 10.0.30.60:52525 204.8.241.230:443 204.8.241.230:443tcp 72.68.68.238:52571 10.0.30.60:52571 17.172.232.217:5223 17.172.232.217:5223tcp 72.68.68.238:52861 10.0.30.60:52861 173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:53667 10.0.30.60:53667 204.8.241.230:443 204.8.241.230:443Pro Inside global Inside local Outside local Outside globaltcp 72.68.68.238:53668 10.0.30.60:53668 173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:50519 10.0.30.62:50519 69.171.230.22:443 69.171.230.22:443tcp 72.68.68.238:50597 10.0.30.62:50597 17.149.36.120:443 17.149.36.120:443tcp 72.68.68.238:50889 10.0.30.62:50889 173.252.103.48:443 173.252.103.48:443tcp 72.68.68.238:51959 10.0.30.62:51959 23.67.251.64:80 23.67.251.64:80tcp 72.68.68.238:52085 10.0.30.62:52085 69.171.233.33:443 69.171.233.33:443tcp 72.68.68.238:52091 10.0.30.62:52091 17.149.36.162:443 17.149.36.162:443tcp 72.68.68.238:52216 10.0.30.62:52216 17.172.233.111:443 17.172.233.111:443tcp 72.68.68.238:53102 10.0.30.206:53102 184.51.206.137:80 184.51.206.137:80tcp 72.68.68.238:52958 10.0.30.233:52958 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:52959 10.0.30.233:52959 173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:52961 10.0.30.233:52961 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:52962 10.0.30.233:52962 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:59069 10.0.30.233:59069 17.158.10.36:443 17.158.10.36:443tcp 72.68.68.238:59070 10.0.30.233:59070 17.158.10.36:443 17.158.10.36:443tcp 72.68.68.238:59072 10.0.30.233:59072 74.125.226.233:443 74.125.226.233:443tcp 72.68.68.238:65140 10.0.30.233:65140 173.194.73.125:5222 173.194.73.125:5222tcp 72.68.68.238:53041 10.0.30.234:53041 173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:53250 10.0.30.234:53250 173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:53520 10.0.30.234:53520 17.172.232.158:443 17.172.232.158:443tcp 72.68.68.238:54172 10.0.30.235:54172 17.149.36.165:5223 17.149.36.165:5223tcp 72.68.68.238:54173 10.0.30.235:54173 17.172.238.204:443 17.172.238.204:443Pro Inside global Inside local Outside local Outside globaltcp 72.68.68.238:55523 10.0.30.235:55523 173.194.76.108:993 173.194.76.108:993
Here is the output of my EEM script:
edge2821a#event manager run TESTNumber of NAT Translations: 4
The value of $LINES shoudl have been 92, not 4. Can you help me to identify the problem?
Thanks! -
Report for counting the number of interfaces in each device
Hi, we have LMS 4.0.1 and we would like to know how many gigabitEthernet interfaces and how many fastEthernet interfaces does each device have. If we create a custom report template with the conditions "Interface:Type:Contains:Gi" OR "Interface:Type:Contains:Fa" we get the interfaces that match the criteria but we also need the count, and this is what we don't know how to do it.
Does anyone know how can we do it?Hi
Suppress results rows for number of items..that is 10,20...
Calculate result rows only for sales order ...1000000...
You should get intended result with this settings
Regards
N Ganesh -
Count the number of rows in each table
I have a list of table names, how to I write a query to find out the row count of each table.
select table_name from all_tables a where owner='XXX' and num_row > 100
or
select table_name from all_tables a where owner='XXX' and sample_size > 100
doesn't quite work.
Why?
Thanks in advance,
Edited by: mpt_fz on Jan 12, 2010 12:06 PMWell, then another method learned from Michael ;)
scott@ORCL>
scott@ORCL>select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
Elapsed: 00:00:00.14
scott@ORCL>
scott@ORCL>
scott@ORCL>select table_name,
2 DBMS_XMLGEN.getxmltype(
3 'select count(*) c from '||table_name
4 ).extract('//text()').getnumberval() tot_rows
5 from user_tables
6 where iot_type is null
7 or iot_type != 'IOT_OVERFLOW';
TABLE_NAME TOT_ROWS
A_TEST_TB_CASHFLOW 14
TEST_DUMMY 1
A_TEST_TB_CASHFLOW_N 1
TEST_CAST 1
DEPT 4
EMP 14
BONUS 0
SALGRADE 5
EMP_DETAILS 3
T_EMP 0
AUDIT_T 0
TABLE_NAME TOT_ROWS
C_C 4
TRAIN_DET 2
TEST_COM_IMP 2
TIME_P 1
PRI_UQ 4
TEST_CHK 0
ANSHUMANSAHAISGENIOUS 1
T 1
XEUROPE 2
D_D 8
PUBLICTRANSPORT 4
TABLE_NAME TOT_ROWS
XASIA 2
TF1 0
TEST_HH 14
TEST_SWAP 4
REVIVE_XML 3
XGMT 1
CUSTOMER_DET 1
FOURWHEELER 2
SPOOL_LOG 13
CITYTRANSPORT 8
T1 2
TABLE_NAME TOT_ROWS
T2 2
A_A 1
B_B 2
AUTOMOBILE 1
XDUAL 1
S_TEMP 0
39 rows selected.
Elapsed: 00:00:08.78
scott@ORCL>Regards.
Satyaki De. -
SSRS- Counting the number of occurrences
Hi,
I have table 1 filled with numbers 1-5. I need to count the number of occurrences for each number in table 2.
For example,
Table 1
3
4
5
4
3
Table 2 1-- 0 occurrences
2-- 0 occurrences
3-- 2 occurrence
4-- 2 occurrences
5-- 1 occurrences
Can I do this in a SSRS report?
Thank you in advance!Hi Rebecca07,
After testing the issue in my local environment, we can refer to the steps below to achieve your requirement:
Drag a table from Toolbox to design surface.
Delete the detail row (second row) and the third column.
Right-click the first row to insert five rows after that row.
Type the following expressions in each cell:
numbers occurrences
1 =count(iif(Fields!number.Value=1,1,nothing))
2 =count(iif(Fields!number.Value=2,1,nothing))
3 =count(iif(Fields!number.Value=3,1,nothing))
4 =count(iif(Fields!number.Value=4,1,nothing))
5 =count(iif(Fields!number.Value=5,1,nothing))
The following screenshot is for your reference:
If you have any other questions, please feel free to let me know.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
SQL help: return number of records for each day of last month.
Hi: I have records in the database with a field in the table which contains the Unix epoch time for each record. Letz say the Table name is ED and the field utime contains the Unix epoch time.
Is there a way to get a count of number of records for each day of the last one month? Essentially I want a query which returns a list of count (number of records for each day) with the utime field containing the Unix epoch time. If a particular day does not have any records I want the query to return 0 for that day. I have no clue where to start. Would I need another table which has the list of days?
Thanks
RayPeter: thanks. That helps but not completely.
When I run the query to include only records for July using a statement such as following
============
SELECT /*+ FIRST_ROWS */ COUNT(ED.UTIMESTAMP), TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD') AS DATA
FROM EVENT_DATA ED
WHERE AGENT_ID = 160
AND (TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY')+(ED.UTIMESTAMP/86400)), 'MM/YYYY') = TO_CHAR(SYSDATE-15, 'MM/YYYY'))
GROUP BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD')
ORDER BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD');
=============
I get the following
COUNT(ED.UTIMESTAMP) DATA
1 07/20
1 07/21
1 07/24
2 07/25
2 07/27
2 07/28
2 07/29
1 07/30
2 07/31
Some dates donot have any records and so no output. Is there a way to show the missing dates with a COUNT value = 0?
Thanks
Ray
Maybe you are looking for
-
I have a gen 3 ipod and can't get it into disk mode. In itunes it does not have the option and I cant figure out how to do it on the ipod touch itself. Any ideas?
-
HP Pavilion 15-n221sa Notebook PC touch pad glitching frequently
HP Pavilion 15-n221sa Notebook PC, windows 8.1, 8GB ram (7.89 usable), 64 bit os, 1.80 GHz intel core i3 processor I got my new laptop that I bought recently (3-4 weeks, give or take) and I've noticed that my touch pad us acting up OFTEN. Sometimes i
-
Can SquirrelMail be set to serve on a port other than 16080? How?
SquirrelMail serves OS X webmail on port 16080 out of the box. However, my company intranet has internet port 16080 closed... so, SquirrelMail is inaccessible. Can SM be set to serve on port 80? Is there a reason why it doesn't serve on this port by
-
Parking not possible during batch input
Hello, Iu2019m facing a problem for creating a parked vendor invoice in background (Tcode FB60 / FV60) thru BDC or BAPI. I looked for a BAPI and I just found "BAPI_ACC_INVOICE_RECEIPT_POST", for posting FI invoice : it doesnu2019t correspond to our r
-
Office 2007 to imac via remote disk
hi, i have office 2007 on disc which i thought i would try to load on to my new i mac (late 2013. 2.9 ghz,8gb,10.9.3) running parallels . i have used my mac book pro(early 2011,10.7.5) as an opyical drive. the files show up on the imac remote disc.on