.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Oracle Query

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
 
Get a Table in the format  Column 1 - Total of 1st 4 records and then total of next 4 records..... an d last if 2 records remain then total of last 2 records Column 2 - Amount will come from database Column 3 - In 1st 4 records 3 records will be 'N' and last(4th) will be Y, then for next 4 - 3 will be 'N' and last will be 'Y'   Total            Amount          Sign 5000.00        1000.00          N 5000.00        2000.00          N 5000.00        500.00            N 5000.00        1500.00          Y 2000.00        1000.00          N 2000.00        1000.00          YRegards, Sweta Jain


View Complete Post


More Related Resource Links

Oracle Linked serve Query performance in 2000 vs 2008 R2 64 Bit

  
Hi everyone We have started to migrate one of our reporting systems from Sql 2000 to Sql 2008 R2.  One of the steps has been to test the perforance of certain Oracle linked server queries between each server.  We are finding on average 3 fold better perforance stats (in terms of query completion time) on the old server.  This should obviously not be the case.  The new server has signifantly more CPU/Memory/IO resources to play with, and it is 64 bit (not to mention its new!).  Here's what I got so far: Old server: SQL 2000 on W2000 both fully patched.  Old Dell Dual core with 3 GB of Ram running on two soft IDE Mirrored drives (yes I know... it sucks).  It connecting via the MS OLE DB provider for Oracle (9i client) New server: ESX VMware Server with 2 CPU's assigned, 8 GB of ram connected to large HP SAN.  CPU, ram and IO's have all been ruled out as the problem.  We've tried varying network cards with different results so we havent ruled that out yet.  Its connecting via the Oracle provider for OLE DB (11G 64 bit client) The linked server is an Oracle 9i fully patched server.  All three are on the same network backbone. Running a simple select * query on both servers returns the same number of rows (~76 000) .  It takes ~1:20 on the new server and ~0:20 on the old server. In looking at the wait stati

ORACLE QUERY CONVERT TO SQL SERVER QUERY

  
hai.......I am a biggner in SQL DB . but i started a complicated and painfull work in SQL SERVER 2008.the problem  convert Oracle hierarchical query to SQL query please help. the query SELECT DISTINCT         LEVEL LVL,         SCH.NSCHEDULE_SL,         SCH.NSCHEDULE_SL_FM,         SCH.CSHED_CNAMEFROM  FA_SCHEDULES SCH WHERE     LEVEL  = 1 AND    NSCHEDULE_SL_FM  IS NULL AND    NBRANCH_SL  = 2  CONNECT BY PRIOR SCH.NSCHEDULE_SL_FM  = SCH.NSCHEDULE_SL AND    NBRANCH_SL  = 2please help me

Analysis Service Oracle Number inconsistent Data Type for TABLE or Named Query

  
Dear Gurus, I'd VERY OLD PROBLEM. And I believe it addressed since 2006. When I design DataSource Views from Oracle Data Source. I found it return different oracle number data type for TABLE or NAMED QUERY   Provider Data Type Column Data Type Data Source View Data Type Oracle OLE DB Provider (OraOLEDB.Oracle.1) Table Number System.Int64   View Number System.Decimal   Named Querey Number System.Decimal Microsoft OLE DB Provider for Oracle (MSDAORA.1) Table Number System.Double   View Number System.Double   Named Query   1 System.Int64   Named Query   1.1234 System.Int64 Althought I know I can fix IT via MANUALLY EDIT DATASOURCE VIEW XML SOURCE. But I don't think this is a better solution. Is anybody have ideas ?  Wilson

Report Builder 3.0 for Oracle with Graphical Query Designer

  
Is there a possibility to have Graphical Query Designer in Report Builder 3.0 in case the connection is made to an Oracle database (through .NET Provider for Oracle for example)? I need to offer to the end users the means to build their own reports. Every user has associated a group of database objects and as soon as users are added new database objects are added. Therefore I cannot create a model because it needs to be changed frequently and the model in this case would contain objects to which the user does not have access. The only option is that the user should create his report query in a friendly manner. So the query text editor is of no good in this case.   I've found in documentation that for Oracle and other databases there is no Graphical Query Designer: In Report Builder 2.0, to specify a query for data source types Oracle, OLE DB, ODBC, and Teradata, you must use the text-based query designer (http://msdn.microsoft.com/en-us/library/dd220607(SQL.100).aspx). Is there a way to have Graphical Query Designer in Report Builder 3.0 or should I look for other products? In case Report Builder cannot solve this problem can you make some product recommendations - ad-hoc web reporting for .NET?

Having error in SSRS using oracle query

  

Hi ,

I have to create report based on date filter but when i used below query ,an error has occured

ORA - 01745 : invalid host/bind variable name.

 

query is

 

select top 2* from tablename where prodate>=:date and prodate<:date +1

 

 

Shraddha


Pass paramaters to Open Query (oracle)

  

I am trying to pass two paramaters into an oracle open query

 

The first is a comma split string value of item numbers

and the second would be date ranges, - 4 of them  1) most recent 6 months, 2) most recent 12 months 3) most recent 18 months 4) most recent 24 months.  As i understand it - the open query is treated as dynamic sql and this is more challenging -

This table has alot of info so I do not want to bring back everything

 

 


KDW
ALTER Proc [dbo].[USP_SALES_LAUNCH_X]


 @Year int


AS





	SELECT TOP 100	sal.EM_ITEM_NUM 
	, typ.PGM_TYP_DSCR
	,ref.SELL_DSCR
	,ref.NDC_NUM
	,ref.SPLR_ACCT_NAM

	from openquery(ops_oracle_iw,
		'select	
				 oss.INVC_DT
				,oss.EM_ITEM_NUM
				,oss.SLS_QTY 
				,oss.SLS_AMT 
				,oss.CNTRC_LEAD_TP_ID
		from dcp0.V_SALE_ITEM oss
	WHERE SEL_GNRC_IND IN ( ''Y'', ''N'')
	AND oss.SLS_PROC_WRK_DT BETWEEN TO_DATE(''01/01/2009'', ''MM/DD/YYYY'') AND TO_DATE(''12/31/2010'' , ''MM/DD/YYYY'')
	AND oss.EM_ITEM_NUM in (''2242428'', ''2243087'' , ''2243624 '' , '' 2242758'' , ''2244051'', '' 2242782'', ''2243525'')

') as sal


	left join BTSMART.cb1.V_CNTRC_LEAD_CB_ATTR cnt
		on sal.CNTRC_LEAD_TP_ID= cnt.CNTRC_LEAD_NUM
	 left join btsmart.cb1.T_PGM_TYP typ
		on typ.pgm_typ_cd = cnt.pgm_typ_cd
		LEFT JOIN

Query Wizard for Oracle Connectivity with Moss 2007 using BDC

  

I am able to connect Oracle using BDC Metaman and get the data using small queries. But i have a big query to retrieve the data from Oracle and not able to use that query using BDC Metaman. Is there any query wizard to run my query to retrieve Oracle data. 

Is there any other tools having this facility (Query Wizard). 

Please assist me for the same. 

 

Thanks


How to write the following query in oracle..?

  
hhh

SELECT

 

 

 

 

DISTINCT d.AGREEMENTID

 

 

,d.AGREEMENTNO

 

 

How to write the following query in oracle..?

  
hhh

SELECT

 

DISTINCT d.AGREEMENTID

 

,d.AGREEMENTNO

 

,A.CHEQUEAMT

 

How to write the following query in oracle..?

  
 

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

 

 

 

DATEADD(MONTH, DATEDIFF(

How to write the following query in oracle..?

  
 

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

 

 

 

DATEADD(MONTH, DATEDIFF(

How to write the following query in oracle..?

  
 

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

 

 

 

 

 

 

 

DATEADD(MONTH

How to write the following query in oracle..?

  
 

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

 

 

 

DATEADD(MONTH, DATEDIFF(

How to write the following query in oracle..?

  

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

 

 

 

DATEADD(MONTH, DATEDIFF(

How to write the following query in oracle..?

  

Hi all

Can anybody let me know how to write the same query below in oracle...?

SELECT

 

DATEADD(MONTH, DATEDIFF(MONTH, 0

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

How to Encrypt Query String Parameters in ASP.NET

  
Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend