Got 'Enter values for precautions" popup in Oracle Developer [duplicate] - sql

This question already has answers here:
How to avoid variable substitution in Oracle SQL Developer
(5 answers)
Closed 1 year ago.
I'm using Oracle Developer to execute the SQL queries. I got this popup:
Enter value for precaution
when I'm trying to execute an insert query. Does anyone know why I'm getting this popup?

It would be simpler to answer if you posted statement you ran.
Meanwhile, that's probably because insert contains & which indicates a bind variable. Something like this:
insert into test (name) values ('Is this what&precaution?');
What to do? Run set define off first, then run the insert.

Related

Ignore errors in mysql by reading from some MySQL dump [duplicate]

This question already has answers here:
Ignore mysql error messages when executing an sql file
(2 answers)
Closed 8 years ago.
I got an MySQL dump with ONLY insert statements. I tried to import it like this:
mysql> \. racktablesTabellen.sql
which always worked for me, till now because I got some errors I have to ignore. Can anybody tell me how to Ignore errors and just keep on with the entries when I got an sql dump with only insert statements ?
A possible solution is to remove the PRIMARY KEY from your table, import and add the PRIAMRY KEY again with ALTER IGNORE syntax.

How to Check the given string is a reserved keyword in sql server [duplicate]

This question already has answers here:
Check if string is SQL Server Reserved Keywords or not
(3 answers)
Closed 8 years ago.
How to check whether the given string is a reserved keyword in sql server.
I checked a lot in google ,but i didn't find one!!
for eg: If i am giving the input String as 'Order',sql statement should
return whether it is reserved keyword.
Is there any built-in stored procedures or function to do this? Any help would be appreciated.
There is no built-in function to do that.
Here is the list of the known identifiers.
http://technet.microsoft.com/en-us/library/ms189822.aspx
I suggest to put these in an table and use it in a function / stored procedure.

SQLite delete with table alias [duplicate]

This question already has answers here:
Sqlite delete query error
(3 answers)
Closed 9 years ago.
I am trying to alias a table in SQLite, for example by the following command: (it is from the book i am reading"Database Management Systems by Ramakrishnan")
DELETE FROM Students S WHERE S.sid=12546
This code gives a syntax error. Without aliasing, the following code works:
DELETE FROM Students WHERE sid=12546
But, if i want to alias the table, what should i do? Can anyone help?
Thanks
The DELETE statement operates on a single table and does not use a table alias. so you will have to use your query as :
DELETE FROM Students WHERE sid=12546
Update:
SQLite apparently doesn't support joins with the delete statement, as you can see on the Syntax diagrams. In short in SQLite, one DELETE command deletes from only one table. So aliasing is of no use

What does a colon (':') mean in SQL syntax? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What does the colon sign “:” do in a SQL query?
Simple SQL question:
What does : stand for?
For example:
SELECT * FROM myTable
WHERE Employee_column = :P_EmplId;
The : isn't exactly easy to google when you don't know what this is called. Even searching here didn't help. I'm using Oracle 11g if that makes any difference.
It is a bind variable:
A placeholder in a SQL statement that must be replaced with a valid
value or value address for the statement to execute successfully. By
using bind variables, you can write a SQL statement that accepts
inputs or parameters at run time. The following example shows a query
that uses v_empid as a bind variable:
Most likely you took the query from a template. It is meant to be processed with php's MDB2 sql framework. The ":" (colon) signals a placeholder in the statement, meant to be replaced when the query is executed.

what is use of question mark in sql [duplicate]

This question already has answers here:
What is the question mark's significance in MySQL at "WHERE column = ?"?
(4 answers)
What does a question mark represent in SQL queries?
(6 answers)
Closed 9 years ago.
I was just surfing the net and found a query something like:
sql = "select milk_rate from special_milk_rate
where code_producer_id=? and effective_from <= ?
and effective_till >= ?"
what exactly this query means i means what is the use of ? in this statement.
and one thing more what is use of & in sql.
This usually implies a prepared statement, where the parameters are filled in later. (see e.g. http://en.wikipedia.org/wiki/Prepared_statements#Parameterized_statements).
what exactly this query means i means what is the use of ? in this statement.
The question marks are for parameters.
and one thing more what is use of & in sql.
& is a bitwise AND operator in sql
The question marks are supposed to contain the actual parameters.
E.g.
"select milk_rate from special_milk_rate
where code_producer_id=2 and effective_from <= '20101231'
and effective_till >= '20110124'"
& usually denotes a variable or substitution value which you may be prompted for at run time
Here is nice article:
http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.sqls.doc/sqls610.htm#sii-02prep-18104
In some statements, parameters are
unknown when the statement is prepared
because a different value can be
inserted each time the statement is
executed. In these statements, you can
use a question-mark ( ? ) placeholder
where a parameter must be supplied
when the statement is executed.
Question marks are found in prepared statements, meaning it is parametrized and can be called again and again without having to reconstruct the whole sql statement, just by changing the parameters. Some frameworks use those that together with SqlCommands. Those encapsulate escaping and prevent sql injection attacks.
Some frameworks also allow named parameters.