|
The groups have also a "Page break at Start/End" property. May be you missed unchecking any of such properties from any of the groups/tables.
My Blog
My Articles
Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. - Albert Einstein
|
|
|
|
|
Those properties are unchecked also. The table work well when the data can be accommodated on one page but when the data exceeds, that's the time it is printed on the next page. I also looked at the KeepTogether properties and see to it that i assigned it false.
|
|
|
|
|
I have 2 tables
a id
x
y
b id amount1 amount2 amount3 a_id
1 5 3 5 x
1 2 4 5 y
I want result like this -->
x 5 3 5 y 2 4 5
how to create query to retrieve this data.can i use pivot .Thank for your help.
|
|
|
|
|
In order to help, you need to provide more information about what you are trying to achieve.
For example: Can table A have more rows. If so, do you want to still add more columns and keep the data on a single row (I believe that this wouldn't be possible). Can table B have several rows per one row in table A, what happens then etc.
Based on the data you provided the following query should provide the result you described, but I think it's hardly what you wanted:
SELECT a1.id, b1.amount1, b1.amount2, b1.amount3,
a2.id, b2.amount1, b2.amount2, b2.amount3
FROM a a1,
b b1,
a a2,
b b2
WHERE a1.id = 'x'
AND b1.a_id = a1.id
AND a2.id = 'y'
AND b2.a_id = a2.id
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
table 'a' is dynamic can insert or delete id
than i can not create static query (like the sample that you show me)
the data can be like this
a id
x
y
z
b id amount1 amount2 amount3 a_id
1 5 3 5 x
1 2 4 5 y
1 7 8 9 z
2 3 1 3 x
2 4 5 6 y
2 8 3 1 z
result is:
x 5 3 5 y 2 4 5 z 7 8 9 --> id = 1 in table b
x 3 1 3 y 4 5 6 z 8 3 1 --> id = 2 in table b
|
|
|
|
|
I don't think that what you're asking for is reasonably possible. This would lead to several problems:
- how the client side knows which columns are fetched from which row
- what if id X in table has 3 rows in table B, but id Y has two rows, what would be the result etc
I would look for alternative solutions for the client side. If the client needs the data in several (undetermine amount) columns based on several rows, fetching the data in such format from the database isn't practical.
Could you for example use XML formatting for the data from the database and then use XML data at client or should you fetch the correct rows from the database as they are and handle all the formatting at the client. The correct approach depends on the requirements, what is the client side actually doing.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi all.
Please guide me thru this. I have a large database with many tables having self references.
for eg:
TestTable:
TestId int,
TestName varchar(100),
ParentTestId int,
Primary Key (TestId),
Foreign Key (ParentTestId) References TestTable(TestId)
I just wanted to query out the tables which are having similar type of relationships within themselves.
Thanks in advance.
The name is Sandeep
|
|
|
|
|
|
thanks for the reply man. but that's not what i asked.
I don't want to select any DATA from any table.
I just wanted to know whether there are any other tables in my database, which have self references within themselves [just like the reference established in TestTable]
I wanted a query which shows those type of tables.
The name is Sandeep
|
|
|
|
|
Hi Xandip,
Just try below query.
and yes run it in SQL Server 2000
select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where Table_Name = 'TestTable'
and Constraint_Type = 'FOREIGN KEY'
Hope it will help u.
Krishnraj
|
|
|
|
|
thanx buddy, but isnt this the query to list the foreign keys of a table?
anyways, i think i got my answer
select * from sys.objects where object_id in (select parent_object_id from sys.foreign_key_columns where parent_object_id = referenced_object_id)
Thanks for your effort guys..
The name is Sandeep
|
|
|
|
|
Yes, my posted query displays the name of the table and all its constraints. but in sql server 2000. I see yr query and its of sql server 2005.
anyways, now u got the solution. but its just for yr info..
Krishnraj
|
|
|
|
|
hi,
i note that when i retrieve data and bind it to textbox that when i want to bind to each textbox i do the same thing , so i think to make method where i pass array of the name of textbox and it will bind automatic for each textbox and here is what i try to do
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "student_SelectAll";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cn;
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = cmd;
TextBox [] txtb={textBox1,textBox2,textBox3,textBox4,textBox5,textBox6,textBox7,textBox8};
IDataParameter[] param = adapter.GetFillParameters();
for (int i = 0; i <param.length;> {
cmd.Parameters.Add(param[i].ParameterName,param[i].DbType).Value = txtb[i].Text;
}
Discover Other ....
http://www.islamHouse.com
|
|
|
|
|
What is your Problem?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
It does not work or how i can do something like this ?
Discover Other ....
http://www.islamHouse.com
|
|
|
|
|
There ways that you can do that, if i understand you Correctly , you want to Bind the Results from the DB to the indivisual Textbox. You can Create a Class that has a Function to get you Data , or you can create your Function in your Form (thats not professional) and call your Function like this
public class Class1
{
public DataTable GetData()
{
int Code;
String strCon = "blablablablablablabla";
SqlConnection con = new SqlConnection(strCon);
SqlCommand cmdselect = new SqlCommand();
cmdselect.CommandType = CommandType.StoredProcedure;
cmdselect.CommandText = "student_SelectAll";
cmdselect.Connection = con;
DataTable DT = new DataTable();
try
{
con.Open();
DT = cmdselect.ExecuteNonQuery();
}
catch(SqlException)
{
throw;
}
finally
{
con.Close();
}
return DT;
}
}
This is a Class that has a Function Getdata that returns a Datatable and in your Form you access the Function and Bind the Textbox like this
Class1 obj = new Class1();
DataTable DT = new DataTable();
DT = obj.GetData();
txtname.Text = DT.Columns[0];
txtlastname.Text = DT.Columns[1];
Am Sorry for the untidy code, am just in a Hurry for a meeting.
Hope this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hello everyone..
i have a problem regarding in using sursor in oracle 10i.
how can i pass to a cursor the output from stored procedure?
like this one:
CURSOR cur1 IS
SAMPLESP(); --sample stored procedure.
but when itry this i get this error: PLS-00103: Encountered the symbol "SAMPLESP()" when expecting one of the following:
( select
please help..
thanks in advance.
jyn
modified on Tuesday, November 18, 2008 6:33 AM
|
|
|
|
|
cursors are passed as inputs to stored procedures in oracle and the stored procedure then assigns them.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
To add to the previous post, the technological term for this is REF CURSOR . For more information, see
PL/SQL User's Guide and Reference
Chapter 6 Performing SQL Operations from PL/SQL
Using Cursor Variables (REF CURSORs)
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi friends
Would u please help me to install SQL Express 2005 in silent mode....with necessary parameters ?
With warm regards
Dyno
|
|
|
|
|
|
Hi all i hav a query for which i got the result but i am not able to understand the query....
here's the query...
select sal,to_char((to_date(sal,'j')),'jsp') from emp;
Result: 3250 Three Thousand Two Hundred and Fifty.
I just need the explanation of to_date and to_char command formats.....
if possible can any one giv one example each on those two commands..
Thanks in Advance...
Byee
|
|
|
|
|
TO_CHAR and TO_DATE are built-in functions in Oracle.
TO_CHAR = Convert number to string
TO_DATE = Convert string to date
|
|
|
|
|
i got ur point but how the given value is getting converted into words....
|
|
|
|
|