Help SQL Query (Not working as it should)
Hello everybody,
I'm using JDeveloper 12.1.2.0.0 . I'm doing a bidirectional comunication using 3 tables, with bindings between them (and using HR schema).
In my example, i have something like:
Departments, Employees and SalaryByJobs (i created this table where it shows the departmentd id, employee id, job, salary).
Whenever i click on one OR more departments, the employees table update by putting on the table, the employees that belong to the selected department and the salaryByjob put the jobs by employees selected on the employees table.
So it's something like this:
Departments selected -> employees selected -> salarybyjbobs of those employees.
My Employees query (in the view) has the following code:
SELECT Employees.COMMISSION_PCT,
Employees.DEPARTMENT_ID,
Employees.EMAIL,
Employees.EMPLOYEE_ID,
Employees.FIRST_NAME,
Employees.HIRE_DATE,
Employees.JOB_ID,
Employees.LAST_NAME,
Employees.MANAGER_ID,
Employees.PHONE_NUMBER,
Employees.SALARY
FROM EMPLOYEES Employees
WHERE ( DEPARTMENT_ID IN (select * from THE(select cast( in_list(:variavel3) as mytableType ) from dual ) a))
Since i use bindings, the employees table don't show anything in the beginning, so i added this parte to my employees query: OR nvl(:variavel3,0) = 0
But now, whenever i try to select more than one row, it gives me invalid numbers and i don't understand why..
It's only more one line of code and it's not in the bean.
Can anyone help me?
Ps - The bean goes department by department, appends the departments with "," and for each department, gets the employees that belongs to them.
My best regards,
Frederico Barracha.
The expression NVL(:variavel3,0)=0 is not correct. The datatype of the return value of the NVL function is considered equal to the datatype of the 1st argument (i.e to the datatype of the bind variable :variavel3). You said that this variable contained a comma-separated list of IDs, so the variable's datatype is VARCHAR2. As far as you are comparing the NVL-expression to a number, you get "Invalid number" exception, because Oracle is expecting a numeric datatype at the left side of the comparison operator.
In order to avoid the "Invalid number" exception you can modify the expression using one of the following options:
:variavel3 IS NULL
NVL( :variavel3, '*' ) = '*'
NVL( :variavel3, '0' ) = '0'
The 1st option if the simplest and the most clear one.
Dimitar
Similar Messages
-
Inline transform for Sql Query not working in SAP MII 12.1 Version 12.1.8 B
Hi All,
I applied an xslt for an sql query which returns an xml file.
I used inline transform icon in sql query to load an xsl file which has to return me a string
Any idea why is not working for me..?
My Sample XML file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/XMII/CM/BatchDisposition/BatchQueueManagement/StyleSheets/ProductXsl.xsl"?>
<Rowsets DateCreated="2011-05-05T07:27:45" EndDate="2011-05-05T07:27:45" StartDate="2011-05-05T06:27:45" Version="12.1.8 Build(20)">
<Rowset>
<Columns>
<Column Description="ProductName" MaxRange="1" MinRange="0" Name="ProductName" SQLDataType="12" SourceColumn="ProductName"/>
</Columns>
<Row>
<ProductName>Asprin 100mg Tablets 12 x10 strip</ProductName>
</Row>
<Row>
<ProductName>Asprin 300mg Tablets 12 x10 strip</ProductName>
</Row>
<Row><ProductName>Ibprooven 200mg Tablets 12 x 10 strip</ProductName></Row>
<Row><ProductName>RipTide 50mg Tablets 40 x10 strip</ProductName></Row>
<Row><ProductName>Seroquel 200mg Tablets 6 x10 strip</ProductName></Row>
<Row><ProductName>Seroquel 400mg Tablets 12 x10 strip</ProductName></Row>
</Rowset>
</Rowsets>
My Sample XSl File:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:text>["</xsl:text>
<xsl:for-each select="Rowsets/Rowset/Row">
<xsl:value-of select="ProductName"/>
<xsl:if test="position() < last()">
<xsl:text>","</xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>"]</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Any Suggestions are Welcome:
ThanksSomething like this should work...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
<xsl:copy-of select="/Rowsets/FatalError"/>
<xsl:copy-of select="/Rowsets/Messages"/>
<Rowset>
<Columns>
<Column Description="Mycol1" MaxRange="1" MinRange="0" Name="Mycol1" SQLDataType="12" SourceColumn="Mycol1" />
</Columns>
<Row>
<Mycol1>
<xsl:text>["</xsl:text>
<xsl:for-each select="/Rowsets/Rowset/Row">
<xsl:value-of select="." />
<xsl:choose>
<xsl:when test="position() < last()"><xsl:text>","</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>"]</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</Mycol1>
</Row>
</Rowset>
</Rowsets>
</xsl:template>
</xsl:stylesheet> -
Hi All,
Please help with the error ORA-00923: FROM keyword not found where expected.
I am trying to execute the following SQL query.
SELECT
CASE
WHEN (Grouping("PRICECATEGORY"."PriceCategoryName")=1) THEN "PriceCatTotal"
ELSE "PRICECATEGORY"."PriceCategoryName"
END AS "PRICECATEGORY"."PriceCategoryName",
CASE
WHEN (Grouping("LINEITEM"."LineDescription")=1) THEN "LineTotal"
ELSE "LINEITEM"."LineDescription"
END AS "LINEITEM"."LineDescription" ,
*"INVOICE"."InvoiceDate",*
Sum("TRANSACTION"."TotalPrice") as "TotalPrice",
Sum("INVOICE_CHILD"."QUANTITY") as "Quantity"
FROM "LINEITEM","INVOICE","TRANSACTION","PRICECATEGORY", "INVOICE_CHILD"
WHERE "TRANSACTION"."InvoiceID"="INVOICE"."InvoiceNumber"
and "TRANSACTION"."PriceCategoryID"="PRICECATEGORY"."PriceCategoryID"
and "INVOICE_CHILD"."INVOICEID"="INVOICE"."InvoiceID"
and "PRICECATEGORY"."PriceCategoryID"="TRANSACTION"."PriceCategoryID"
and "TRANSACTION"."PriceCategoryID"="PRICECATEGORY"."PriceCategoryID"
and "PRICECATEGORY"."PriceCategoryID"="TRANSACTION"."PriceCategoryID"
and "LINEITEM"."LINEITEMID"="TRANSACTION"."LineItemID"
and "LINEITEM"."PRICECATEGORYID"="PRICECATEGORY"."PriceCategoryID"
and "INVOICE"."InvoiceDate" >= :STARTDATE and "INVOICE"."InvoiceDate" <= to_date(:ENDDATE,'DD-MON-YY')+1
GROUP BY "PRICECATEGORY"."PriceCategoryName", "LINEITEM"."LineDescription" WITH ROLLUP
I am using a from keyword at the right place and all the aliases are properly used.
Please advice.
Regards,
Sandeep ReddyJaydip and Jeff are correct:
<li>Jaydip points out that <tt>"PRICECATEGORY"."PriceCategoryName"</tt> and <tt>"LINEITEM"."LineDescription"</tt> are not valid column alias names. They must be unqualified, nonquoted/quoted identifiers.
<li>Jeff indicates that <tt>WITH ROLLUP</tt> is not Oracle SQL syntax, and provides a sample of the required ROLLUP/CUBE clauseOracle SQL <tt>ROLLUP/CUBE clause</tt>.
Additionally, <tt>TRANSACTION</tt> is an Oracle keyword and therefore a poor choice as a database identifier: change the name of this table as soon as possible.
You're having this problem because not all "SQL" is created equal. Your OdeToCode source appears to be a site dealing with Microsoft technologies (SQL Server in this case). Unless you are very familiar with Oracle and SQL Server and the inherent differences between them you'd be advised to stick to purely Oracle resources (I know I do). There are plenty of good Oracle resources out there.
You'll also find it a lot easier to write, read and spot problems in SQL and PL/SQL code if you avoid using quoted identifiers (please tell us the database objects don't have case-sensitive names?) and use short table aliases rather than full table names. And we'll find it easier to help you on this forum if you post code samples wrapped in \...\wrapped in <tt>\...\</tt> tags. -
SQL Query not working in action performed event of combobox in swing
hi all..
i have to retreive from the database based on the item selected in the comboBox.......
when the program runs for the first time the data of defaultselected item is being displayed...
but when another item is selected the data is not retrieved from the database....
i am able to print the selected item but unable to query the database for the selected item
private void resultsItemStateChanged(java.awt.event.ItemEvent evt) {
// TODO add your handling code here:
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:odbc:aa");
System.out.println("you have selected me : --- >" + results.getSelectedItem().toString());
sql="SELECT * FROM " + name + " WHERE term = ? ";
srch2 = conn.prepareStatement(sql);
srch2.setString(1,results.getSelectedItem().toString());
rs2 = srch2.executeQuery();
rs2.next();
tarea2.setText("\n Definition:"+rs1.getString(3));
tarea3.setText("\n Description:"+rs1.getString(4));
tarea4.setText("\n Related Terms:"+rs1.getString(5));
tarea5.setText("\n Hyperlinks : "+rs1.getString(6));
tarea6.setText("\n References:"+rs1.getString(7));
conn.close();
rs2.close();
} catch(Exception e){}
} please help me to query the database for the selected item
Thanks in advance...hi all..
i have to retreive from the database based on the item selected in the comboBox.......
when the program runs for the first time the data of defaultselected item is being displayed...
but when another item is selected the data is not retrieved from the database....
i am able to print the selected item but unable to query the database for the selected item
private void resultsItemStateChanged(java.awt.event.ItemEvent evt) {
// TODO add your handling code here:
ResultSet rs2=null;
PreparedStatement srch2 = null;
Connection conn1= null;
Statement us = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn1 = DriverManager.getConnection("jdbc:odbc:aa");
System.out.println("you have selected me : --- >" + results.getSelectedItem().toString());
sql="SELECT * FROM " + name + " WHERE term = ?";
srch2 = conn.prepareStatement(sql);
srch2.setString(1,results.getSelectedItem().toString());
rs2 = srch2.executeQuery();
rs2.next();
tarea2.setText("\n"+rs1.getString(3));
tarea3.setText("\n "+rs1.getString(4));
tarea4.setText("\n"+rs1.getString(5));
tarea6.setText("\n"+rs1.getString(6));
tarea5.setText("\n"+rs1.getString(7));
rs2.close();
conn1.close();
} catch(Exception e){
System.out.println(e);
After printing for the first time it is showing like this ...
java.sql.SQLException: ResultSet is closed
at sun.jdbc.odbc.JdbcOdbcResultSet.checkOpen(JdbcOdbcResultSet.java:6646)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:257)
at more_info.resultsActionPerformed(more_info.java:301)
at more_info.access$100(more_info.java:25)
at more_info$2.actionPerformed(more_info.java:121)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1242)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:569)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:605)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:814)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) -
SQL Query not working for column names with spaces
Hi People..
We have a strange situation wherein, the column name in the database table has a space inbetween like "Constant Name". While we write a JDBC statement code with the select query we get an exception for invalid syntax. It will help us in a great way if you have anything to inform us on this..
Thanks
PrabzUsing case sensitive names and names with spaces in it is not a good practice.
However, I believe the SQL standard accounts for this with quoted identifiers. I believe the syntax is
. select "My Field1", "My Field2"
. from "My Table'
Have also seen the following although it might be MS Access specific.
. select [My Field1], [My Field2]
. from [My Table] -
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum
so I'm running
select * from mytable where rownum = 1;and it gives me the first row but if I change the 1 for a 2 or 3 or 4 or 5 it's says that theres nothing :S
why?????????????????????
but if i change for between 1 and 5 it gave me the 4 rows :S :S
why???????????????????AlanWms wrote:
try this:
SELECT *
FROM (
SELECT bne.*, rownum myrow
FROM BAN_EVENTOS_CONFIRMACION bne WHERE ROWNUM <=5)
WHERE myrow = 2;
Wrong!!! Rows in table are not stored in any specific order. Rows are fetched based on execution plan. So if execution plan changed query will retrieve same rows but they can be fetched in a different order. Bottom line only ORDER BY guarantees order. Without ORDER BY there is no sense to talk about first row, second row, last row or any row position.
SY. -
Please help, simple query not working
Have the following script that I would like to run at multiple sites and create table columns if necessary:
DECLARE
table_name VARCHAR2 (30) := 'SITE_STATISTICS';
column_name VARCHAR2 (30) := 'SITE_MONTH';
column_data_type VARCHAR2 (30) := 'DATE';
column_count INTEGER;
dynamic_sql VARCHAR2 (4000);
BEGIN
SELECT COUNT (1)
INTO column_count
FROM SYS.USER_TAB_COLUMNS utc
WHERE utc.table_name = table_name AND utc.column_name = column_name AND utc.data_type = column_data_type;
SYS.DBMS_OUTPUT.ENABLE (4000);
IF column_count = 0 THEN
dynamic_sql :=
ALTER TABLE SITE_STATISTICS ADD (SITE_MONTH DATE);
EXECUTE IMMEDIATE dynamic_sql;
ELSE
DBMS_OUTPUT.put_line ('Not running Dynamic Sql, found ' || column_count || ' corresponding rows in sys.user_tab_columns');
END IF;
END;
EXIT;
At a given site I do not have the given column, and running the select from sys.user_tab_columns manually returns 0 rows. However, when I run this script it outputs the following:
Not running Dynamic Sql, found 128 corresponding rows in sys.user_tab_columns
What's going on!?Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create table abc (c1 number(10));
Table created.
SQL> DECLARE
2 table_name1 VARCHAR2 ( 30 ) := 'ABC';
3 column_name1 VARCHAR2 ( 30 ) := 'SITE_MONTH';
4 column_data_type1 VARCHAR2 ( 30 ) := 'DATE';
5 column_count INTEGER;
6 dynamic_sql VARCHAR2 ( 4000 );
7 BEGIN
8 SELECT COUNT ( 1 )
9 INTO column_count
10 FROM SYS.user_tab_columns utc
11 WHERE utc.table_name = table_name1
12 AND utc.column_name = column_name1
13 AND utc.data_type = column_data_type1;
14
15 SYS.DBMS_OUTPUT.ENABLE ( 4000 );
16
17 IF column_count = 0 THEN
18
19 dynamic_sql :='ALTER TABLE ABC ADD (SITE_MONTH DATE,SHIP_CONTANK INTEGER,SHIP_CONRAIL INTEGER)';
20
21 EXECUTE IMMEDIATE dynamic_sql;
22 ELSE
23 DBMS_OUTPUT.put_line ( 'Not running Dynamic Sql, found '
24 || column_count
25 || ' corresponding rows in sys.user_tab_columns'
26 );
27 END IF;
28 END;
29 /
PL/SQL procedure successfully completed.
SQL> desc abc
Name Null? Type
C1 NUMBER(10)
SITE_MONTH DATE
SHIP_CONTANK NUMBER(38)
SHIP_CONRAIL NUMBER(38) -
My MacBookPro is continuously buzzing, the backlights are not working although it should be on. Tried to cover the sensor, but it's not that. Also, it's telling me that I have no batteries and the charging is not working either.... Any help? PLEASE!!!!
Intel-based Macs: Resetting the System Management Controller (SMC)
-
okay i updated my iphone 5 and i changed my password and now i dont remember it i cant restore my phone because my power botton does not work so what should i do PLEASE HELP!!!!!!! Thanks
Hi sigrun from mo,
If you are having a button issue on your iPhone that prevents you from doing further troubleshooting, you may need to have the phone serviced. You may find the following page helpful:
Service Answer Center - iPhone
http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipho ne
Regards,
- Brenden -
I have OSX 10.7.5 on my imac, my idvd is not working correctly. Should I re-download this version again , do you think that it will help to improve the idvd operation?
First, iDVD is not and never has been part of OS X. If iDVD is not working correctly, then you should investigate possible problems with that application, support files, preferences, or cache.
Of course you can always reinstall OS X if you wish:
Reinstalling Lion/Mountain Lion Without Erasing the Drive
Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless. -
Oracle date parameter query not working?
http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
Delete
from CONCURRENCYTESTITEMS
where ITEMID = :xItemId
and ROWVERSION = :xRowVersion_prev
The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
The same code & query works in Sql Server, but not Oracle.
Public Function CreateConnection() As IDbConnection
Dim sl As New SettingsLoader
Dim cs As String = sl.ObtainConnectionString
Dim cn As OracleConnection = New OracleConnection(cs)
cn.Open()
Return cn
End Function
Public Function CreateCommand(connection As IDbConnection) As IDbCommand
Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
cmd.BindByName = True
Return cmd
End Function
<TestMethod()>
<TestCategory("Oracle")> _
Public Sub Test_POC_Delete()
Dim connection As IDbConnection = CreateConnection()
Dim rowver As DateTime = DateTime.Now
Dim id As Decimal
Using cmd As IDbCommand = CreateCommand(connection)
cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
Dim p As OracleParameter = New OracleParameter
p.Direction = ParameterDirection.ReturnValue
p.DbType = DbType.Decimal
p.ParameterName = "myOutputParameter"
cmd.Parameters.Add(p)
Dim v As OracleParameter = New OracleParameter
v.Direction = ParameterDirection.Input
v.OracleDbType = OracleDbType.TimeStampLTZ
v.ParameterName = "xRowVersion"
v.Value = rowver
cmd.Parameters.Add(v)
cmd.ExecuteNonQuery()
id = CType(p.Value, Decimal)
End Using
Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
Dim p As OracleParameter = New OracleParameter
p.Direction = ParameterDirection.Input
p.DbType = DbType.Decimal
p.ParameterName = "xItemId"
p.Value = id
cmd.Parameters.Add(p)
Dim v As OracleParameter = New OracleParameter
v.Direction = ParameterDirection.Input
v.OracleDbType = OracleDbType.TimeStampLTZ
v.ParameterName = "xRowVersion_prev"
v.Value = rowver
v.Precision = 6 '????
cmd.Parameters.Add(v)
Dim cnt As Integer = cmd.ExecuteNonQuery()
If cnt = 0 Then Assert.Fail() 'should delete
End Using
connection.Close()
End Sub
Schema:
-- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
CREATE TABLE "CONCURRENCYTESTITEMS" (
"ITEMID" NUMBER(19,0) NOT NULL,
"NOTES" NCHAR(200) NOT NULL,
"ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
STORAGE (
NEXT 1048576 )
Sequence:
-- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
START WITH 1
CACHE 20
MAXVALUE 9999999999999999999999999999still not comming...
i have one table each entry is having only one fromdata and one todate only
i am running below in sql it is showing two rows. ok.
select t1.U_frmdate,t1.U_todate ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf
from [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
on t0.DocEntry = t1.DocEntry
inner join ohem t2
on t2.empID = t0.U_empid where t0.U_empid between '830' and '850' and t1.U_frmdate ='20160801' and t1.u_todate='20160830'
in commond promt
select t1.U_frmdate,t1.U_todate ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf
from [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
on t0.DocEntry = t1.DocEntry
inner join ohem t2
on t2.empID = t0.U_empid where t0.U_empid between {?FromEmid} and {?ToEmid} and t1.U_frmdate ={?FDate} and t1.u_todate={?TDate}
still not showing any results.. -
Force encryption on SQL Server not working?
Hello Everyone,
I'm running SQL Server 2008 64-bit. I've installed a self-signed cert on the box and set "Force Encryption" and restarted SQL server.
I setup a client machine to trust the authority of the cert installed on the server. When I connect to that SQL server from SSMS from a client machine and select the "encrypt connection" option in the client Connection properties, SSMS correctly complains
that the cert on the server does not match the computer name I asked to log into . This is because, although the cert is trusted, the dns name dos not match the CN in the cert <- Perfect, exactly what I am expecting.
When I connect to the same SQL server from the same client but UNCHECK "encrypt connection" on the client, I'm able to login. Considering I've checked the "Force Encryption" on the server, the server should have rejected the connection. Why not?
Ameer DeenHi all,
We are implementing a Merge Synchronization solution which involves three SQL Servers located on three Azure locations worldwide and one on-premises location. We need to secure communications between all servers. We are evaluating the encryption of all server
communications through SSL:
http://technet.microsoft.com/en-us/library/ms191192.aspx
When we configure one server (let’s call it server A) to accept only encrypted connections (with Force Encryption=Yes) we still can connect from other server (let’s call it server B) that do not have the certificate installed. We would expect the server
B to fail in the attempt of connect as server A should only accept encrypted communications and those should need the certificated to encrypt/decrypt everything (commands and data).
We have also review the following forum post that is very similar to this one:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working
In all cases the Microsoft answer is:
“When the
Force Encryption option for the Database Engine is set to YES, all communications between client and server is encrypted no matter whether the “Encrypt
connection” option (such as from SSMS) is checked or not. You can check it using the following DMV statement”
When we run the provided DMV statement to check if encryption is enabled:
-- To check whether connections are encrypted between server and clients
SELECT encrypt_option
FROM sys.dm_exec_connections
We get “TRUE”. So theoretically encryption is enabled.
Then:
Why can we run SQL statements against server A from server B (with SSMS) without any certificate?
Are we wrong when we expect server A to refuse any client that do not have the right certificate?
How can server B, without any certificate, decrypt the data encrypted by server A?
Our intention is to encrypt all server in the same way so all of them will accept only encrypted communications. We are assuming that the Merge Agent will be able to communicate with the Publisher and the Subscriber through this encrypted environment. May
anyone please confirm ti?
Thanks for your help.
Best Regards
Benjamin Moles -
My iphone 5 lock button is not working. What should I do now? I bought it in feb 2012
Hi Atique ur rehman,
Thanks for your query.
If the sleep wake button on your iPhone is unresponsive, first try and reset all setting by going to Settings>General>Reset>Reset All Settings.
If this does not resolve the problem, I would sound more like a hardware based issue.
I would recommend that you contact AppleCare so they can run further tests and diagnostics to help you solve your solution better.
If you can also access an Apple Store Genius Bar or Apple Authorized Service Center, that would be much better.
Go to https://locate.apple.com/country for further support with your device!
Thanks,
KL -
What will you do if any SQL is not working. in oracle 10g....apps 11.5.10.2
928714 wrote:
yes sir.If you help me in answering my questions i wll be very thankful to you sir.
tnx,I haven't a clue.
As you have been advised in many of your posts, go study the documentation for whichever specific topic you are interested in.
For me to answer your questions, I would need to go get that documentation.
Then I would need to read that documentation.
Then I would need to write a forum post that interprets what I think I learned from that documentation.
It is so very much faster if YOU go do that instead of posting to a forum and expecting others to do it. You will remember what you study for a lot longer time if you teach yourself. -
I have a problem with Adobe Creative Cluod. Basically after installing the application when I open it I do not charge adobe products but remains all white screen. I tried to uninstall it and install it several times but it does not work.
What should I do?Hi Anto2211,
Please follow the thread: Black screen CC where this issue is already discussed and resolved.
Let me know for any further query.
Thanks,
Ratandeep Arora
Maybe you are looking for
-
I am facing problem with fuzzy PD logic controller for transfer function in control and simulation loop. Plz Help me in this regard................... i have attache snapshot of my program Attachments: fuzzy in simulation loop.JPG 52 KB
-
ESATA express card is available!!
http://store.yahoo.com/store4pc/sata-exc2.html Now I need 99 bucks. My enclosure is already ordered!
-
Folks, I need help getting all AD users that does not have exchange mailbox and I want to export them into TXT, or CSV file. can we have a Powershell command that can help us in such thing. Note my environment is Exchnage 2010 Samer F. Mustafa Micros
-
Getting money back from app store
how do you get money baack for the app stor when the app locks up your computer how do you get your money back for the maac app store when the app locks up your computer
-
Hi, My application requires DAQ counter channel to count the rising edge of the input signal connected to the source pin of the counter. This counting has to take place only when there is a high pulse in gate pin of the same counter.This can be devel