473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why this SQL can't get data?I run it in oracle,it returns more than 800 datas!

Hi,I need your help!
My SQL runs in oracle and it returns more than 800 rows,but when I try
to bind it into a DataGrid with OracleDataReader, It returns no row!
Here is the SQL,Why?
Is that means C# have any claim with SQL statement?
------------------
SELECT
X.YM,X.CUST_NAME,X.ODR_NO,X.STYLE_NAME,X.ODR_QTY,X .TOT_QTY,Z.TOT,'odr_no
='||X.ODR_NO||'&'||'style_no='||X.STYLE_NO AS ARG FROM (select
substr(A.pro_date,0,6) as
ym,C.CUST_NAME,A.ODR_NO,D.STYLE_NO,D.STYLE_NAME,NV L(SUM(A.odr_qty),0)
odr_qty,nvl(sum(tot_pro_qty),0) tot_qty from odr_prom A,ODRM B,CUSTOM
C,STYLEM D where A.ODR_NO=B.ODR_NO AND B.STYLE_NO=D.STYLE_NO AND
B.CUST_NO=C.CUST_NO AND A.FAC_NO='R0' AND A.DEPT_NO='R2' AND
substr(pro_date,0,6)='200309' GROUP BY
substr(A.pro_date,0,6),A.odr_no,C.CUST_NAME,D.STYL E_NO,D.STYLE_NAME) X,
(SELECT ODR_NO,NVL(SUM(TOT_PRO_QTY),0) AS TOT FROM ODR_PROM WHERE
FAC_NO='R0' AND DEPT_NO='R2' GROUP BY ODR_NO) Z WHERE X.ODR_NO=Z.ODR_NO
----------------------
Thanks very much!
fans
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
3 1449
Hi,

Why don't you use DataAdapter.Fill() to fill a dataset and later bind this
dataset to the grid.
this will allow you to see if the data retrival from the DB is working or if
it's the binding you are using the one that is wicked.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"fans hou" <fa****@pyzs.com.cn> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
Hi,I need your help!
My SQL runs in oracle and it returns more than 800 rows,but when I try
to bind it into a DataGrid with OracleDataReader, It returns no row!
Here is the SQL,Why?
Is that means C# have any claim with SQL statement?
------------------
SELECT
X.YM,X.CUST_NAME,X.ODR_NO,X.STYLE_NAME,X.ODR_QTY,X .TOT_QTY,Z.TOT,'odr_no
='||X.ODR_NO||'&'||'style_no='||X.STYLE_NO AS ARG FROM (select
substr(A.pro_date,0,6) as
ym,C.CUST_NAME,A.ODR_NO,D.STYLE_NO,D.STYLE_NAME,NV L(SUM(A.odr_qty),0)
odr_qty,nvl(sum(tot_pro_qty),0) tot_qty from odr_prom A,ODRM B,CUSTOM
C,STYLEM D where A.ODR_NO=B.ODR_NO AND B.STYLE_NO=D.STYLE_NO AND
B.CUST_NO=C.CUST_NO AND A.FAC_NO='R0' AND A.DEPT_NO='R2' AND
substr(pro_date,0,6)='200309' GROUP BY
substr(A.pro_date,0,6),A.odr_no,C.CUST_NAME,D.STYL E_NO,D.STYLE_NAME) X,
(SELECT ODR_NO,NVL(SUM(TOT_PRO_QTY),0) AS TOT FROM ODR_PROM WHERE
FAC_NO='R0' AND DEPT_NO='R2' GROUP BY ODR_NO) Z WHERE X.ODR_NO=Z.ODR_NO
----------------------
Thanks very much!
fans
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
I ran into a similar problem today. A try {} catch {} around my connect call
revealed that I had failed authentication to the server. It appeared to
return an empty set.
My SQL runs in oracle and it returns more than 800 rows,but when I try
to bind it into a DataGrid with OracleDataReader, It returns no row!
Here is the SQL,Why?
Is that means C# have any claim with SQL statement?

Nov 15 '05 #3
Hi,Ignacio Machin \( .NET/ C# MVP \)
I do think of that yesterday too!
and I tried to bind it with the DataSet!
but it still returns a empty DataSet!
and no errors!

To Mark Coffman:
I think My problem is diffrent to yours!
I tried to simplify my SQL,I cut some Computer-field.
I found,when I remove the "SUM(field)" & "Group By" sub-statement,It
works!
like this:
-----------------
select a.ODR_NO,d.STYLE_NO from ODR_PROM a,ODRM b,CUSTOM c,STYLEM d
where a.ODR_NO=b.ODR_NO AND b.STYLE_NO=d.STYLE_NO AND
b.CUST_NO=c.CUST_NO AND a.FAC_NO='R0' AND a.DEPT_NO='R2'
------------
--this returns more than 800 rows!
But if I keep the "SUM(field)" & "Group By" like this:
-------------
select a.ODR_NO,d.STYLE_NO,SUM(a.ODR_QTY) as ODR_QTY,sum(a.TOT_PRO_QTY)
as TOT_PRO_QTY from ODR_PROM a,ODRM b,CUSTOM c,STYLEM d where
a.ODR_NO=b.ODR_NO AND b.STYLE_NO=d.STYLE_NO AND b.CUST_NO=c.CUST_NO AND
a.FAC_NO='R0' AND a.DEPT_NO='R2' GROUP BY a.ODR_NO,d.STYLE_NO
-----------------
then it returns empty DataSet!

why?
how strange!
I had try a SQL with "Group By" in other c# produce,and they works
fine,why this not?

tks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ken North | last post by:
Has anyone run a pilot or production project marrying an XML accelerator with an Oracle server? How much of a boost has it provided for queries vs. using a software XSLT processor? What type of...
0
by: kahina | last post by:
Hello, I am looking for a software which generates automatically XML code from datas written in Oracle 8i. Thank you to write to me to the address kahina.guemghar@epfl.ch Thank you in advance...
0
by: Linesh Gajera | last post by:
Hi, I have unique problem. I have configured RemotingServer running as Console Application and my Remoting object access Oracle database. My remoting object make call to Oracle database and...
2
by: Chris | last post by:
I think I already know that the answer is that this can't be done, but I'll ask anyways. Suppose you want to use an RDBMS to store messages for a threaded message forum like usenet and then...
2
by: DurumDara | last post by:
Hi ! I want to create a database from datas. I want to store my datas in lists/dicts/normal variables. I thinking about that I can use the pickle to serialize/load my datas from the file. ...
1
by: trysenthil | last post by:
in what case the datas get stored in oracle. i think that it is in upper case. but i have doubt. please some one help me to recover from this.. one more : if the date defaultly get stored as...
2
by: trysenthil | last post by:
in what case the datas get stored in oracle. i think that it is in upper case. but i have doubt. one more : if the datas defaultly get stored as Ucase in oracle... is there is any...
3
by: venkattaramanan | last post by:
Hello, Actually i want know how to migrate the oracle datas into Mysql datas using visual basic program regards, V.Venkattaramanan
0
by: faroz | last post by:
Hi everyone i have a question about updating some columns in oracle forms for e.g i have a page that show u items to buy something..firstly, customer have to enter the datas to order..after...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.