Click here to Skip to main content
15,902,445 members
Home / Discussions / Database
   

Database

 
GeneralRe: Problem with RSClient Print paging Pin
Blue_Boy16-May-08 9:08
Blue_Boy16-May-08 9:08 
Questionprocedure Pin
trilokharry15-May-08 6:01
trilokharry15-May-08 6:01 
AnswerRe: procedure Pin
Blue_Boy15-May-08 8:14
Blue_Boy15-May-08 8:14 
GeneralRe: procedure Pin
trilokharry15-May-08 19:25
trilokharry15-May-08 19:25 
GeneralRe: procedure Pin
Ashfield15-May-08 21:17
Ashfield15-May-08 21:17 
GeneralRe: procedure [modified] Pin
Blue_Boy15-May-08 21:31
Blue_Boy15-May-08 21:31 
GeneralRe: procedure Pin
trilokharry16-May-08 0:15
trilokharry16-May-08 0:15 
QuestionHi can anybody tell me how to do this please Pin
jhansirani15-May-08 5:23
jhansirani15-May-08 5:23 
Now I need you to tell me how to write method for executing a procedure and returnd a dataset

The stored procedure (statement outlined at the bottom of the word document) will give you a list of orders (first table) and order items (second table) that contain mail lists.

The first table will contain the order info itself. This is where you will get the additional fields for the “Master Mail list file” such as order number, name of person who placed the order etc. The second table will contain the specific item info (such as item name/description).

You will use the Order number (the actual column name is SOPNumbe) to reference the path where the order files are stored.

An order folder will have one or more package folders.

Add a method to DataObjects.FeedsDO.vb to execute the stored procedure and return a DataSet.
So once you have your dataset.

the below one is the SQl statement so I also need Code for writing a procedure which gives me two records

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

DECLARE @ClientCode varchar(5), @ClientID int
SELECT @ClientCode = 'cmc'
SELECT TOP 1 @ClientID = ClientID FROM ODClient WHERE Code = @ClientCode AND ParentID IS NULL

DECLARE @Orders TABLE (OrderID bigint)

--Set the id of the mdb output data feed for reference in next statement
DECLARE @DataFeedID int
SELECT @DataFeedID = 5

INSERT INTO @orders
SELECT o.OrderID FROM ODOrder o
OUTER APPLY (SELECT TOP 1 oh1.CreateDate, oh1.OrderID, oh1.StatusID FROM ODOrderHistory oh1 WHERE oh1.OrderID = o.OrderID AND oh1.StatusID = 22) oh
WHERE o.ClientID IN (SELECT ChildID FROM dbo.funGetClientChildren(@ClientID))
AND o.OrderID IN
(SELECT OrderID FROM ODOrderShipment os
INNER JOIN ODOrderItem oi ON oi.OrderShipmentID = os.OrderShipmentID
WHERE oi.HasMailingList = 1)
AND
(oh.StatusID = 22 AND oh.CreateDate >= (SELECT MAX(CreateDate) FROM ODDataFeedLog WHERE DataFeedID = @DataFeedID AND DataFeedLogEventTypeID=3) OR NOT EXISTS (SELECT 1 FROM ODDataFeedLog WHERE DataFeedID = @DataFeedID))


SELECT o.OrderID, o.SOPNumbe, su.LoginID, c.FirstName, c.LastName,
StatusDate = (SELECT TOP 1 CreateDate FROM ODOrderHistory oh WHERE oh.OrderID = o.OrderID ORDER BY CreateDate DESC)
FROM ODOrder o
INNER JOIN ODSysUser su ON su.SysUserID = o.SysUserID
INNER JOIN ODContact c ON c.ContactID = su.ContactID
WHERE o.OrderID IN (SELECT OrderID FROM @Orders)

SELECT * FROM ODOrderShipment os
INNER JOIN ODOrderItem oi ON oi.OrderShipmentID = os.OrderShipmentID
INNER JOIN ODPackage p ON p.PackageID = oi.PackageID
WHERE oi.HasMailingList = 1
AND os.OrderID IN (SELECT OrderID FROM @Orders)
AnswerRe: Hi can anybody tell me how to do this please Pin
Ashfield15-May-08 21:19
Ashfield15-May-08 21:19 
QuestionHelp needed for a serach condition in sql [modified] Pin
Naveed Kamboh15-May-08 1:46
Naveed Kamboh15-May-08 1:46 
AnswerRe: Help needed for a serach condition in sql Pin
Blue_Boy15-May-08 1:52
Blue_Boy15-May-08 1:52 
AnswerRe: Help needed for a serach condition in sql Pin
Piyush Vardhan Singh15-May-08 1:54
Piyush Vardhan Singh15-May-08 1:54 
AnswerRe: Help needed for a serach condition in sql Pin
Blue_Boy15-May-08 4:27
Blue_Boy15-May-08 4:27 
GeneralRe: Help needed for a serach condition in sql Pin
Naveed Kamboh15-May-08 6:20
Naveed Kamboh15-May-08 6:20 
GeneralRe: Help needed for a serach condition in sql Pin
Blue_Boy15-May-08 8:02
Blue_Boy15-May-08 8:02 
QuestionSql server 2000 reporting installation problem Pin
veereshIndia15-May-08 0:37
veereshIndia15-May-08 0:37 
AnswerRe: Sql server 2000 reporting installation problem Pin
John_Adams15-May-08 20:32
John_Adams15-May-08 20:32 
GeneralRe: Sql server 2000 reporting installation problem Pin
veereshIndia15-May-08 23:27
veereshIndia15-May-08 23:27 
Questionfind discrepancy between two tables Pin
sqldba14-May-08 23:50
sqldba14-May-08 23:50 
AnswerRe: find discrepancy between two tables Pin
Alsvha15-May-08 0:09
Alsvha15-May-08 0:09 
GeneralRe: find discrepancy between two tables Pin
Naveed Kamboh15-May-08 1:52
Naveed Kamboh15-May-08 1:52 
GeneralRe: find discrepancy between two tables Pin
Alsvha15-May-08 23:08
Alsvha15-May-08 23:08 
QuestionProblem in select Pin
ksaw12314-May-08 21:52
ksaw12314-May-08 21:52 
AnswerRe: Problem in select Pin
Nic Rowan14-May-08 22:40
Nic Rowan14-May-08 22:40 
GeneralRe: Problem in select Pin
mr_lasseter15-May-08 4:13
mr_lasseter15-May-08 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.