473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

converting oracle script to SQL server 2005 script

Hi I am newbie. I need to translate the following Oracle script to SQL Server 2005 script.

I will appreciate your help and feedback.
Thanks a lot in advance.

-----------------------------------------------------------------------------------------------------------
test_reporting/here4fun@test_PROD
SET NEWPAGE NONE;
SET SPACE 0;
SET LINESIZE 181;
SET PAGESIZE 0;
SET ECHO OFF;
SET FEEDBACK OFF;
SET HEADING OFF;
SET UNDERLINE OFF;
SET FLUSH OFF;
SET MARKUP HTML OFF;
COLUMN AGT_CD NOPRINT;
COLUMN PROC_DT NOPRINT;
SPOOL OFF;
SET COLSEP ',';
spool d:\test.txt;
select chr(34)||'Producer'||chr(34)||','||
chr(34)||'Commission Type'||chr(34)||','||
chr(34)||'Adjustment Type'||chr(34)||','||
chr(34)||'Process Date'||chr(34)||','||
chr(34)||'Division'||chr(34)||','||
chr(34)||'Line of Business'||chr(34)||','||
chr(34)||'Policy Number'||chr(34)||','||
chr(34)||'Producer Share'||chr(34)||','||
chr(34)||'NAFYC'||chr(34)||','||
chr(34)||'Plan Code'||chr(34)||','||
chr(34)||'Policy Branch'||chr(34)||','||
chr(34)||'Product'||chr(34) ||','||
chr(34)||'Gen Date'||chr(34) "A",
'00000' "AGT_CD",
'0000/00/00' "PROC_DT"
from dual
union all
SELECT trim(chr(34)||AAC_AGT_CD||chr(34))||','||
trim(chr(34)||AAC_COMM_TYPE||chr(34))||','||
trim(chr(34)||AAC_ADJ_TYPE||chr(34))||','||
trim(chr(34)||to_char(AAC_PROC_DT,'RRRR/MM/DD')||chr(34))||','||
trim(chr(34)||AAC_FASAT_DIVISION||chr(34))||','||
trim(chr(34)||AAC_FASAT_LOB||chr(34))||','||
trim(chr(34)||AAC_POL||chr(34))||','||
trim(to_char(AAC_SHARE,'999999990.99'))||','||
trim(to_char(AAC_WEIGHTED_AFYC,'999999990.99'))||' ,'||
trim(chr(34)||AAC_PLAN_CD||chr(34))||','||
trim(chr(34)||AAC_BRCH_CD||chr(34))||','||
trim(chr(34)||AAC_FASAT_PRODUCT||chr(34))||','||
trim(chr(34)||to_char(AAC_GEN_DT,'RRRR/MM/DD')||chr(34))"A",
AAC_AGT_CD "AGT_CD",
to_char(AAC_PROC_DT,'RRRR/MM/DD') "PROC_DT"
FROM
Database.VTABLE
WHERE
(
(AAC_COMM_TYPE = 'FYC'
OR AAC_ADJ_TYPE IN ('FAC01', 'FAC02', 'FAC04', 'FAC09', 'FAC10', 'FAC35', 'FAC38', 'FAC59', 'FAC60'))
AND AAC_FASAT_DIVISION IN ('I', 'G')
AND AAC_WEIGHTED_AFYC != 0
AND ( ( AAC_PROC_DT ) > (to_date(Concat((to_number(to_char(sysdate,'YYYY') ) - 1),'-12-31'),'YYYY/mm/dd')) )
)
ORDER BY AGT_CD, PROC_DT;
spool off;
exit;
Feb 28 '08 #1
0 1417

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
19
by: DW | last post by:
Hi, all... I have a sizeable database running under Oracle 9.2.0.4 under AIX 5.2.0. I am faced with an impending move to a Windows environment, running under SQL 2000. Currently, we are...
2
by: z | last post by:
Is there a tool for converting oracle scripts to db2? In particular I want to convert oracle example script hr_main.sql to db2. I imagine it might not be difficult to do by hand, for this...
5
by: k.vanderstarren | last post by:
Hi All, I'm trying to convert some ASP.NET code that I found at http://weblogs.asp.net/dannychen/archive/2005/12/02/432190.aspx from VB to C#. I've managed to convert the portion that is in...
5
by: dreadnought8 | last post by:
I've worked with mdbs, and with SQL Server to a lesser extent, with Access as a front end, on commercial-strength systems for quite a while, starting with A97. The last 8 months or so, I've been...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
0
by: Mark D Powell | last post by:
I have a 64 bit SQL Server 2005 SP2 on a Windows 2003 x64. The developer said that he needed to use OLE to talk to Oracle so I went to Oracle and downloaded the 64 bit OraOLDDB driver as...
2
by: iitt2007 | last post by:
I need to convert Oracle SQL SPs and functions to SQL 2005. Table and columns names do match. Is there any tool which will 'convert' Oracle script yntax to to SQL 2005 syntax? I can't install it on...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.