Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Stored procedure help similar to yahoo web service

Author  Topic 

thiruna
Starting Member

41 Posts

Posted - 2008-01-10 : 20:45:31
Hi there,

If you follow the below URL...

[url]http://download.finance.yahoo.com/d/quotes.csv?s=ACAS,RPL.NS,500045.BO,500141.BO,532031.BO,NLYAV.X,/,KMI&f=nl1[/url]

Where S=Share_ids seperated by commas, f= fields to retrieve (n - name of the Share, l1 - last trade)

Suppose if you use f=l1, it will display

[url]http://download.finance.yahoo.com/d/quotes.csv?s=ACAS,RPL.NS,500045.BO,500141.BO,532031.BO,NLYAV.X,/,KMI&f=l1[/url]

if i would like to achieve in my program (stored procedure), how could i do that?

My Database structure is as follows....

Table 1 - Share_Details
1. Share_ID (Primary)
3. Share_Name
4. Share_Country

Table 2 - Share_Trading
1. Share_ID (Foreign key)
2. Share_Last_Trade_price
3. Share_Previous_close
4. Share_Last_Trade_Date

Store Procedure

Declare @share_ID VARCHAR(4000)
Declare @Share_fields Varchar(4000) OUTPUT

for e.g if @Share_ID = multiple share_ids seperated by commas, how could we extract the values of share_last_trade_date for each share_id using select statement???
.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-01-11 : 09:45:11
quote:
if @Share_ID = multiple share_ids seperated by commas, how could we extract the values of share_last_trade_date for each share_id using select statement???

I think what you are asking is how to parse a comma seperated string for use in a query.

check out the topics in this thread under "CSV"
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -