|
Ah, so you're using the Microsoft Data Access Application Block? You're quite right, it only supports SQL Server, Oracle and DB2 out of the box. You need to modify the code if you want to support MySQL and Postgres as well. The source code for Enterprise Library is supplied in the installation package, so you can inspect that.
There's a connector here[^] which may help, but note that it already says it's outdated and the original author hasn't fixed it. Still, it may give you a start.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi Friends,
Whats wrong here in the query?
insert into table1 (f1,f2,f3)
select f1 from table2 where table2.f2=4 and table2.f3=121034,1,41
I am inserting 3 values in 3 fiedls
f1=f1 of table2
f2=1
f3=41
It says
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near ','.
Naveed Kamboh
-- modified at 7:55 Thursday 29th June, 2006
|
|
|
|
|
probably you should use IN operator
SELECT f1 FROM table2 WHERE table2.f2=4 AND table2.f3 in (121034,1,41)
|
|
|
|
|
insert into table1 (f1,f2,f3)
select f1 from table2 where table2.f2=4 and table2.f3=121034,1,41
hi,
Are u supplying 3 values to query?? then u might be thinking like
(select f1 from table2 where table2.f2=4 and table2.f3=121034),1,41
if this is rite then u confirm - Is that query returning only one value??
After u shud write something like this :
select f1,1,41 from table2 where table2.f2=4 and table2.f3=121034
|
|
|
|
|
Naveed Kamboh wrote: Whats wrong here friends?
Your post could use a better subject line. A better subject line would briefly describe the problem. For example: "Syntax error in SELECT statement"
|
|
|
|
|
Hi All!
I had two table in SQL Server: tblNew_Details and tblNews. They were connected over pass by two fields: New_DetailsID in tblNew_Details with New_DetailsID in tblNews.
I design a Web Form (ASP.NET)which uses a DataList control to list all contents in tblNews table.
I only display a field that have the same New_DetailsID(in tblNews). But I have a problem which display two fields with the same New_DetailsID.
Please help!
Thanks!
|
|
|
|
|
Hi ,
I have two table with one-many relationship
table1 with following fields:ID1(PK),f11,f12..
table 2 :ID1(FK),ID2(PK),f21,f22..
I want to get ONLY ONE ROW after execute SELECT statement from
table1 join table2 via ID1
Can anyone help me!
Thanks in advance
dinhzap84xd@gmail.com
zappa
-- modified at 6:49 Thursday 29th June, 2006
|
|
|
|
|
hi,
table1 with following fields:ID1(PK),f11,f12..
table 2 :ID1(FK),ID2(PK),f21,f22..
select distinct top 1 * from table1 a inner join table2 b on a.ID1=b.ID1
no condition u specified, so this is one way to get only one row
|
|
|
|
|
thanks.I'll test it.
zappa
|
|
|
|
|
I want debug stored procedure. please help me.
hk,linn
|
|
|
|
|
Hi,
Can someone please tell me why the following SELECT statement is bring back no results:
SELECT
WineryID_PK,
WineryName,
WineryEstablishedYear,
WineryOwner,
WineryDescription,
CountryID_PK,
CountryName,
RegionID_PK,
RegionName,
WineryDateInserted,
WineryDateUpdated,
(MemberFName + ' ' + MemberLName) AS WineryUpdatedBy,
WineryStatus,
WineryHasImage
FROM
Winery
LEFT OUTER JOIN Members
ON Winery.WineryUpdatedByID_FK = Members.MemberID_PK
INNER JOIN Region
ON Winery.RegionID_FK = Region.RegionID_PK
INNER JOIN Country
ON Region.CountryID_FK = Country.CountryID_PK
WHERE
Members.MemberUsername = 'Serasmus'
AND WineryID_PK = 20;
If I remove the Members.MemberUsername = 'Serasmus' then it bring back just the winery details, otherwise nothing. Username Serasmus does exist in the members table.
Regards,
Brendan
|
|
|
|
|
U are doing a left join with the winery table on the left side..
so the query will return 'Serasmus' only if this member's id is present in
the WineryUpdatedByID_FK column of winery table..is it?
so ur statement of "Username Serasmus does exist in the members table" is not really helpful
try executing this query part by part ... u may get a solution faster..
|
|
|
|
|
DIMPLE_R wrote: U
DIMPLE_R wrote: ur
Your answer would be easier to read if you wrote properly structured sentences and didn't use "txtspk"
|
|
|
|
|
What is txtspk?? Are you talking to me or to DIMPLE_R?? I understood him 100%!!
|
|
|
|
|
|
ma se wrote: What is txtspk??
AKA SMS Speak.
ma se wrote: Are you talking to me or to DIMPLE_R??
DIMPLE_R, that is why I quoted from his message.
ma se wrote: I understood him 100%!!
Really?? I didn't. It hurt my head.
|
|
|
|
|
Ahhh.. come one, it wasn't that bad, at least he tried helping. I appreciate his reply!
|
|
|
|
|
Thanks, but I was not thinking clearly.
I changed it to the following and it works fine:
SELECT
WineryID_PK,
WineryName,
WineryEstablishedYear,
WineryOwner,
WineryDescription,
CountryID_PK,
CountryName,
RegionID_PK,
RegionName,
WineryDateInserted,
WineryDateUpdated,
(m2.MemberFName + ' ' + m2.MemberLName) AS WineryUpdatedBy,
WineryStatus,
WineryHasImage
FROM
MemberInWinery
INNER JOIN Winery
ON MemberInWinery.WineryID_FK = Winery.WineryID_PK
INNER JOIN Members AS "m1"
ON MemberInWinery.MemberID_FK = m1.MemberID_PK
LEFT OUTER JOIN Members AS "m2"
ON Winery.WineryUpdatedByID_FK = m2.MemberID_PK
INNER JOIN Region
ON Winery.RegionID_FK = Region.RegionID_PK
INNER JOIN Country
ON Region.CountryID_FK = Country.CountryID_PK
WHERE
MemberInWinery.WineryID_FK = 20
AND MemberInWinery.MemberID_FK = 12;
Thanks for your help!!
|
|
|
|
|
hi all,
I am copying a table to another table using
select * into targettable from sourcetable .
The new table named "targettable" is created but the primary key (constraints) and default values for the table are not coming as "sourcetable".
Is there any way to have a table copy with the same table structure and design??????.
vivek
|
|
|
|
|
vivek-g wrote: Urgent
Sorry, but not to us it isn't.
|
|
|
|
|
Currently there is no such method to copy the constraints from the source to target table during table creation. For applying the constraints you must Alter the table.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi,
I would like to find duration in hh:mm format between two dates.
Example:-
Duration between '2006-06-29 09:01:13.637' and '2006-06-29 12:09:13.637'
in HH:MM Format.
Regards
Rajesh
rajesh
|
|
|
|
|
Hi Rajesh,
You may want to take a look at the following articles:
http://blogs.wdevs.com/irtaza/archive/2005/02/04/2195.aspx
http://www.sqljunkies.com/Article/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk
Hope this helps.
Dimple
|
|
|
|
|
hello,
does anybody know how to write a query that returns the maximum value of a column? here is what i have so far:
<br />
SELECT barcode, wellname, well.ph, proteinname, score, time FROM well INNER JOIN welldrop ON well.wellkey=welldrop.wellkey INNER JOIN imageset ON welldrop.dropkey=imageset.dropkey WHERE well.barcode=1111<br />
this query returns several rows for each "wellkey". i only want to return one row for each wellkey, with the most recent date (found in the time field of the imageset table). i tried using MAX(time), but i got an error...
thanks!
RC
-- modified at 17:20 Wednesday 28th June, 2006
|
|
|
|
|
i think i figured it out. the following serves my purposes:
SELECT barcode, wellname, well.ph, proteinname, score, MAX(time) AS time FROM well INNER JOIN welldrop ON well.wellkey=welldrop.wellkey INNER JOIN imageset ON welldrop.dropkey=imageset.dropkey WHERE well.barcode=1111 GROUP BY barcode,wellname
|
|
|
|
|