Difference between Script, Stored Procedure, T-SQL, PL/SQL [closed] - sql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm getting really confused with all these terms. I used to attend a class called PL/SQL, then when I came out to work, I came across other terms like Stored Procedure, T-SQL and even script. They all look very similar to me, but exactly what are the differences between each of them? (if any)

Here's some rough definitions to explain the differences.
PL/SQL - a SQL variation specific to Oracle databases.
T-SQL (Transact-SQL) - a SQL variation specific to Microsoft (and Sybase) databases.
Stored Procedure - a set of SQL commands that is precompiled and stored on the server for reuse
Script - a set of SQL commands that is run ad-hoc (not precompiled / not meant for reuse)
There are more differences between Stored Procedures and Scripts (e.g. sprocs can have parameters, etc.) but that's the fundamental difference.

T-SQL is Microsoft's version of SQL. PL/SQL is Oracle's version of SQL. Both are ANSI SQL compliant, but contain additional capabilities that are not in the standard.
A Stored Procedure is a prepared SQL statement that is stored on the database server, and can be reused by calling it.
Script is basically code, but scripts are typically small, standalone programs that operate without the aid of a GUI. A Stored Procedure could properly be called a script.

Related

How to implement DML operations like insert and delete in a SQL Server Function [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 months ago.
Improve this question
I am working in Oracle to SQL Server Migration using SSMA tool. In oracle we have DML operations like insert and delete implemented in a function, when the code is migrated to SQL server these DML operations are not implemented in SQL server.
Do I need install any supporting packages in order to accomplish it?
I googled and did some investigation but couldn't get any better solution. I tried converting this function to procedure it worked but the problem is these procedures cannot be called by any select queries and all
In SQL Server you are not allowed to perform Create/Update/Delete operations in functions. If you need, you can create STORED PROCEDURE. But the stored procedure itself, cannot be used in SELECT statements (joins, apply). So, if you need to used it results in a JOIN for example, you can INSERT its results in table, but there are limitations there, too.

Oracle PL SQL command-line utility [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Is there any kind of program on oracle which helps you with typing?
For example there is SQL Prompt on MS SQL Server, and I want to know if there is something like this on PL/SQL Developer.
The Oracle ecosystem is slightly different in approach from MS SQL Server. Traditionally Oracle has offered a top-notch RDBMS but its supporting tools have been rather basic, with third-party vendors filling in the gap. This contrasts with the MS approach which offers tightly integrated environments for managing and developing against MSSQL.
So yes, PL/SQL Developer (the Allround Automations product) has code completion for PL/SQL and SQL elements. Quest TOAD has it too. Oracle came late to the IDE game but its Oracle SQL Developer product does code completion. Finally, the new Oracle SQL Command Line tool offers statement completion, which is another reason it is superior to the venerable SQL*Plus tool.
These are all separate tools, even the Oracle ones, until Oracle 12cR2 which does bundle SQLcl in the download.

Easy migration from SQL Server to Oracle [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a vb.net application working well over SQL Server 2008.
My sql requests are basic and simple, like select, insert into, update...
I'm not using any SQL Server sepcific commands or instructions.
Now I want to change my database server to Oracle, running on a Linux machine.
Is it possible??? Or I must re-write all my SQL requests?
This is a rather general question (perhaps "too broad" would apply). You definitely have some gotchas, even for simple statements:
SUBSTR() versus SUBSTRING()
VARCHAR2() versus VARCHAR()
INSTR() versus CHARINDEX()
|| versus + for string concatenation
LENGTH() versus LEN()
TRIM() versus LTRIM()/RTRIM()
SYSDATE versus GETDATE()
and so on.
There are also significant differences in syntax, for instance:
SQL Server allows joins in UPDATE, which Oracle does not.
Oracle limits resolution of correlated queries to a scope only only layer deep.
SQL Server has the APPLY keywords for certain types of joins.
Oracle DATE data type has a time component, but not SQL Server
This is by no means a comprehensive list. It is just suggestive that you will need to do some work to move between the databases. However, that work might be mostly cosmetic.

Query strings safe or not? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have read the posts about sql injection and there I saw that they use the query strings of sites to hack them. I want to know is it safe to use query strings or not and how to make my site stable against sql injection?
A sql injection usually comes from bugs in code that runs server side and submit sql queries to a database. Many bugs in the way you implement this can result to a sql injection. You can read values from a url, but before you plug these values to a sql query you should make some checking.
In order to answer to your question, query strings are safe the way you use the variables that are in them may be not.
As for making your site not vulnerable to them you should implement all your data access layer code (calling of stored procedures, of CRUD operations, of functions etc.) not vulnerable to them. For instance if you use queries, in which you pass parameterized variables then you can avoid a great deal of sql injections. Please take a look here
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
If you build your SQL statements from untrusted data, such as query strings, then you are vulnerable to SQL injection.

can we use packages in ms sql server 2008 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
can we use packages in ms sql server 2008...i m new to sql server ...
if yes how it can be created and used....
The only thing somewhat similar would be a SQL-CLR assembly, e.g. C# code compiled into an assembly, hosted inside SQL.
There's no equivalent of a package for T-SQL stored functions and stored procedures in SQL Server.
What do you need that for, anyway? Granting permissions?
What you could investigate, too, are the schemas in SQL Server, which also help you grant or manage permissions - but it's quite a different beast from Oracle PL/SQL packages. Schemas manage collections of database objects (any of them - tables, views, stored procs and funcs).
Working with schemas in SQL Server 2005
Security enhancements in SQL Server 2005 - schemas
Marc
I assume you are talking about the Oracle concept of a package which groups related queries etc. If so as far as I know this concept doesn't exit in SQL Server. Also you will get some interference when trying to Google for this from DTS packages, which are a completely different concept.