p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   PL/SQL (http://p2p.wrox.com/showthread.php?t=51572)

Somesh December 15th, 2006 12:24 AM

Can you tell me if ASP.NET supports or not the PL/SQL language?


peace95 December 15th, 2006 01:46 AM

No. PL/SQL is Oracle's proprietary software.

dparsons December 15th, 2006 09:51 AM

Hold on. .NET does include Classes to connect to ORACLE backends and, as such, any valid PL/SQL command that you can pass to oracle you can pass through the Oracle classes and have the database execute the command.

Doing so is no different then when you use the SQL objects to pass T-SQL commands to a SQL Server.

So yes, you should beable to connect your .NET app to an oracle database and execute commands against it.


I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature

peace95 December 15th, 2006 02:32 PM

Maybe here there is a difference in interpreting the question or I have not reached the section on ASP.NET Web Services yet. However, I interpreted the question to mean as follows:

After one has set the appropriate connections via Oracle's supplied classes(<%@ import .... System.Data.OraclClient>) and after the string connection:
 Dim strConnection As String=ConfigurationSettings.Appsettings("OracleDB ")
Dim objConnection As New OraclConnection(strConnection)
then on the next statement:
  v_row_count PLS_INTEGER := 0;
  v_field_count PLS_INTEGER := 0;
  v_null_count PLS_INTEGER := 0;
  v_nullbit BOOLEAN := NULL;
  v_test_column tblname.tblcolumn%TYPE;
 -- Cursor Declaration
CURSOR tbl_cur IS
   SELECT count(a.tblid),
    FROM tblname a;
 -- Execution section
 -- Open cursor
   OPEN tbl_cur;
 -- Loop thru all records
   FETCH tbl_cur INTO v_row_count, v_test_column;
 -- test for Nulls
  IF v_test_column = v_nullbit
    THEN v_null_count := v_null_count + 1;
    ELSE v_field_count := v_field_count + 1;
    END IF;
 -- Display All Counts
  DBMS_OUTPUT.PUT_LINE('Total Records: 'v_row_count
                       || 'Total Empty Cells: ' v_null_count
                       || ','
                       || 'Total Cells Used: ' v_field_count)
  CLOSE tbl_cur;
Whether one can put all the PL/SQL code into "applet" or "script", I don't know ... have not reached that section yet. Maybe the above code could be transposed into "Javascript", but then that would be javascript and not PL/SQL. Executing the Standard SQL commands would because at this point oracle db is of the Xbase technology (relational DB). I even left out the EXCEPTION Block.

"....when in doubt, punt". So Somesh what type of PL/SQL support were you referencing in your question?

dparsons December 15th, 2006 04:00 PM

In so far as your above code goes, I understand your interpetation. In reality though, I programmer would never do this (while it is possible). It does not lend itself well to readability in the slightest bit and would be better as a stored procedure somewhere on the server.

Basic SQL Commands (SELECT, UPDATE, DELETE, INSERT) it is plausable to have those inline but, in the above instance, it is just silly to presume someone would place this inside their code.

Again, that is my opinin.

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature

peace95 December 15th, 2006 04:46 PM

I was simply demonstrating "PL/SQL" code only, to understand what Somesh is asking in his question. I did not say that the inserted code (strPLSQL) was the best way or best practice or any of the sort. Just trying to get a clearer understanding of the "original question" in this topic.
================================================== ==============
Note the following quotes:

"So what is PL/SQL? It is procedural (and sometimes object-oriented) programming extension to SQL, provided by Oracle, exclusively for Oracle."
"... The PL in PL/SQL stands for procedural language. PL/SQL is a proprietary language not available outside the Oracle Database." From the book, [u]Oracle Database 10g- PL/SQL Programming</u>, Scott Urman, Ron Hardman and Michael McLaughlin, Oracle Press, p.6

dparsons December 15th, 2006 04:58 PM

Lets just agree to disagree. I make the understanding that when someone asks that question that they are asking for interface support for a type of RDBMS not if X technology or language supports, natively, the ability to write SQL Statements in code and have the compiler interpet them as valid PL/SQL statements.

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature

peace95 December 15th, 2006 05:49 PM

I would prefer the word "impasse"....SQL is the second part of PL/SQL, so data manipulation language(DML), i.e. SELECT(Data Retrieval only),INSERT, UPDATE and DELETE statements are valid and usuable.

Well Somesh...there you go... I am finish with this topic, regardless.

All times are GMT -4. The time now is 01:49 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.