I want SQL query to check if any of our important concurrent programs
I want a sql query to check if any of our important concurrent programs are currently scheduled or not
SinghP wrote:
I want a sql query to check if any of our important concurrent programs are currently scheduled or notThat's nice,
What scheduling tool are you using? are you referring to dbms_job?
what version of Oracle are you using? are you using some custom job management system that involves writing to user created tables in your database?
Similar Messages
-
SQL Query (PL/SQL Function Body returning SQL query) doesn't return any row
I have a region with the following type:
SQL Query (PL/SQL Function Body returning SQL query).
In a search screen the users can enter different numbers, separated by an ENTER.
I want to check these numbers by replacing the ENTER, which is CHR(13) || CHR(10) I believe, with commas. And then I can use it like this: POD IN (<<text>>).
It's something like this:
If (:P30_POD Is Not Null) Then
v_where := v_where || v_condition || 'POD IN (''''''''||REPLACE(''' || :P30_POD || ''', CHR(13) || CHR(10), '','')||'''''''''')';
v_condition := ' AND ';
End If;
But the query doesn't return any rows.
I tried to reproduce it in Toad:
select * from asx_worklistitem
where
POD IN (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
==> This is the query that does't return any rows
select (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
from dual;
==> This returns '541449200000171813','541449206006341366'
select * from asx_worklistitem
where pod in ('541449200000171813','541449206006341366');
==> and when I copy/paste this in the above query, it does return my rows.
So why does my first query doesn't work?
Doe anyone have any idea?
Kind regards,
Geert
Message was edited by:
ZorryThanks for the help.
I made it work, but via the following code:
If (:P30_POD Is Not Null) Then
v_pods := REPLACE(:P30_POD, CHR(13) || CHR(10));
v_where := v_where || v_condition || 'POD IN (';
v_counter := 1;
WHILE (v_counter < LENGTH(v_pods)) LOOP
v_pod := SUBSTR(v_pods, v_counter, 18);
IF (v_counter <> 1) THEN
v_where := v_where || ',';
END IF;
v_where := v_where || '''' || v_pod || '''';
v_counter := v_counter + 18;
END LOOP;
v_where := v_where || ')';
v_condition := ' AND ';
End If;But now I want to make an update of all the records that correspond to this search criteria. I can give in a status via a dropdownlist and that I want to update all the records that correspond to one of these POD's with that status.
For a region you can build an SQL query via PL/SQL, but for a process you only have a PL/SQL block. Is the only way to update all these records by making a loop and make an update for every POD that is specified.
Because I think this will have a lot of overhead.
I would like to make something like a multi row update in an updateable report, but I want to specify the status from somewhere else. Is this possible? -
SQL Query to check window firewalls ports
Hi All,
I am looking for a sql query like below to check inbound sql ports opened in window firewall.
Below query display all firewall ports but my requirement is to display ports opened related to sql server.
EXECUTE [master].[dbo].[xp_cmdshell] 'netsh advfirewall firewall show rule name=any |find "sql"'
Thanks,
Nani.
NBTo find the answer, you would first find which ports that are "SQL ports", and this you can find by looking in the errorlog or the registry for each instance if you want to do it programmatically.
To check Windows firewall programmatically, I have no idea, and it is definitely not a question for an SQL Server forum. Find the suitable Windows forum.
And, no, there is no SQL query you can write to do this. But Powershell may work.
Erland Sommarskog, SQL Server MVP, [email protected] -
Win App Deployment include SQL 2008 Express - Check if any SQL Server version already exist
Hi there
I have a application that is deploying and installing correctly (Setup and Deployment Project in VS 2008) and has SQL 2008 Express as a pre-requisite. SQL Express installs fine if not found but I don't want it to be installed if any other version of SQL
Server already exists on the target computer. What do I have to adjust in the Bootstrapper package (package.xml or product.xml) for SQL Express to do this check? Is the change done within the Bootstrapper package? Do I have to create a Custom Action
in my Deployment project for this check? Any help is appreciated.
Thanks
DweezilHi Dweezil,
If you use SQL Express Bootstrapper, you can add the SqlExpressChk.exe package file in the product.xml to check that if SQL Server is already exists.
However, please note that SqlExpressChk.exe is limited to only the default instance name, SQLEXPRESS, it won't detect other named instances. A registry check is required when detecting existing SQL Server with custom instance name.
For more details, please review this
blog.
There is also a similar thread for your reference.
https://dotnetinstaller.codeplex.com/discussions/245326
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here. -
don't use break i want singal query.
**This EMP table.**
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7,369 SMITH CLERK 7,902 12/17/0080 800.00 NULL 20
7,499 ALLEN SALESMAN 7,698 2/20/0081 1,600.00 300.00 30
7,521 WARD SALESMAN 7,698 2/22/0081 1,250.00 500.00 30
7,566 JONES MANAGER 7,839 4/2/0081 2,975.00 NULL 20
7,654 MARTIN SALESMAN 7,698 9/28/0081 1,250.00 1,400.00 30
7,698 BLAKE MANAGER 7,839 5/1/0081 2,850.00 NULL 30
7,782 CLARK MANAGER 7,839 6/9/0081 2,450.00 NULL 10
7,788 SCOTT ANALYST 7,566 4/19/0087 3,000.00 NULL 20
7,839 KING PRESIDENT NULL 11/17/0081 5,000.00 NULL 10
7,844 TURNER SALESMAN 7,698 9/8/0081 1,500.00 NULL 30
7,876 ADAMS CLERK 7,788 5/23/0087 1,100.00 NULL 20
7,900 JAMES CLERK 7,698 12/3/0081 950.00 NULL 30
7,902 FORD ANALYST 7,566 12/3/0081 3,000.00 NULL 20
7,934 MILLER CLERK 7,782 1/23/0082 1,300.00 NULL 10
**I want result**
DEPARTMENT EMPNO ENAME no of emplyee
10 7839 KING 3
7782 CLARK
7934 MILLER
20 7369 SMITH 5
7902 FORD
7876 ADAMS
7788 SCOTT
7566 JONES
30 7499 ALLEN 6
7521 WARD
7654 MARTIN
7900 JAMES
7844 TURNER
7698 BLAKE
Edited by: apalani06032009 on Jul 2, 2009 5:29 AMHi,
SQL> break on count
SQL> select deptno,empno,ename,count(*) over(partition by deptno) count from emp;
DEPTNO EMPNO ENAME COUNT
10 7782 CLARK 3
10 7839 KING
10 7934 MILLER
20 7566 JONES 5
20 7902 FORD
20 7876 ADAMS
20 7369 SMITH
20 7788 SCOTT
30 7521 WARD 6
30 7844 TURNER
30 7499 ALLEN
30 7900 JAMES
30 7698 BLAKE
30 7654 MARTIN
14 rows selected.Regards -
I want sql query for this output
hi guys
could u tell how can i write sql query for this out put
i have one table like this
ID ACCOUTID TAX
1 1 A
2 1 B
3 2 C
4 2 D
5 3 E
7 NULL F
8 NULL G
MY OUT PUT MUST BE LIKE THIS
ID AID TAX
2 1 A
4 2 D
7 NULL F
8 NULL G
HERE IN THIS OUTPUT I SHOULD HAVE
MAXIMAM ID VALUE FOR A REPEATED AID VALUES
AND
THE ROWS AID VALUES IS NULL ALSO MUST PAPULATED IN THE OUTPUT.
I KNOW ONE SOLUTION LIKE THIS
SELECT MAX(ID),AID,TAX
FROM TABLE T
GROUP BY AID,TAX
UNION ALL
SELECT ID, AIC,TAX
FROM TABLE T
WHERE AID IS NULL;
BUT I WANT SAME RESULT WITH OUT USING LOGICAL OPERATORS.
COULD U PLZ TELL A SOL.Will this help:
SQL> with t as
2 (
3 select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
4 select 2, 1, 'B' from dual union all
5 select 3, 2, 'C' from dual union all
6 select 4, 2, 'D' from dual union all
7 select 5, 3, 'E' from dual union all
8 select 7, NULL, 'F' from dual union all
9 select 8, NULL, 'G' from dual
10 )
11 --
12 select id, ACCOUTID AID, Tax
13 from
14 (
15 select t.*
16 ,count(1) over (partition by t.ACCOUTID) cn
17 ,row_number() over (partition by t.ACCOUTID order by id desc) rn
18 from t
19 )
20 where cn > 1
21 and (rn = 1 or ACCOUTID is null)
22 /
ID AID T
2 1 B
4 2 D
8 G
7 F
-- If I leave out the OR condition then you'll get this:
SQL> ed
Wrote file afiedt.buf
1 with t as
2 (
3 select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
4 select 2, 1, 'B' from dual union all
5 select 3, 2, 'C' from dual union all
6 select 4, 2, 'D' from dual union all
7 select 5, 3, 'E' from dual union all
8 select 7, NULL, 'F' from dual union all
9 select 8, NULL, 'G' from dual
10 )
11 --
12 select id, ACCOUTID AID, Tax
13 from
14 (
15 select t.*
16 ,count(1) over (partition by t.ACCOUTID) cn
17 ,row_number() over (partition by t.ACCOUTID order by id desc) rn
18 from t
19 )
20 where cn > 1
21* and rn = 1
SQL> /
ID AID T
2 1 B
4 2 D
8 G
--which follows the description you've given, but not the output -
Calling Transaction Import Concurrent Program in PL/SQl program
Hi,
I am trying to run Transaction Import process by calling the concurrent program in my pl/sql program.I think I am passing all the right paramters which are necessary.But the actual PAXTRTRX is never being called and I am not getting any request ID back.No exception is being thrown.Following is how I am calling the concurrent program...
p_tran_imp_request_id := fnd_request.submit_request
( application => 'PA'
, program => 'PAXTRTRX'
, sub_request => FALSE
, argument1 => 'My Transaction Source name here'
, argument2 => 'My batch name here'
,argument3 => 'my TXN_INTERFACE_ID here'
If I run the PRC: Transaction Import from front end...the process is run and import was completed just fine.But I am not able to call concurrent program from my program.Is there anything I am missing...Is there any thing I need to do before I call the concurrent program...
Any help in this issue is greatly appreciated.
ThanksHi,
Thanks for the advise. Yes I was calling the initialize function but I was passing wrong application id and responsibility id to that.Now that is taken care of.
Thanks -
Need the SQL Query to check SQL time zone and change the time zone
Hi All,
I am using SQL Server 2008 SP2. My Ex SQL Admin said that the data which we query from our database gives the output in London time.
But the SQL server is located in USA and is having US time.
I would like to know how to find what time zone is the SQL application running on and how to change it ?
Is there any query which i can use to determine and change the time zone ?
Gautam.75801Refer the below two links
http://blog.sqlauthority.com/2014/02/15/sql-server-get-current-timezone-name-in-sql-server/
Check this link
http://dba.stackexchange.com/questions/39421/how-to-handle-timezone-properly-in-sql-server
SELECT [DateTimeUtil].[UDF_ConvertLocalToLocalByTimezoneIdentifier] (
'GMT Standard Time', -- the original timezone in which your datetime is stored
'Middle East Standard Time', -- the target timezone for your user
'2014-03-30 01:55:00' -- the original datetime you want to convert
--Prashanth -
SQL Query running really slow, any help in improving will be Great!
Hi,
I am really new to this performance tuning and optimization techniques. Explain plan also, I only have theoretical knowledge, no clues on how to find out the real issue which is making the query slow..So if anyone can give me a good direction on where to start even, it will be great..
Now, my issue is, I have a query which runs really really slow. If I run this query for a small subset of data, it runs fast(Its flying, actually..) but if I give the same query for everything(Full required data), its running for ages..(Actually it is running for 2 days now and still running.)
I am pasting my query here, the output shows that the query stucks after "Table created"
SQL> @routinginfo
Table dropped.
Table created.
Please please help!
I also ran explain plan for this query and there are a number of rows in the plan_table now..
SORRY!IS there a way to insert a file here, as I want to attach my explain plan also?
My query -Routinginfo.sql
set trimspool on
set heading on
set verify on
set serveroutput on
drop table routinginfo;
CREATE TABLE routinginfo
( POST_TOWN_NAME VARCHAR2(22 BYTE),
DELIVERY_OFFICE_NAME VARCHAR2(40 BYTE),
ROUTE_ID NUMBER(10),
ROUTE_NAME VARCHAR2(40 BYTE),
BUILDING_ID NUMBER(10),
SUB_BUILDING_ID NUMBER(10),
SEQUENCE_NO NUMBER(4),
PERSONAL_NAME VARCHAR2(60 BYTE),
ADDRESS VARCHAR2(1004 BYTE),
BUILDING_USE VARCHAR2(1 BYTE),
COMMENTS VARCHAR2(200 BYTE),
EAST NUMBER(17,5),
NORTH NUMBER(17,5)
insert into routinginfo
(post_town_name,delivery_office_name,route_id,route_name,
building_id,sub_building_id,sequence_no,personal_name,
address,building_use,comments,east,north)
select
p.name,
d.name,
b.route_id,
r.name,
b.building_id,
s.sub_build_id,
b.sequence_no,
b.personal_name,
ad.addr_line_1||' '||ad.addr_line_2||' '||ad.addr_line_3||' '||ad.addr_line_4||' '||ad.addr_line_5,
b.building_use,
rtrim(replace(b.comments,chr(10),'')),
b.east,
b.north
from t_buildings b,
(select * from t_sub_buildings where nvl(invalid,'N') = 'N') s,
t_routes r,
t_delivery_offices d,
t_post_towns p,
t_address_model ad
where b.building_id = s.building_id(+)
and s.building_id is null
and r.route_id=b.route_id
and (nvl(b.residential_delivery_points,0) > 0 OR nvl(b.commercial_delivery_points,0) > 0)
and r.delivery_office_id=d.delivery_office_id
--and r.delivery_office_id=303
and D.POST_TOWN_ID=P.post_town_id
and ad.building_id=b.building_id
and ad.sub_building_id is null
and nvl(b.invalid, 'N') = 'N'
and nvl(b.derelict, 'N') = 'N'
union
select
p.name,
d.name ,
b.route_id ,
r.name ,
b.building_id ,
s.sub_build_id ,
NVL(s.sequence_no,b.sequence_no),
b.personal_name ,
ad.addr_line_1||' '||ad.addr_line_2||' '||ad.addr_line_3||' '||ad.addr_line_4||' '||ad.addr_line_5,
b.building_use,
rtrim(replace(b.comments,chr(10),'')),
b.east,
b.north
from t_buildings b,
(select * from t_sub_buildings where nvl(invalid,'N') = 'N') s,
t_routes r,
t_delivery_offices d,
t_post_towns p,
t_address_model ad
where s.building_id = b.building_id
and r.route_id = s.route_id
and (nvl(b.residential_delivery_points,0) > 0 OR nvl(b.commercial_delivery_points,0) > 0)
and r.delivery_office_id=d.delivery_office_id
--and r.delivery_office_id=303
and D.POST_TOWN_ID=P.post_town_id
and ad.building_id=b.building_id
and ad.sub_building_id = s.sub_build_id
and nvl(b.invalid, 'N') = 'N'
and nvl(b.derelict, 'N') = 'N'
union
select
p.name,
d.name,
b.route_id ,
r.name ,
b.building_id,
s.sub_build_id ,
NVL(s.sequence_no,b.sequence_no) ,
b.personal_name ,
ad.addr_line_1||' '||ad.addr_line_2||' '||ad.addr_line_3||' '||ad.addr_line_4||' '||ad.addr_line_5 ,
b.building_use,
rtrim(replace(b.comments,chr(10),'')),
b.east,
b.north
from t_buildings b,
(select * from t_sub_buildings where nvl(invalid,'N') = 'N') s,
t_routes r,
t_delivery_offices d,
t_post_towns p,
t_localities l,
t_localities lo,
t_localities loc,
t_tlands tl,
t_address_model ad
where s.building_id = b.building_id
and s.route_id is null
and r.route_id = b.route_id
and (nvl(b.residential_delivery_points,0) > 0 OR nvl(b.commercial_delivery_points,0) > 0)
and r.delivery_office_id=d.delivery_office_id
--and r.delivery_office_id=303
and D.POST_TOWN_ID=P.post_town_id
and ad.building_id=b.building_id
and ad.sub_building_id = s.sub_build_id
and nvl(b.invalid, 'N') = 'N'
and nvl(b.derelict, 'N') = 'N';
commit; Edited by: Krithi on 16-Jun-2009 01:48
Edited by: Krithi on 16-Jun-2009 01:51
Edited by: Krithi on 16-Jun-2009 02:44This link is helpful alright..but as a beginner, it is taking me too long to understand..But I am going to learn the techniques for sure..
Fo the time being,I am pasting my explain plan for the above query here, so that I hope any expert can really help me on this one..
STATEMENT_ID TIMESTAMP REMARKS OPERATION OPTIONS OBJECT_NODE OBJECT_OWNER OBJECT_NAME OBJECT_INSTANCE OBJECT_TYPE OPTIMIZER SEARCH_COLUMNS ID PARENT_ID POSITION COST CARDINALITY BYTES
06/16/2009 09:33:01 SELECT STATEMENT CHOOSE 0 829,387,159,200 829,387,159,200 3,720,524,291,654,720 703,179,091,122,042,000
06/16/2009 09:33:01 SORT UNIQUE 1 0 1 829,387,159,200 3,720,524,291,654,720 703,179,091,122,042,000
06/16/2009 09:33:01 UNION-ALL 2 1 1
06/16/2009 09:33:01 HASH JOIN 3 2 1 11,209 87,591 15,853,971
06/16/2009 09:33:01 FILTER 4 3 1
06/16/2009 09:33:01 HASH JOIN OUTER 5 4 1
06/16/2009 09:33:01 HASH JOIN 6 5 1 5,299 59,325 6,585,075
06/16/2009 09:33:01 VIEW GEO2 index$_join$_006 6 7 6 1 4 128 1,792
06/16/2009 09:33:01 HASH JOIN 8 7 1 5,299 59,325 6,585,075
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 POST_TOWN_NAME_I NON-UNIQUE ANALYZED 9 8 1 1 128 1,792
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 POST_TOWN_PK UNIQUE ANALYZED 10 8 2 1 128 1,792
06/16/2009 09:33:01 HASH JOIN 11 6 2 5,294 59,325 5,754,525
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_DELIVERY_OFFICES 5 ANALYZED 12 11 1 7 586 10,548
06/16/2009 09:33:01 HASH JOIN 13 11 2 5,284 59,325 4,686,675
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_ROUTES 4 ANALYZED 14 13 1 7 4,247 118,916
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_BUILDINGS 1 ANALYZED 15 13 2 5,265 59,408 3,029,808
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_SUB_BUILDINGS 3 ANALYZED 16 5 2 851 278,442 3,898,188
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_ADDRESS_MODEL 7 ANALYZED 17 3 2 3,034 1,582,421 88,615,576
06/16/2009 09:33:01 NESTED LOOPS 18 2 2 10,217 1 189
06/16/2009 09:33:01 NESTED LOOPS 19 18 1 10,216 1 175
06/16/2009 09:33:01 HASH JOIN 20 19 1 10,215 1 157
06/16/2009 09:33:01 HASH JOIN 21 20 1 6,467 80,873 8,168,173
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_ROUTES 11 ANALYZED 22 21 1 7 4,247 118,916
06/16/2009 09:33:01 HASH JOIN 23 21 2 6,440 80,924 5,907,452
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_BUILDINGS 8 ANALYZED 24 23 1 5,265 59,408 3,029,808
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_SUB_BUILDINGS 10 ANALYZED 25 23 2 851 278,442 6,125,724
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_ADDRESS_MODEL 14 ANALYZED 26 20 2 3,034 556,000 31,136,000
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_DELIVERY_OFFICES 12 ANALYZED 27 19 2 1 1 18
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 DELIVERY_OFFICE_PK UNIQUE ANALYZED 1 28 27 1 1
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_POST_TOWNS 13 ANALYZED 29 18 2 1 1 14
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 POST_TOWN_PK UNIQUE ANALYZED 1 30 29 1 1
06/16/2009 09:33:01 MERGE JOIN CARTESIAN 31 2 3 806,976,583,802 3,720,524,291,567,130 703,179,091,106,188,000
06/16/2009 09:33:01 MERGE JOIN CARTESIAN 32 31 1 16,902,296 73,359,971,046 13,865,034,527,694
06/16/2009 09:33:01 MERGE JOIN CARTESIAN 33 32 1 1,860 1,207,174 228,155,886
06/16/2009 09:33:01 MERGE JOIN CARTESIAN 34 33 1 1,580 20 3,780
06/16/2009 09:33:01 NESTED LOOPS 35 34 1 1,566 1 189
06/16/2009 09:33:01 NESTED LOOPS 36 35 1 1,565 1 175
06/16/2009 09:33:01 NESTED LOOPS 37 36 1 1,564 1 157
06/16/2009 09:33:01 NESTED LOOPS 38 37 1 1,563 1 129
06/16/2009 09:33:01 NESTED LOOPS 39 38 1 1,207 178 12,994
06/16/2009 09:33:01 TABLE ACCESS FULL GEO2 T_SUB_BUILDINGS 17 ANALYZED 40 39 1 851 178 3,916
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_BUILDINGS 15 ANALYZED 41 39 2 2 1 51
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 BUILDING_PK UNIQUE ANALYZED 1 42 41 1 1 31
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_ADDRESS_MODEL 25 ANALYZED 43 38 2 2 1 56
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 MODEL_MODEL2_UK UNIQUE ANALYZED 2 44 43 1 1 1
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_ROUTES 18 ANALYZED 45 37 2 1 1 28
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 ROUTE_PK UNIQUE ANALYZED 1 46 45 1 1
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_DELIVERY_OFFICES 19 ANALYZED 47 36 2 1 1 18
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 DELIVERY_OFFICE_PK UNIQUE ANALYZED 1 48 47 1 1
06/16/2009 09:33:01 TABLE ACCESS BY INDEX ROWID GEO2 T_POST_TOWNS 20 ANALYZED 49 35 2 1 1 14
06/16/2009 09:33:01 INDEX UNIQUE SCAN GEO2 POST_TOWN_PK UNIQUE ANALYZED 1 50 49 1 1
06/16/2009 09:33:01 BUFFER SORT 51 34 2 1,579 60,770
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 LOCAL_COUNTY_FK_I NON-UNIQUE ANALYZED 52 51 1 14 60,770
06/16/2009 09:33:01 BUFFER SORT 53 33 2 1,846 60,770
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 LOCAL_COUNTY_FK_I NON-UNIQUE ANALYZED 54 53 1 14 60,770
06/16/2009 09:33:01 BUFFER SORT 55 32 2 16,902,282 60,770
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 LOCAL_COUNTY_FK_I NON-UNIQUE ANALYZED 56 55 1 14 60,770
06/16/2009 09:33:01 BUFFER SORT 57 31 2 806,976,583,788 50,716
06/16/2009 09:33:01 INDEX FAST FULL SCAN GEO2 TLAND_COUNTY_FK_I NON-UNIQUE ANALYZED 58 57 1 11 50,716 -------------------------------------------------------------
Edited by: Krithi on 16-Jun-2009 02:47 -
SQL Query to check which datafiles have AutoExtend on?
I want to turn autoextend off on almost all my datafiles(obviously not on system). Using the Java Enterprise Manager you can visually see which datafiles have autoextend on. I'd prefer to find out using sqlplus which files have autoextend on so I can script turning it off. I don't see it in the v$tablespace or v$datafile views.. Where can i find this??
PaulHi,
1* select substr(file_name,1,50), AUTOEXTENSIBLE from dba_data_files
SQL> /
SUBSTR(FILE_NAME,1,50) AUT
/data/ora/H89UCBAC/u05/system/system01.dbf YES
/data/ora/H89UCBAC/u05/rbs/psundots01.dbf YES
/data/ora/H89UCBAC/u01/psdefault/psdefault.dbf NO
/data/ora/H89UCBAC/u01/aaapp/aaapp.dbf NO
/data/ora/H89UCBAC/u01/aalarge/aalarge.dbf NO
/data/ora/H89UCBAC/u01/adapp/adapp.dbf NO
/data/ora/H89UCBAC/u01/amapp/amapp.dbf NO
/data/ora/H89UCBAC/u01/avapp/avapp.dbf NO
/data/ora/H89UCBAC/u01/bdapp/bdapp.dbf NO
/data/ora/H89UCBAC/u01/bnapp/bnapp.dbf NO
/data/ora/H89UCBAC/u01/bnlarge/bnlarge.dbf NO
...Nicolas. -
SQL QUERY TO CHECK FIREWALL PORTS
Hi All,
These is Nani..I am looking for a sql script to show inbound sql ports opened under windows firewall.
Thank You in Advance for your help.
Thanks,
Nani.
NBHi Nani55,
Please refer to the following query:
select distinct local_net_address, local_tcp_port from sys.dm_exec_connections
where local_net_address is not null
The query will return the local IP as well as the listening Port number. For more information, please see:
sys.dm_exec_connections (Transact-SQL):
http://msdn.microsoft.com/en-us/library/ms181509.aspx
Elvis Long
TechNet Community Support -
SQL query to check continious records
With T1 As ( SELECT ‘E1’ as E ,1100 as T , 15.0787 as SM1 , 16.1345 as EM1 from dual union all
SELECT ‘E1’ ,1100 , 16.084 , 18.045 from dual union all
SELECT ‘E2’ ,1100 , 15.0787 , 16.1345 from dual union all
SELECT ‘E2’ ,1100 , 15.0327 , 18.045 from dual union all
SELECT ‘E3’ ,1100 , 15.0197 , 16.1445 from dual union all
SELECT ‘E3’ ,1100 , 16.1445 , 18.045 from dual union all
SELECT ‘E4’ ,1100 , 13.0787 , 14.0743 from dual union all
SELECT ‘E4’ ,1100 , 14.0743 , 34.0843 from dual union all
SELECT ‘E4’ ,1100 , 34.0843 , 54.0743 from
SELECT ‘E4’ ,1110 , 13.0787 , 14.0743 from dual union all
SELECT ‘E4’ ,1110 , 14.0743 , 34.0843 from dual union all
SELECT ‘E4’ ,1110 , 34.0843 , 54.0743 from union all
SELECT ‘E1’ ,1100 , 19.084 , 20.045 from )
Main Output should be come as
E1 1100 15.0787 18.045
E2 1100 15.0787 16.1345
E2 1100 15.0327 18.045
E3 1100 15.0197 18.045
E4 1100 13.0787 54.0743
E4 1110 13.0787 54.0743
E1 1100 19.084 20.045
could you help me with an sql to get the first output ?
Logic to derive the above output:
For a particular set of E and T as long as the EM1 of previous record <=SM1 of next record and SM1 of previous record < = SM2 of next record then consider it as a continious record. So record will become for this set
‘E1’ 1100 15.0787 16.1345
‘E1’ ,1100 , 16.084 , 18.045
temporary Output wll be : E1 1100 15.0787 18.045Hi,
user5698021 wrote:
With T1 As ( SELECT ‘E1’ as E ,1100 as T , 15.0787 as SM1 , 16.1345 as EM1 from dual union all
SELECT ‘E1’ ,1100 , 16.084 , 18.045 from dual union all
SELECT ‘E2’ ,1100 , 15.0787 , 16.1345 from dual union all
SELECT ‘E2’ ,1100 , 15.0327 , 18.045 from dual union all
SELECT ‘E3’ ,1100 , 15.0197 , 16.1445 from dual union all
SELECT ‘E3’ ,1100 , 16.1445 , 18.045 from dual union all
SELECT ‘E4’ ,1100 , 13.0787 , 14.0743 from dual union all
SELECT ‘E4’ ,1100 , 14.0743 , 34.0843 from dual union all
SELECT ‘E4’ ,1100 , 34.0843 , 54.0743 from
SELECT ‘E4’ ,1110 , 13.0787 , 14.0743 from dual union all
SELECT ‘E4’ ,1110 , 14.0743 , 34.0843 from dual union all
SELECT ‘E4’ ,1110 , 34.0843 , 54.0743 from union all
SELECT ‘E1’ ,1100 , 19.084 , 20.045 from )Thanks for posting this. Please test (and, if necessary, correct) your code before you post it. The code above has syntax errors.
Use only straight single-quotes (CHR (39)) around string literals. That is, don't say:
SELECT ‘E1’ , ...instead, say:
SELECT 'E1' , ...
Main Output should be come as
E1 1100 15.0787 18.045
E2 1100 15.0787 16.1345
E2 1100 15.0327 18.045
E3 1100 15.0197 18.045
E4 1100 13.0787 54.0743
E4 1110 13.0787 54.0743
E1 1100 19.084 20.045
could you help me with an sql to get the first output ?
Logic to derive the above output:
For a particular set of E and T as long as the EM1 of previous record <=SM1 of next record and SM1 of previous record < = SM2 of next record What is sm2?
then consider it as a continious record. So record will become for this setWhat does "previous" mean in this case? If you look at 2 rows, how can you tell which comes first? Remember, there is no built-in order to rows in a relational database. Are there other significant columns in the table that you haven't shown?
‘E1’ 1100 15.0787 16.1345
‘E1’ ,1100 , 16.084 , 18.045
temporary Output wll be : E1 1100 15.0787 18.045You can use LEAD or LAG to see when a new group starts, creating a new column with 0 or 1. Use the analytic SUM function on that column to see how many groups have already begun, and then GROUP BY that number; something like this:
WITH got_grp_start AS
SELECT e, t, sm1, em1
, order_col
, CASE
WHEN e = LAG (e) OVER (ORDER BY order_col)
AND t = LAG (t) OVER (ORDER BY order_col)
AND sm1 BETWEEN LAG (sm1) OVER (ORDER BY order_col)
AND LAG (em1) OVER (ORDER BY order_col)
THEN 0
ELSE 1
END AS grp_start
FROM t1
, got_grp AS
SELECT e, t, sm1, em1
, SUM (grp_start) OVER (ORDER BY order_col) AS grp
FROM got_grp_start
SELECT e
, t
, MIN (sm1) AS start_sm1
, MAX (em1) AS end_em1
FROM got_grp
GROUP BY grp, e, t
ORDER BY grp
;I couldn't test this, of course.
I assume there's another column, order_col, in the table, that determines what "previous" means.
Edited by: Frank Kulash on Dec 7, 2012 6:15 AM -
Dear Sir/Mam
I want SQL query, function or SP which converts binary data to image (.jpg format).
I m able to convert image (.jpg format) to varbinary. But not able to convert vice versa.
thanks in advance.Binary data is binary data - "image" is only an intrepretation of binary data. Therefore your question makes little sense in the context of sql server since it does not have any facilities to utilize images. Since you provide no context, I'm
guessing that you are trying to retrieve an image stored in the database in a varbinary column and have your application use it as an image. If so, you should post your question to a forum that is specific to your development environment. -
Any way of importing from Access to SQL Server?
I have a huge store of information in Access. But now I'm required to use SQL Server.
Is there any way of importing the information from Access to SQL Server by Java programming?
Or is there a manual way of doing that?
Thank you in advance.I need to use Java because this is for a client. I
can't expect the client to follow those steps. As a
result, I want to create something simple for the
client to convert from Access to SQL Server.
Any other way of doing that?
That argument does not make sense.
There is no way that a 'client' is going to be able to manage MS SQL Server without understanding how it works. MS SQL Server is a complex database and requires at least some dedicated support, even if it is only part time.
For example consider the following:
-MS Access does not have a log file. MS SQL Server does. How is the log file going to be sized?
-If the log file fills up (like for a run away query) MS SQL Server comes to a screeching halt. How is that problem going to be fixed?
Now maybe you are going to provide that support, which means you can run those scripts. Or the client is going to support it in which case they need to have someone who understands it - and they will need to know how to run those scripts (since it is rather basic knowledge.) -
Query to check cross segment postings
Hi,
I have a database with a segmented chart of accounts. It has only 1 segment for the company. The client would like to have the ability to post across segments however I need to ensure that the journal is always balanced overall, but aswell as with a specific segment.
I would like to create a SQL query to check all my journal entries to determine weather the journal is balanced on all segments...
Any ideas?
Grant
Edited by: Darius Heydarian on Mar 27, 2008 2:06 PMHi Suda,
I have a journal as follows:
Account Code--Debit--
Credit
720002-002--2000--
720002-003--1000--
720001-001----
3000
201201-001--3000--
201201-002----
2000
201201-003----
1000
In the above example you will notice that the journal is balanced, and the debits and credits between each segment is also balanced. This transaction is therefore acceptable.
If the journal is balanced, but the debits and credits for a specific segment are not in balance then the transaction is not acceptable.
I need a way to either block these type of journals or alternatively to provide a report to highlight the "incorrect" journals...
Hope hope this makes my requirement a little clearer...
Regards
Grant
Edited by: Grant Boshard on Mar 13, 2008 1:55 PM
Maybe you are looking for
-
Hi, Anyone knows if it´s possible to set the file path of an image to it's metadata keyword field using a script in Bridge? Thank you!
-
Lisence Question regarding our Flash Builder Lisence
Our company uses Flash Builder with the following key: 1424-4000-.... We do not know how many lisences we have and how we could get flash builder version 4.7? Do we have to pay extra for that also when we bought a lisence in 2010`? KR Markus Stechele
-
Why is the new Mavericks download so slow?
I am currently in Afghanistan ritenow. I am trying to upgrade to the new Mavericks, and I want to know how long it usualy takes?
-
Varient display in ALV Classes
Hi I am using ALV Classes. I need to use varient for selection screen parameter. In this case, I need to pass group of values for this parameter. how to implement this requirement. Cud u pls suggest this. Regards, Naseer
-
The certificate is not trusted because it is self signed
Hi, My problem can sum up to "sec_error_ca_cert_invalid into Intranet". In fact the certificate of an intranet website present in my society is self signed. Then like write here : https://support.mozilla.org/en-US/kb/secure-connection-failed-error-me