INSERT INTO table
SELECT 'jonny', NULL
FROM dual -- Not Oracle? No need for dual, drop that line
WHERE NOT EXISTS (SELECT NULL -- canonical way, but you can select
-- anything as EXISTS only checks existence
FROM table
WHERE name="jonny"
)
Related Contents:
- Get counts of all tables in a schema
- Can you SELECT everything, but 1 or 2 fields, without writer’s cramp?
- PL/SQL, how to escape single quote in a string?
- Printing the value of a variable in SQL Developer
- PL/SQL – Use “List” Variable in Where In Clause
- Passing an array of data as an input parameter to an Oracle procedure
- if (select count(column) from table) > 0 then
- Why cannot I use bind variables in DDL/SCL statements in dynamic SQL?
- Can We use threading in PL/SQL?
- Oracle PL/SQL – Raise User-Defined Exception With Custom SQLERRM
- UTL_FILE.FOPEN() procedure not accepting path for directory?
- Oracle stored procedure with parameters for IN clause
- PL/SQL ORA-01422: exact fetch returns more than requested number of rows
- Convert comma separated string to array in PL/SQL
- Oracle PL/SQL – How to create a simple array variable?
- Get resultset from oracle stored procedure
- check if “it’s a number” function in Oracle
- Split function in oracle to comma separated values with automatic sequence
- ORA-06508: PL/SQL: could not find program unit being called
- Trying to export a Oracle via PL/SQL gives a date of 0000-00-00
- Number of rows affected by an UPDATE in PL/SQL
- PL/SQL print out ref cursor returned by a stored procedure
- How to return a resultset / cursor from a Oracle PL/SQL anonymous block that executes Dynamic SQL?
- Create Pivot view in SQL from a SQL table
- Splitting comma separated string in a PL/SQL stored proc
- SQL*Plus how to accept text variable from prompt?
- Reading clob line by line with pl\sql
- Functions vs procedures in Oracle
- Declaring a variable and setting its value from a SELECT query in Oracle
- Is there a combination of “LIKE” and “IN” in SQL?
- Calculate difference between 2 date / times in Oracle SQL
- Using date in a check constraint, Oracle
- how to export data from log table to email body in oracle
- Fetch Oracle table type from stored procedure using JDBC
- SQL to generate a list of numbers from 1 to 100
- Getting output from dbms_output.get_lines using JDBC
- ORA-01017 Invalid Username/Password when connecting to 11g database from 9i client
- Oracle (Old?) Joins – A tool/script for conversion?
- Oracle: How to find out if there is a transaction pending?
- How to find out when an Oracle table was updated the last time
- Is there a function to split a string in Oracle PL/SQL?
- Using the “IN” clause with a comma delimited string from the output of a replace() function in Oracle SQL
- passing table and column name dynamically using bind variables
- Deploying and Configuring ODP.NET to work without installation with Entity Framework
- Spring Batch ORA-08177: can’t serialize access for this transaction when running single job, SERIALIZED isolation level
- ORA-01461: can bind a LONG value only for insert into a LONG column-Occurs when querying
- Faster alternative in Oracle to SELECT COUNT(*) FROM sometable
- Find out the history of SQL queries
- How to drop multiple interval partitions based on date?
- Why are Oracle table/column/index names limited to 30 characters?