single-row subquery returns more than one row
I want a subquery to return more than one value then use those values to get more values from the other table. But I am receiving the errors saying ORA-01427: single-row subquery returns more than one row. How can I avoid this and achieve want I want? My sql and Csharp is below:dbcon.Open(); string strreg = "SELECT Amount AS TotalAmount FROM Payment WHERE studentno=(SELECT tempcode FROM specialstudent WHERE custid='"+ AreaNO +"')"; &...How do i get one row if the resultset returned has no rows.
I have couple of CTE's which i want to ultimately insert into a temp table... and based on my condition some of the CTE's return some rows and some dont... but i want to have the CTE return atleast one row if there is no data in it.. I have tried doing the following but i am not getting the desired output
;with cte_rpt4 as (select '4' a,recd_dt as approve_dt, prov_no, prov_name, client_id, claim_mst_id, claim_adj_id, claim_dt,
(Select count(distinct(Claim_mst_Id)) as crpt4 from #temp1 where datediff(day,isnull(recd_dt,create_dt),isnull(c...Gridview Rows stretching in size when one row is returned
HiI hope this is a trival problem.My problem with the gridview is that when one row or only a few rows are returned to the gridview the spacing round the data in the row(s) increases. If there are many more rows, say 10 or more, the spacing is how I want it to be. I have tried setting the spacing for the rows in the properties of the row, but with no luck.Does any one have a way of fixing the row spaces regardless of the number of rows returned? Thanks
It seems you have resolved the issue. If so, please post the solution and share with us.
Thanks,Qin Dian TangMicro...XML Export Template question regard XML format
Hi. I am using the XML Export Template in PB9.0 to produce
an XML file. So far so good. The only problem is that it is
producing a XML file of the following form:
I need to have everything on one line, i.e.
Is there some setting on the XML Export template I can use
to achieve this?
Any info would be greatly appreciated:)
Make sure you uncheck the "Include Whitespace" option on the DataWindow
Export t...Return single colum from multiple rows into one row?
Often in my apps I'll create a table in SQL to house different variables. I do this so that I don't end up with multiple tables just to store a list of phone types for example. What I mean is let's say I have a form that would store contact information one of the controls might be a phone number and then next to that I'd have a drop down that would list the different phone types like Phone, Mobile, Fax etc rather than hard coding a specific textbox for only phone or only the mobile number. This way the user can determine white type of contact number it is.
With th...Gridview paging enabled. Has checkbox to select the row . If user select the checkbox on one page and move to 2nd page to select the rows there also to export the selected rows to excel. But doing so
HiI am using Gridview and that has paging enabled. Using checkbox to select the particular row of the gridview to export the selected rows to the excel . Everything is working fine except for one case.Let user selected the "check" box for, five rows which user would like to export to excel (two of rows on page 1 of results and 3 of them on page 2 of results), however it only exports the 3 row details from page 2, because it seems to de-select the 2 rows from page 1 when I move to page 2 and vice versa. The code i am using is as :protected void BtnExcel_Click(object sender, EventArg...How to read a dataset one row by one row?
I know you can use DataSet after close sql connection.
I want to something after getting dataset, read from one row by one row, just like while datareader.read()
Can I read dataset just like this?
Thanks in advance!
Is this what you're looking for (from the Tips and Tricks Section of ASPNet101.com):http://aspnet101.com/aspnet101/tips.aspx?id=175David WierMCP/ASPInsiderASPNet101.com - where to look first!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer&...XMl to XML
I retrieved an XML from the dataset which retrieves data from the table in the database. I need to present the data in a different structure. Is XSLT the way or are there any other options.
please let me know.
XSLT is a good choice to convert xml file to other forms.
You can take a look at XSLT Tutorial.Sincerely,Young Fang...Select one row from a xml file
I have a xml file which is created by myDataSet.WriteXml(). myDataSet contains one datatable which in turn contains several thousand rows.
Now I want to select one row (that can be done by a simple select in sql) from the xml file. Do I need to restore the dataset first from the xml file? Or I can work on the xml file directly?
MichaelEverything that has a beginning has an end.
You can manipulate the XML directly no problem. Depending upon the size you can use a XMLReader...bit like parsing a file, or XmlDocument and XPath...kind of like a sql select statement - al...XML in, XML out
Hi All (and a happy holiday to those that will get a break),
I am trying to read in an XML file of addresses. I need to remove all
the address data from the file where code =~ /^000/ (there are none
in the example data below). I need to reproduce that data 'as is', so
I need to honour the tag structure, although the order of the tags
doesn't need to be honoured.
I have been trying to use XML::Simple and I had a go with XML::Smart
but I haven't been able to get the results I want.
My best effort is below (with XML::Simple). There are a couple of
differences ...Reduce rows displayed but putting 3 rows in one row
I'm using PB6.5. I have an SQL DW that fetch some
information from the DB but should display only two columns:
a code and a value. Also they are displayed in the trailer
of a group if that's actually important.
In order to reduce displayed rows count, i would like to
display each 3 rows in one
The question is how can i do that?.
I've tried to use computed fields and in the second and
third pair values to use code,value,code,value
but only the code,value are OK(Showing next row's
data), the third ...add xml file (from a FOR XML AUTO, Elements) to a new row in database?
I saved the results of a query to a file. The query was of the format
SELECT column1, column2 FROM tblTable WHERE rowID=1 FOR XML auto, Elements
meaning that it returned one row. So I saved that file, and somehow I'd
like to add one column to the xml (say, column3), set the data for that
column (which I also don't know how to do yet), then add a row to the
db with this xml. I've tried starting by loading the xml file into an
XMLDocument but it's spitting out different errors. The latest error
(Root element is missing) comes from
Dim xmlDoc As New XmlDocument
xmlDoc.PreserveWhi...Return multiple XML Data by Row or delimit
I’m working with SQL 2005 and the new T-SQL for XML.Does anyone know how to return the “multiple” values with some kind of delimiter or return them by Rows? Below is my Query. Currently I get 10 ASIN numbers on a single row seperated by a space.Select top 1XMLData.query('declare default element namespace "http://webservices.amazon.com/AWSECommerceService/2004-11-10"; data(/ItemSearchResponse/Items/Item/ASIN)') ASINFrom XMLDATA
Using 10 Select statements and using ,,etc. will work but looking for a better answer.
Thank you....Returning multiple rows in XML from a web service
I have a web service that queries an Orace database. In my code I have a function that creates a new object from a Structure. The query has a single parameter and returns a single row as an instance of the Structure object. This works fine.
Now, however, I need to provide a query that will return multiple rows. When I use my other method as the basis for this new one, it only returns a single row as output. Here is an example: Structure ContactData Public Contact_Name As String Public Contact_Location As StringEnd Structu...