Home » SQL ServerRSS

Ingres to SQL Syntax

Hi all!

I wrote a report script in ingres with relative ease a long time ago. Now we are changing the database over to MSSQL and I want to tweak the query to work with it. I have been googling for hours and can't find the SQL equivalent of some of the language. 

The following is the Ingres code:

select w.sequence_no, w.surgeon, w.surg_date, w.adm_date,'',w.pat_cat,w.notes_code,
squeeze(d.title + ' ' + d.initials + ' ' + d.name),
squeeze(p.surname + ' ' + p.given_name_1 + ' ' + p.given_name_2),
squeeze( p.address_1 + ' ' + pd.address_2 ),
squeeze( pd.address_3 + ' ' + pd.pcode ),
pd.home_phone,pd.bus_phone,p.ur_number,p.____,
int4(interval('yrs', 'today' - p.birth_date)),
int4(interval('months', 'today' - p.birth_date)),
int4(interval('weeks', 'today' - p.birth_date)),
w.oth_notes,''from thschedule w, doctor d, patient p , pat_details pd
where w.surgeon like :surgeon_code
    and w.surg_date >= date(:start_date)
    and w.surg_date <= date(:end_date)
    and d.dr_code = w.surgeon
    and w.cancel_date = ''and w.hosp_code = @hosp_code
    and p.patient_id = w.patient_id
	and p.patient_id = pd.patient_id
I have changed a bulk of it to SQL but the squeeze and int4 is giving me grief.

 

2 Answers Found

 

Answer 1

Well, here is the functions list http://community.ingres.com/wiki/Ingres_DBMS_function_list Try looking through the blogs referenced in that article to understand what each function does (wish he can post some examples and documentation for each function).

This is what I found by 1 min. googling, hope, it's helpful.

 

Answer 2

Not really sure that helps. But thanks.
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter