Hi,
I want to convert my complete database of PostgresQL to MS-SQL.
I am some what successful in converting tables but the major problem is Functions and Triggers.
Please help.
2 4977
Post your stored proc and functions and we can try to help you convert it.Depending on the logic and business rules of your procedure and functions, it might not be able to be translated line by line. Instead, some (or all) of them might be completely re-written.
-- CK
Post your stored proc and functions and we can try to help you convert it.Depending on the logic and business rules of your procedure and functions, it might not be able to be translated line by line. Instead, some (or all) of them might be completely re-written.
-- CK
One of the Function: -
-- Function: sp_get_form_bag_content(bigint, bpchar)
-
-
-- DROP FUNCTION sp_get_form_bag_content(bigint, bpchar);
-
-
CREATE OR REPLACE FUNCTION sp_get_form_bag_content(in_cand_id bigint, in_payment_mode bpchar)
-
RETURNS SETOF typ_form_bag_content AS
-
$BODY$
-
DECLARE
-
-
v_form_id_arr _int2;
-
v_rec form_bag%ROWTYPE;
-
v_return_rec typ_form_bag_content;
-
v_index int2;
-
-
BEGIN
-
-
update cand_preferences
-
set payment_mode = in_payment_mode
-
where cand_id = in_cand_id
-
and payment_mode <> in_payment_mode;
-
-
v_index=0;
-
for v_rec in select form_id from form_bag where cand_id=in_cand_id
-
loop
-
v_form_id_arr[v_index]= v_rec.form_id;
-
v_index = v_index + 1;
-
raise notice '%', v_form_id_arr[0];
-
end loop;
-
-
-
for v_return_rec in
-
select temp2.form_id, college_name, course_list, form_cost, warning, sp_format_date(last_date,'DD-Mon-YYYY, DOW'), is_exam from (
-
select college_id, temp.form_id, course_list, form_cost, warning, last_date, is_exam from
-
(
-
select sp_warnings_cost.form_id, course_list, warning, form_cost from
-
(
-
select sp_cost.form_id, coalesce(sp_warnings.warning,'') as warning, sp_cost.form_cost from
-
(
-
select form_id,
-
array_to_string(array_accum(warnings), '::') as warning
-
from (
-
select *
-
from sp_check_form_constraints(in_cand_id, v_form_id_arr)
-
) as sp1_warnings
-
group by form_id
-
) as sp_warnings
-
-
right outer join sp_get_forms_cost(in_cand_id, v_form_id_arr) as sp_cost on sp_cost.form_id=sp_warnings.form_id
-
) as sp_warnings_cost
-
-
left outer join sp_get_form_bag_courses(in_cand_id) sp_courses on sp_warnings_cost.form_id=sp_courses.form_id
-
) as temp
-
inner join forms f on f.form_id=temp.form_id
-
)temp2
-
inner join colleges col on col.college_id=temp2.college_id
-
loop
-
-
return next v_return_rec;
-
-
end loop;
-
-
return;
-
END;
-
$BODY$
-
LANGUAGE 'plpgsql' VOLATILE
-
COST 100
-
ROWS 1000;
-
ALTER FUNCTION sp_get_form_bag_content(bigint, bpchar) OWNER TO postgres;
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: G Lam |
last post by:
Hi, I have some experience in MS Access 97 and 2000 and did write some
application with them. Now, I want to learn PostgreSQL. I installed it on a
RH8.0 server. Which books would you guys...
|
by: Chris M. Gamble |
last post by:
Does anyone know a good commercial application that does multi-master replication for postgres?
Thanks
---------------------------(end of broadcast)---------------------------
TIP 2: you can...
|
by: jini us |
last post by:
Hi,
I am starting a new project where I intend to use
embedded database server in my win32 application.
I intend to use VC++ microsoft studio 6.0 as my
development environment.
The...
|
by: Durai |
last post by:
Hi All,
I tested "concurrent testing" in MySQL. It works fine. But I couldn't do in PostgreSQL 7.3.4 on HPUX IPF. I got deadlock problem. I used the PHP script to update table( one script...
|
by: btober |
last post by:
I noticed this gem for allowing the saving of MS-Project 2000 data into a
Postgresql database,
http://techdocs.postgresql.org/source.php#fmsproject
posted by John P Cavanaugh probably a...
|
by: Zlatko Matić |
last post by:
Is it possible to use Access as front-end for POstgreSQL and how ?
What about Access Projects (.adp) and PostgreSQL ?
|
by: Alex Madon |
last post by:
Hello,
I am testing a web application (using the DBX PHP function to call a
Postgresql backend).
I have 375Mb RAM on my test home box.
I ran ab (apache benchmark) to test the behaviour of the...
|
by: Chris Ochs |
last post by:
We have a number of tables in a CRM that is written in MS access that I need
to be able to provide a web interface to. I can export the tables just fine
using pgadmin II, but I cant' think of a...
|
by: hergele |
last post by:
Hello all.. I am trying to convert an application which is working on Oracle to postgreSql..
I've seen a query in code something like this...
select *
from table1 a1 , table1 a2, table2 a3, ...
|
by: shajimon |
last post by:
hai All
I am very new to PostgreSql.
I have given the following code to VB 6. and it takes around 2 to 3 minutes to exicute with PostgreSQL back end. However, the same code work in a fraction of a...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |