How to change sql sentence which arrives database.
I am using ORACLE 10G,
I want to add criteria all sql sentence which come ORACLE 10G ,
how to do it ? , trigger or another system attributes
for example
if "select * from user" sql sentence come to db server, I want to change this sentence as "select * from user where mod =1"
thanks
All of my tables have "mode" column, when sql sentence come , I 'll read system_mode another database and then I read,delete,insert and update my tables according to this system_mode,
how to do this, I should block sqls , then read system_mode and finally add this criteria end of the sql sentence
thanks
Similar Messages
-
How to change the db_name of the database in oracle 9i
Please Tell me
How to change the db_name of the database in oracle 9i
regardsALTER DATABASE RENAME oldname TO newnameThis is not a valid command.
@OP, you may want to check into the NID Utility. -
How to change a connection with the database in Runtime?
How to change a connection with the database in Runtime?
My connection was made using ADF Business component (ApplicationModule).
ADF Swing.
JDeveloper Studio 11.1.1.4.0.When deploying ADF applications with database connection, you should be using JDBC data sources configured in the weblogic server.
You could change the JDBC data sources to a different DB instance or location - by changing the JDBC data source and restarting the weblogic server.
For more details, check
http://techiecook.wordpress.com/2010/12/02/oracle-weblogic-adf-datasources/
Thanks,
Navaneeth -
HOW TO CHANGE SQL QUERY TO GET SPECIFIC RESULT
I HAVE FOLLOWING QUERY AND ITS FUNCTIONING BUT I WANT ALL THOSE RECORD SHOULD BE DISPLADE WICH HAVE NO TRANSACTION IN SALES ANS SALES RETURN WHILE RETREVING DATA FROM DATABASE.
I TRIED TO USE + OPERATOR BUT I DON'T KNOW HOW TO CHANGE THE QUERY TO GET THE RESULT
MAIN TABLE IS BEING USED TO FETCH RECORD
SALES_HEADER,SALES_DETAIL
SALES_HEADERR,SALES_DETAILR
STOCK_REG
AND THE QUERY IS
select s.item_code,S.DESCR,s.GRAND_TOTAL,
sum(decode(d.dayno,01,NVL(S.QTY,0),0)) DAY1,
sum(decode(d.dayno,02,NVL(S.QTY,0),0)) DAY2,
sum(decode(d.dayno,03,NVL(S.QTY,0),0)) DAY3,
sum(decode(d.dayno,04,NVL(S.QTY,0),0)) DAY4,
sum(decode(d.dayno,05,NVL(S.QTY,0),0)) DAY5,
sum(decode(d.dayno,06,NVL(S.QTY,0),0)) DAY6,
sum(decode(d.dayno,07,NVL(S.QTY,0),0)) DAY7,
sum(decode(d.dayno,08,NVL(S.QTY,0),0)) DAY8,
sum(decode(d.dayno,09,NVL(S.QTY,0),0)) DAY9,
sum(decode(d.dayno,10,NVL(S.QTY,0),0)) DAY10,
sum(decode(d.dayno,11,NVL(S.QTY,0),0)) DAY11,
sum(decode(d.dayno,12,NVL(S.QTY,0),0)) DAY12,
sum(decode(d.dayno,13,NVL(S.QTY,0),0)) DAY13,
sum(decode(d.dayno,14,NVL(S.QTY,0),0)) DAY14,
sum(decode(d.dayno,15,NVL(S.QTY,0),0)) DAY15,
sum(decode(d.dayno,16,NVL(S.QTY,0),0)) DAY16,
sum(decode(d.dayno,17,NVL(S.QTY,0),0)) DAY17,
sum(decode(d.dayno,18,NVL(S.QTY,0),0)) DAY18,
sum(decode(d.dayno,19,NVL(S.QTY,0),0)) DAY19,
sum(decode(d.dayno,20,NVL(S.QTY,0),0)) DAY20,
sum(decode(d.dayno,21,NVL(S.QTY,0),0)) DAY21,
sum(decode(d.dayno,22,NVL(S.QTY,0),0)) DAY22,
sum(decode(d.dayno,23,NVL(S.QTY,0),0)) DAY23,
sum(decode(d.dayno,24,NVL(S.QTY,0),0)) DAY24,
sum(decode(d.dayno,25,NVL(S.QTY,0),0)) DAY25,
sum(decode(d.dayno,26,NVL(S.QTY,0),0)) DAY26,
sum(decode(d.dayno,27,NVL(S.QTY,0),0)) DAY27,
sum(decode(d.dayno,28,NVL(S.QTY,0),0)) DAY28,
sum(decode(d.dayno,29,NVL(S.QTY,0),0)) DAY29,
sum(decode(d.dayno,30,NVL(S.QTY,0),0)) DAY30,
sum(decode(d.dayno,31,NVL(S.QTY,0),0)) DAY31,
sum(S.qty) TU
FROM
(select nvl(sales_detail.qty+sales_detail.bonus,0) as qty,
sales_detail.item_code AS ITEM_CODE,
stock_reg.descr AS descr,
s_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
SALES_DETAIL,SALES_HEADER,STOCK_REG
WHERE SALES_DETAIL.S_ID = SALES_HEADER.S_ID AND
SALES_DETAIL.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
STOCK_REG.COMCODE='C1'
UNION all
select -1*nvl(sales_detailR.qty+sales_detailR.bonus,0) as qty,
sales_detailR.item_code AS ITEM_CODE,
stock_reg.descr AS descr,
RETURN_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
STOCK_REG.COMCODE='C1') S,
(select level as dayno
from dual
connect by level <= 31) d
where d.dayno = to_char(s.sALE_date, 'DD') AND TO_DATE(S.SALE_DATE) BETWEEN '&FROMDATE' AND '&TODATE'
GROUP BY S.ITEM_CODE,S.DESCR,S.GRAND_TOTALwell my query running successfully just the quesion was that i wanted to bring some changes in the query to retrieve the complete record which has no transaction in sales
for exmple
if i write the quey
select dept.deptno,sum(sal) from emp,dept
where dept.deptno = emp.deptno
group by dept.deptno
the recult comes as
DEPTNO SUM(SAL)
10 8750
20 10875
30 9400
though there is another deptno which is deptno no 40
have no sal
and when i use this query
select dept.deptno,sum(sal) from emp,dept
where dept.deptno = emp.deptno(+)
group by dept.deptno
it shows the dept no 40 also
DEPTNO SUM(SAL)
10 8750
20 10875
30 9400
40
so to get this i posted query which was to long to understand easily.
i accept that i sholud post short query to make other understand
so check out this
select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE
AND RETURN_DATE = '01-APR-08'
GROUP BY STOCK_rEG.item_code
ORDER BY TO_NUMBER(ITEM_CODE) ASC
when i execute this query i get the following result
ITEM_CODE QTY
84 2
102 3
108 3
116 6
166 3
170 3
thoug there is other items are aalso available in stock which transaction
yet not been done or not been sold out/
so when i use the outer join i get the same result
select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.STOCKCODE(+) = STOCK_REG.STOCKCODE
AND RETURN_DATE = '01-APR-08'
GROUP BY STOCK_rEG.item_code
ORDER BY TO_NUMBER(ITEM_CODE) ASC
ITEM_CODE QTY
84 2
102 3
108 3
116 6
166 3
170 3
hope i tried to make u understand on better way -
How to change sql-plan in shared pool?
Hi, all.
The oralce is 10.2.0.4 on sun unix.
I created statistics for an index of a table (so big.. partitioned).
As a result, some queries run very well, but some others went bad.
One query, which made a big impact to reponse time, is using "index skip scanning".
However, the query uses "PK index" with bind valuables in sqlplus session.
How can I change sql execution plan in library cache without modifying sql statement in an application module?
Thanks in advance.
Have a good day.Thanks to your reply.
After creating outlines, how can I make EVERY NEW session to use the stored outline??
To be more specific, how can I issue the following command to every new session?
-->ALTER SESSION SET use_stored_outlines=my_OUTLINES;
Do I need to issue the following command??
-->alter system set use_stored-outlines=my_OUTLINES??
Thanks .. -
How to change sql expression of SQL-Calculated Attribute of view object ?
Hi
jdev 11.1.1.5
I have a view object with a SQL-Calculated Attribute (sumAnalytic) how can I change sql expression of this attribute in runtime?
for example in application module method??Hi Mr Timo
Thanks for your reply but I do not need dynamic vo because I can not change all of my vo
I only need to change expression of SQL-Calculated Attribute of view object in run time.
For this I set expression in view object something like this 'select 2 from dual' and in run time in my AM method I get the vo query and replace 'select 2 from dual' with something like 'selet sum(amnt) over (partition by 1)' and set new query.
But I think the better solution must exist
Thanks -
How to change the nls_sort in a database?
Hello,
I would like to change the nls_sort of a database, Is there a way to do it?
If it is not possible, If I changed the nls_sort of the tables it would work too... But I do not know how to do this, neither.
Thank you very much if you can help me,
Icaro Alzuru C.Hello,
Thank you for your answer.
What file do I have to modify with the nls_sort parameter?
I am using Oracle 10g in Windows 2000 Server.
Thank you very much,
Icaro Alzuru C. -
How to connect SQL Dev to local database?
Hi all,
I have a local database on my laptop. I connect to the database using direct connect without passing the listener and tnsnames.ora, because I shut it down.
How can I connect my SQL Developer to the database using direct connect?
ThanksI don't think this is possible because even the basic connection type requires to give a hostname, port number and Oracle SID:
http://download.oracle.com/docs/cd/E18464_01/doc.30/e17472/dialogs.htm#BACEDDJF -
How do change SQL Express's in my application?
How do I change an older application created under SQL Express 2005 to SQL Express 2008(R2)? I can run this application using Debug, but can't publish it because of the following message:
INSTALL LOG:
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.0.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package '.NET Framework 3.5 SP1', phase BuildList
Reading value 'SP' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5'
Read integer value 1
Setting value '1 {int}' for property 'DotNet35SP'
The following properties have been set for package '.NET Framework 3.5 SP1':
Property: [DotNet35SP] = 1 {int}
Running checks for command 'DotNetFX35SP1\dotNetFx35setup.exe'
Result of running operator 'ValueGreaterThanEqualTo' on property 'DotNet35SP' and value '1': true
Result of checks for command 'DotNetFX35SP1\dotNetFx35setup.exe' is 'Bypass'
'.NET Framework 3.5 SP1' RunCheck result: No Install Needed
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86)', phase BuildList
Running external check with command 'C:\Users\Terry\AppData\Local\Temp\VSD8D4D.tmp\SqlExpress\SqlExpressChk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'SQLExpressInstalled'
The following properties have been set for package 'SQL Server 2005 Express Edition SP2 (x86)':
Property: [SQLExpressInstalled] = 1 {int}
Running checks for command 'SqlExpress\sqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionNT' and value '5.1': true
Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Bypass'
Running checks for command 'SqlExpress\sqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1.2': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': true
Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Fail'
'SQL Server 2005 Express Edition SP2 (x86)' RunCheck result: Fail
A prerequisite failed for Package "SQL Server 2005 Express Edition SP2 (x86)"
Package failed with message "This version of SQL Server 2005 Express Edition (x86) is not supported for the current processor
The above was highlighted by me to save you some scanning.
The following is what I have installed on my PC:
Terry 01Below messages are logged during installation
<install log>
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86)', phase BuildList
Running external check with command 'C:\Users\Terry\AppData\Local\Temp\VSD8D4D.tmp\SqlExpress\SqlExpressChk.exe' and parameters ''
Running checks for command 'SqlExpress\sqlexpr32.exe'
<install log>
and screenshot also shows the same.
I am NOT an expert in Visual Studio but I would guess that when you have build your package, would have a checkbox somewhere to mention SQL 2005 as pre-requisite. something which should
say check for prerequisites for SQL server 2005 express edition??
On this machine, since you have SQL 2008 R2 installed, the check is failing and hence installation?
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
How to change the width of the database-scalar data type
I have a new problem. I have a parameter F_Organization in my report(version 6i) of type Database-scalar. now that the width is fixed in property pallete. Is there any way to change the width of this parameter,if so how. will some one let me know
I did the same, opened the data model typed some dummy character and then deleted them, if u give the alias for the source it does not change the width, instead if u give the original name as the source it changes the width. I do not know why is this happening?
Message was edited by:
user552442 -
How to find sql statement which generates LOCK
Hello,
In my plsql procedure i have used SELECT FOR UPDATE NO WAIT statement to avoid the current record used by another user.
Actually i want to find which sqlquery is locking the Object other than my procedure.
I can find the session id which is locking the object but i can not able to find sql text.
How to find the SQL text from particular LOCKING Session id as v$sql or v$sqltext or v$sqlarea dont have session id?
Any help can be appreciated.
Thanks in advance.It's not necessarily that easy to find the statement that was responsible for the lock.
It depends.
First of all, it depends on version.
If you're >= 10g and you're lucky and you're licensed for Diagnostic Pack, you might find it in ASH.
If the statement that's responsible for the lock is also waiting on something else or runs for long enough, then ASH will almost certainly have it.
Doug Burns has a 10-part series on the subject.
http://oracledoug.com/serendipity/index.php?/archives/1477-Diagnosing-Locking-Problems-using-ASH-Part-1.html -
How to change SQL Server security groups name after server rename?
A Windows 2003 server has been renamed from LAMDAMIRROR1A to LAMDAMIRROR2A and the following
sql has been run in SQL Server 2008 R2 on the server :
exec sp_dropserver 'LAMDAMIRROR1A'
exec sp_addserver 'LAMDAMIRROR2A','local'
However, although everything appears ok, the 5 Windows 2003 Groups (automatically created by
the SQL 2008 R2 Install) still contain 'LAMDAMIRROR1A' in their name. Does this matter ? Can the Windows Groups be just renamed (right click , rename) or will this cause problems ?
The Windows Groups are :
SQLServer2005SQLBrowserUser$LAMDAMIRROR1A
SQLServerDTSUser$LAMDAMIRROR1A
SQLServerMSSQLServerADHelperUser$LAMDAMIRROR1A
SQLServerMSSQLUser$LAMDAMIRROR1A
SQLServerSQLAgentUser$LAMDAMIRROR1A
There are also Registry entries containing the old 'LAMDAMIRROR1A' name. Does this matter ?
Should this be changed ?
eg.
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\Machines\OriginalMachineName.
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Services\Report Server\GroupPrefix.
My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\printers\Microsoft XPS
DocumentWriter\DsSpooler\serverName.
etcHi,
If you have executed the sp_dropserver and sp_addserver in SQL Server 2008 R2, we need to verify if you renamed the SQL Server instance successfully. You can select information from @@SERVERNAME or sys.servers to verify if the renaming operation is completely
successful in SQL Server Management Studio (SSMS). If yes, whether you change the registry entries containing the old 'LAMDAMIRROR1A' name or not, there’s no impact on SQL Server Services. For more details, please review this article:
How to: Rename a Computer that Hosts a Stand-Alone Instance of SQL Server.
In addition, if you must rename the windows groups, you can just right-click the group in Computer Management/System Tools/Local Users and Groups/Groups and rename it, or you can create new groups with new names, for more details, please review this article:
Manage Local Groups. If there are some issues regards the Windows, you can post the question in the Windows Server forums at
http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?category=windowsserver . It is appropriate and more experts will assist you.
Thanks
Lydia Zhang -
How To Change Map Drive for my Database?
Hi all,
I bought an external Usb Disk with 1TB storage capacity and attached it to my laptop, because I am running out of space for new 11g Database Creation.
It was mapped by default at G:\ then I created a new database 11g on it. Then during night time, I shutdown my laptop and remove my external disk.
Next morning I startup my laptop again and attached by external disk. But to my surprise it is mapped as E:\ so I can not startup my database :(
How can I switch it back to G:\ please.
Thanks a lot.KinsaKaUy? wrote:
Hi all,
I bought an external Usb Disk with 1TB storage capacity and attached it to my laptop, because I am running out of space for new 11g Database Creation.
It was mapped by default at G:\ then I created a new database 11g on it. Then during night time, I shutdown my laptop and remove my external disk.
Next morning I startup my laptop again and attached by external disk. But to my surprise it is mapped as E:\ so I can not startup my database :(
How can I switch it back to G:\ please.
Thanks a lot.
Hi,
Right click on my computer, choose manage, choose disk management under storage, choose your external drive, right click and choose change drive letters and path, change it to G:
Cheers -
10g express, how to change port number for the database home page
10g express uses port 8080 for its http listener. However this number has been used by Tomcat on my computer. How can I chang the port number for the 10g home page?
Regards
jlAndy, thank you very much, I have been able to changed the port number following your advice.
I hope you do not mind I ask a further questions along this line:
I installed 10 express db on 2 computers. One with Tomcat and the other without. Following your advice, I successfully changed the port number on the one without Tomcat.
On the one with Tomcat, I believe it was because I installed the 10g express while the Tomcat was running, I can neither go to the 10g's home page (page cannot be displyed), nor logon to the database from sqlplus (ora-12560: TNS:protocal error) even after I shut down the Tomcat. By checking with 'netstat -an', it is known that the http listerner is not listerning.
Can I change some configuration file to solve this problem? Or do I have to reinstall 10 ex? I prefer the 1st aproach of changing config file, even it is not as easy as reinstallation.
Thanks
jl -
How do I set up my macbook pro where it mail that I delete off my iphone will be automatically deleted off my macbook pro and ipad? Be specific; I have no idea how to set up mail in IMAP. This is a mobileme account I've had since 2007 and is now set up with icloud, but for over a year now, no syncing (deleting) mail i've deleted off my phone.
Try this to change the deleted folder on the ipad to the same as on your mac
http://ipad.screensteps.com/m/mail/l/13040
The steps are pretty much the same as the gmail account used in the instructions, you may also be able to refresh the email folder list on the mac
Maybe you are looking for
-
How to populate salary admin screen from grade rate
Hi there, I am trying to set up grade related pay in an organization where there are a large number of employees with multiple assignments. It is my understanding that the flexible Grade Ladder Functionality can only be used against the primary assig
-
How to launch my RESTful TEST with JAVA EE application in NetBeans 6.5
Hi, I want to TEST my RESTful WebService in my JAVA Enterprise Application. I have a bit database in my EJB Module. Resuming, I have two modules (EJB + WAR) and Enterprise Application (JAVA EE that contains the before modules). Appears two kind of er
-
While downloading the lion install app from the apple app store, the download gets nearly finish then an error pops up that says an error has occured. Then everything goes away and I have to restart the install process over again. Any helps? I really
-
Printing, sometimes I do not want to print in color
In MS I can print a color picture in color, black and white or grey. Sometimes just makes sense to test in non color to save ink cost. It there such a setting like in MS?
-
I update my credit card but the paymaent has not been debiteded yet
I update my credit card but the paymaent has not been debiteded yet, what do I need to do?