Trigger code is written in [closed] - sql

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
Trigger code is written in:
SQL
PL/SQL
JAVA
Machine Language
I think options of this question is wrong, bcoz option 1 and 2 are correct. I know only one thing is that we use SQL in terms of MS SQL,MY SQL, Sybase whereas PL/SQL uses in Oracle. please correct me with exact opinion about this question?

Let's clarify each option:
1) Structured Query Language - used for communication with databases, and CRUD operations. Triggers are not written in SQL.
2) PL/SQL - language which used in Oracle databases, procedural language which is extension of SQL. PL/SQL has exact block structure which called trigger, which is implicitly started when an INSERT, UPDATE or DELETE statement is issued against an associated table.
3) Java is object oriented, cross-platforming high-level language. You can create some trigger-like stuff in Java, but in general it doesn't have trigger units.
4) Machine language is instructions which are executed directly on CPU for solving specific task.
So, option 2 is exactly matches the answer.

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.

Saving a database function in a table column [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am deploying an application at one of our vendor. We have few special character that needs to be removed using a function. Vendor is really slow with any changes that we request.
I have access to one of the configuration table that we use to save configuration table.
I want to save a SQL function in the table column that I will fetch at run-time and will execute it.
I am not sure if its a good programming practice. Please suggest if this should not be used then why or is there any other way to do it?
Database is SQL Server. Suggest if it's a good programming practice.
A better practice would be to write your function in such a way that you don't have to change it every time a new special character pops up.
Instead of writing a function that filters out a predefined set of special characters, why don't you write a function that allows a predefined set of non-special characters? Then you should never have to change it.
you can use a Computed column in sql server, for me it's not a good practice depending on the scenario that you are trying to achieve but I think this might help you

Questions about several SQL commands [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 am working on my database class project. I am reading the PostgreSQL Write-ahead-logging README, it mentioned several commands such as SQL commands
BEGIN
COMMIT
ROLLBACK
SAVEPOINT
ROLLBACK
RELEASE
In the SQL standard, I didn't see those commands. I am confused by that. What's the differences between those commands and standard "SELECT"? Could anyone tell me more about those commands? Can those commands be used the same way as standard SQL?
The ANSI SQL Standard [http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt] is also your friend, and you can find these keywords defined there.
Generally all these keywords behave similarly across platforms, but beware the subtle differences in their function, performance or usage.
For example: SAVEPOPINT has similar meanings across different platforms (albeit possibly differing implementations or context), so you need to refer to your platform docs for specifics.
In this case, the Postgres 9.1 manual [http://www.postgresql.org/docs/9.1/] (the one I have bookmarked) ROLLBACK and RELEASE keywords are used together with other modifiers to apply to a SAVEPOINT within a transaction.
OTOH: T-SQL (MS-SQL Server) requires SAVE|ROLLBACK TRANSACTION when operating on a SAVEPOINT [http://msdn.microsoft.com/en-us/library/ms188378.aspx].
Hope that helps!

Difference between Script, Stored Procedure, T-SQL, PL/SQL [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'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.