The Wayback Machine - https://web.archive.org/web/20090411030543/http://www.codeproject.com:80/script/Forums/View.aspx?fid=1725
Click here to Skip to main content
6,057,654 members and growing! (21,180 online)
Announcements
* Bold indicates new messages since 18:05 10 Apr '09
BullFrog Power
Advanced Search
Sitemap

General Database


Home > Forums > General Database

 Msgs 1 to 25 of 1,827 (Total in Forum: 39,821) (Refresh)FirstPrevNext
AdminHow to get an answer to your questionadminChris Maunder17:30 10 Nov '05  
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
  5. If you are posting source code with your question, place it inside <pre></pre> tags, or click the "Ignore HTML tags in this message" check box.
  6. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
  7. Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
  8. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
  9. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
  10. No advertising or soliciting.
  11. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.

cheers,
Chris Maunder
CodeProject.com : C++ MVP

QuestionColumn as rowmemberSaiyed Alam10hrs 44mins ago 
Hello
Can any 1 tell me how can I show column as row using query?
Thanking in Advance
Johnny
AnswerRe: Column as rowmemberLuc 64801110hrs ago 
Google for SQL PIVOT

Smile
QuestionIif() statement usage problem [modified]memberdasha_pl16hrs 10mins ago 
Hello!
I have following Microsoft Visual FoxPro expression:

Iif(a, b, ""), where 

a = (IsNull(var1), "Z", var1 <> "A")

b = Iif(IsNull(myDate), Replicate("Z", 10), ConvertTimeToCharacter(myDate, 1))

I have divided this expression to "a" and "b" for better readability


I know that statement "a" should return Boolean value, but why "Z" is present there?
Please, could somebody explain me the meaning of statement "a".
I've looking through Internet without any results. Frown
Thanks in advance!

modified on Friday, April 10, 2009 7:04 AM

AnswerRe: Iif() statement usage problemmemberriced12hrs 54mins ago 
Should statement 'a' be Iif((IsNull(var1), .F., var1 <> "A"))?

As it stands it does not make sense, (IsNull(var1), "Z", var1 <> "A") is not a statement.

Regards
David R

Questioncan I use '+=' in a datarowmemberMaverickcool19hrs 13mins ago 
hi
I have datarow which contains an int column
I want to increase the value by 1:
(int)row[0][0] += 1 // the first column is an int field

but when I do this I get an error: "The left-hand side of an assignment must be a variable, property or indexer"

is there a way to do this?
AnswerRe: can I use '+=' in a datarowmemberMycroft Holmes18hrs 40mins ago 
What database, what language, are you using the CLR.

If you are using SQL then you need to learn the language, it is not C#. Thats why they invented linq - to get you poor sods a language you knew.

Never underestimate the power of human stupidity
RAH

AnswerRe: can I use '+=' in a datarowmvpColin Angus Mackay8hrs 50mins ago 
Maverickcool wrote:
but when I do this I get an error: "The left-hand side of an assignment must be a variable, property or indexer"


Don't you want to understand why you get this error?

You have cast the left side to an int meaning the left side is no longer the indexer.

You could probably write
row[0][0] = ((int)row[0][0]) + 1;
But, since I don't use DataSets it may or may not work.


GeneralRe: can I use '+=' in a datarowmemberMaverickcool6hrs 29mins ago 
Thanks Colin !
QuestionOracle 11g Express Database? (I need TransactionScope support)memberdevvvy23hrs 58mins ago 
Hello

10g Express + ODP.NET (version 2.111.6.20) > support TransactionScope?

I read ODP.NET doc it does support .NET TransactionScope

But what about 10g Express database? My application died silently (i.e. just exit, no exception) on first db call - and if I just comment out TransactionScope, object instance get saved successfully.

Just found out there isn't an "Express" version for 11g? What should I be using...?

Thanks

dev

QuestionHow to select first n characters using stored procedurememberMeax9:04 9 Apr '09  
this works ok in sql server

SELECT MessageID, LEFT(Message, 80) AS Expr1
FROM MSGTble


but when i try to do it through stored procedure, my webform is giving me error

ALTER PROCEDURE dbo.GetAllMessage
AS
SELECT MessageID, LEFT(Message, 80) AS Expr1
FROM MSGTble
RETURN

saying "A field or property with the name 'Message' was not found on the selected data source."
AnswerRe: How to select first n characters using stored procedurememberMycroft Holmes18hrs 39mins ago 
Remove the RETURN from your store proc.

Never underestimate the power of human stupidity
RAH

GeneralRe: How to select first n characters using stored procedurememberMeax13hrs 7mins ago 
even after removing the "RETURN", still giving the same error
QuestionDuplicate RowsmemberSaiyed Alam5:50 9 Apr '09  
Hello Friends
What should be the query to show or find duplicate rows in a table?
Thanking in advance
Johnny
AnswerRe: Duplicate RowsmemberRob Philpott6:25 9 Apr '09  
One way is to group by every column, so if you table has four columns, this would do the trick:

select col1, col2, col3, col4 from MyTable
group by col1, col2, col3, col4 having count(1) > 1


Regards,
Rob Philpott.

GeneralRe: Duplicate RowsmemberSaiyed Alam7:49 9 Apr '09  
Thanks .It worked.
Questioncursor goes in to infinit loop.........memberpranavcool1:28 9 Apr '09  
hi,
I have written a cursor that goes into infinite loop. I am not able to make out where i have done wrong.

the following is the code.
/******************************************************************************/
declare @dirid int
declare @topic varchar(8000)

create table #topic(Dir_Id int,topic_Id varchar(1000))

insert into #topic(Dir_Id,topic_Id)select D.Dir_Id,D.topicid FROM Category CN
INNER JOIN directory D ON CN.Cat_Id = D.OrgType_Id
INNER JOIN SubCategory SB ON D.Country = SB.SubCat_ID
WHERE CN.Cat_Name = 'Academic'

declare curtopic cursor for
select Dir_Id,topic_Id from #topic
open curtopic
fetch next from curtopic into @dirid,@topic
begin
while @@fetch_status = 0
set @topic = ''
SELECT @topic = topic_Id from #topic
fetch next from curtopic into @dirid,@topic
end
close curtopic
deallocate curtopic
print @topic
drop table #topic

/****************************************************************************/

i want to retrieve the data row by row for which i have written cursor.
but it is going in to infinite loop.


any help would be great full.

regards,
pranav

Pranav Dave

AnswerRe: cursor goes in to infinit loop.........memberRob Philpott1:56 9 Apr '09  
pranavcool wrote:
while @@fetch_status = 0
set @topic = ''


There you have it - that's the loop that executes. You need to put the statements in a block using begin and end.

Regards,
Rob Philpott.

QuestionCan Predictive Analysis be done in SQL Server 2005?membersunit_820:47 9 Apr '09  
I want to know if SQL Server 2005 has predictive analysis tools?

http://www.microsoft.com/sql/technologies/dm/TATForecast/TATForecast.html

In above link you can see how Office 2007 has this Forcast feature using the analysis services(2008 i think). Can such a thing be done in VS 2005/2008 or SQL Server Business Intelligence Development Studio 2005

If yes, then can you point me to some useful links or demos.

If it cannot be done in SQL server 2005, but can be done in SQL server 2008( which i think it can be) then please give some useful links and demo for same.

Thanx,
s.a.w

s.a.w.

QuestionEDMS to the Rescue!memberqadotnet0:32 9 Apr '09  
Dealing with organizational compliance is vital to push the organization to the forefront in the market place. We did just that after complying to SAS 70 and Sarbanes Oxley last year. It also helped us realize the current data value and the right way to store and retrieve data. Enterprise data management has its unique set of benefits that helped improve operational efficiency of the organization. For more information visit http://www.solix.com/solutions_overview.htm

Software is like entropy. It is difficult to grasp, weighs nothing, and obeys the second law of thermodynamics; i.e. it always increases.

RantRe: EDMS to the Rescue!mvpAshfield2:35 9 Apr '09  
If you want to advertise, pay for it - don't post to a programming forum.

Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP

AnswerRe: EDMS to the Rescue!memberMycroft Holmes2:50 9 Apr '09  
So your organisation is too cheap/miserable/small to pay for advertising, great recommendation for your product.

Never underestimate the power of human stupidity
RAH

QuestionHow to intergrate 2 tablemembercocoonwls19:28 8 Apr '09  
Hi all,

I am using SQL2005. I have 2 tables which are T1 and T2. I would like to intergrate them into one tabel, what i mean is add column when intergrate them instead of add row record.According what i know if using join or union will create a extra row.Record to be intergrate have to match the T1.AID with T2.ID

Below is my senario.

Table  : T1                        Table  : T2
=========================== ===================
AID | Code | Type | Amount1 ID | Code | Amount2
=========================== ===================
A 123 IA 200 B 223 12
B 223 IP 100 C 323 29
C 323 MR 55 D 444 30


Result have to get:
=====================================
AID | Code | Type | Amount1 | Amount2
=====================================
A 123 IA 200 0
B 223 IP 100 12
C 323 MR 55 29


The record D in T2 would not include in new table.

Any idea are welcome.

Thanks in advance
cocoonwls
AnswerRe: How to intergrate 2 tablememberKevin Horgan21:39 8 Apr '09  
Hi,

If you know that table T1 has more records than table T2 you could do a LEFT OUTER JOIN as follows:-

SELECT t1.AID,t1.CODE,t1.TYPE,t1.AMOUNT1,COALESCE(t2.AMOUNT2,0)
FROM t1 LEFT OUTER JOIN t2 on (t1.AID = t2.ID)

I hope this helps.

Cheers,

Kevin
GeneralRe: How to intergrate 2 tablemembercocoonwls22:32 8 Apr '09  
Hi Kevin,

I got it!thanks alot Laugh
I have edit my sql to match my case...

thanks in advance
cocoonwls

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Last Updated 9 Aug 2007
Web10 | 2.2.1064 | Advertise | Privacy
Copyright © CodeProject, 1999-2009
All Rights Reserved. Terms of Use