Skip to content
Advertisement

How can I take USD Forex Buying and EUR Forex Buying Rates with date from TCMB, using SQL and XML?

I want to take USD and EUR Rates from TCMB page.

Im using this first of all.

Im using this for creating table.

Im using this for parse XML file but I couldn’t parse correctly. I want to take only Date(as Tarih), DolarForexBuying,EuroForexBuying rates.

And Im using this code for adding rates to my table.

Advertisement

Answer

Microsoft proprietary OPENXML and its companions sp_xml_preparedocument and sp_xml_removedocument are kept just for backward compatibility with the obsolete SQL Server 2000. Their use is diminished just to very few fringe cases.

Starting from SQL Server 2005 onwards, it is strongly recommended to re-write your SQL and switch it to XQuery.

Notable points:

  • Tarih column is DATE datatype
  • DolarForexBuying and *EuroForexBuying * columns should use DECIMAL(10,4) datatype. FLOAT data type is used for imprecise numbers like PI 3.14159…..

SQL

Output

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement