Execute sql-statement once at date x [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 8 years ago.
Improve this question
I want to have an sql update-statement executed once at date x. How can I achieve this on an Oracle 10g database?
EDIT:
My aim is to fire an update statement every day. Why? I have a tiny mistake in my application, that can be 'temporarily fixed' with this statement (since I only have db-access till the real fix will happen).
Jonny

Consider DBMS_SCHEDULER. It is meant for running jobs periodically, but you can set up your pl/sql job script to suspend or cancel the job entry after your run-once job ends successfully.
http://docs.oracle.com/cd/B28359_01/server.111/b28310/scheduse.htm

You can use Crontab to schedule a task to be executed at given day/time.
See: http://en.wikipedia.org/wiki/Crontab

Related

Execute Queries in sequence [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 4 years ago.
Improve this question
I have 5 queries
all are dependent on one by one
i have to run all queries in one time but it will be executed in sequence
it's possible..?
please help me
You can build a stored procedure and execute each query in desired order by placing the queries in corresponding execution order
you can use SSIS's sequence or process container to execute all of your SQL encapsulated in stored procedure at the same time, the provided screenshot show's processes in precedence, but you can also design them to execute at the same time.
Hope this helps.
Cheers!
Imagination is more important than knowledge

How to go about scraping and writing a script for an Oracle database [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 4 years ago.
Improve this question
My manager has asked me to write a program that pulls data from a database that I have access to (it's an Oracle database and I'm using SQL developer). The idea is to get the data they want and put into an excel sheet in a way they would like. I haven't really wrote scripts before nor have I ever wrote a scraper, I was wondering what the first step is here and what resources I should use to get started? I have a couple of weeks to do this but I don't really know where to start.
I would start with an SQL query to find the data your manager wants. If you got the right result on screen, just right-click into the query result, select 'Export', and format= Excel...

Using SQL Transactions for a single sql query [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 4 years ago.
Improve this question
I have read a lot about SQL-transaction the pased few days.
But i have not found an answer to my question. So maybe someone here can solve my problem?
The exact question is: Should i use a sql transaction for a single select/update/insert statement?
Or is it to overact to use SQL transactions for a single sql statement?
Thanks...
regards
Ali
Individual statements implicitly have their own transactions. By default, individual statements create and rollback/commit themselves. In theory, you can make it so that it will behave like an explicit transaction, although I can't think of a super great reason to do this. https://learn.microsoft.com/en-us/sql/t-sql/statements/set-implicit-transactions-transact-sql?view=sql-server-2017
The only reason I can think of to wrap an individual statement in its own explicit transaction is if you wanted to leave the transaction open so you could test something like blocking, or just maybe check the data while debugging before rolling it back.

SQL Server : create jobs [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 need to create a procedure which repeats itself several times. Let's say I want to change a character's position in a browser game for 3 minutes from one place to another. Its coordinates change constantly in the database. I need it to be dynamic so that I can use this code to move the character to more places in a different amount of time depending on the parameters passed to the procedure.
How can I do it?
Does jobs solve the problem? If so, how can I do it with jobs?
You could use the RAND() function to generate random coordinates, and a sql agent job to run the procedure throughout the day.
Since you mentioned that the coordinates change constantly in the database, you can have an update trigger that runs the stored procedure you have in mind instead of relying on a job. Let me know if you need more info on this.

Store a temporary table and update it every hour [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 8 years ago.
Improve this question
I have never done this before, and I'm not sure if it is possible. Basically, I have a big query that takes around 1-2 minutes to run. What I'd like to do is:
automatically execute and put result into a table every hour.
My webpage will then query against the temporary table instead, which should be quicker.
I am looking for the steps to do this like. First, create a stored procedure. Second, setup somewhere to run the store procedure automatically. I'm not sure how to proceed — can you suggest how?
SQL server supports running scheduled jobs. You can look here.
http://technet.microsoft.com/en-us/library/ms190268%28v=sql.100%29.aspx
Also check this question, it should give you
a very good idea of the steps you need to take.
How to run a stored procedure in sql server every hour?