Hello all,
I am new to convert PLSQL to TSQL. Any expertise in SQL, please help me to do convert the belowed PLSQL procedure to SP in SQL server. I really appreciate your time. Thanks in advance.
=============== =============== =============== =
PROCEDURE SaveTestAs(P_Pr ogramID NUMBER,
P_ProgramName VARCHAR2)
IS
L_TestId INTEGER := 0;
CURSOR L_Program IS
SELECT *
FROM PROGRAMS
WHERE PROGRAM_ID = P_ProgramID;
CURSOR L_ProgramTest IS
SELECT *
FROM PROGRAM_TEST
WHERE PROGRAM_ID = P_ProgramID;
CURSOR L_ProgramNums(C _TestID IN NUMBER) IS
SELECT *
FROM PROGRAM_NUMERIC S
WHERE TEST_ID = C_TestId;
CURSOR L_ProgramStr(C_ TestID IN NUMBER) IS
SELECT *
FROM PROGRAM_STRINGS
WHERE TEST_ID = C_TestID;
BEGIN
FOR R_Programs IN L_Program LOOP
INSERT INTO PROGRAMS
VALUES(PROGRAMI D.NEXTVAL,
P_ProgramName,
R_Programs.Prog ram_Description ,
SYSDATE,
R_Programs.Crea ted_By,
'',
R_Programs.Stat ion_NO);
END LOOP;
FOR R_PT IN L_ProgramTest LOOP
INSERT INTO PROGRAM_TEST
VALUES(TESTID.N EXTVAL,
PROGRAMID.CURRV AL,
R_PT.TEST_NUMBE R,
R_PT.TESTDEF_ID ,
R_PT.FAIL_MESSA GE,
R_PT.FAIL_HELPF ILE,
R_PT.ACTIVE,
R_PT.CONTINUE_O N_FAIL);
FOR R_PN IN L_ProgramNums(R _PT.TEST_ID) LOOP
INSERT INTO PROGRAM_NUMERIC S
VALUES(NUMERIC_ ID.NEXTVAL,
TESTID.CURRVAL,
R_PN.NUM_PARAM_ NUM,
R_PN.NUMERIC_PA RAMETER,
R_PN.HELP_DESCR IPTION);
END LOOP;
FOR R_PS IN L_ProgramStr(R_ PT.TEST_ID) LOOP
INSERT INTO PROGRAM_STRINGS
VALUES(STRING_I D.NEXTVAL,
TESTID.CURRVAL,
R_PS.STRING_PAR AM_NUM,
R_PS.STRING_PAR AMETER,
R_PS.HELP_DESCR IPTION);
END LOOP;
END LOOP;
END SaveTestAs;
1 7079
you can use any third party control or convert the code by yourself.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: English Teacher |
last post by:
Which would be a more useful relational database server to learn
nowadays: MS SQL SERVER or ORACLE?
Thanks!
|
by: tristant |
last post by:
Hi All,
Our client has just decided to migrate from SQLServer2k to Oracle 9i on AIX.
We are considering what development tool / language as the application/
front end platform. We almost decide to use VB.NET, because current skill
is VB 6. Its just more like human resources application and reporting with
distributed database.
The question is : is there any problem if the UI platform is .NET and the
|
by: Michael Rudolph |
last post by:
Hi newsgroup,
I have an issue with the configuration of a DB2 federated database
(WebSphere Information Integrator) in conjunction with the relational
wrapper for Oracle on AIX. DB2 seems to not use the existing tnsnames.ora.
The Oracle client is installed and the connection to the Oracle database
using tnsping and sqlplus is possible (for the db2instance user). For
that I changed the environment for the db2instanceuser and added the...
|
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 working on Access 2000/2002 with
pass through queries and linked tables to an Oracle 10g backend
(ODBC).
Access seems (still) to beat everything else hands down as a front
end/ prototyping tool for WIndows based systems. With my type of
small...
|
by: jobs |
last post by:
I am able to access 9i and 10g Oracle DBs from other clients on my pc
- sqlplus, PLSQL Developer, etc.
As a simple test I just wanted to connect and access the same oracle
DBs through ASP.NET on my same client ...
my web config connection entry looks like this (somebody elsewhere
said this was working for them):
<add name="pp2" connectionString="user id=xxx;password=xxx;data
| |
by: anuptosh |
last post by:
Hi,
I have been trying to run the below example to get a Oracle Array as an output from a Java code. This is an example I have found on the web. But, the expected result is that the code should return me Array element type code 1, but it is returning me type code 12 and the array in a junk or unreadable format . Our environment is JDK 1.4, ojdbc14.jar and Oracle 8i
Not able to find out what they problem is and am not able to change the...
|
by: tickle |
last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2
* copybook - celg02u3.sql SIR 24265 *
* updates dt_deny for all rows in *
* the removal_eligibility_link table for all persons *
* in all stages associated with the victim who has *
* has had a specific legal status change *
EXEC SQL EXECUTE
|
by: singhjih |
last post by:
The table looks like the following:
Code
-------------------
INSTRUCTOR_ID(PK) NUMBER(8,0) NOT NULL
SALUTATION VARCHAR2(5) NULL
FIRST_NAME VARCHAR2(25) NULL
LAST_NAME VARCHAR2(25) NULL
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |