Home » SQL & PL/SQL » SQL & PL/SQL » NOT IN command question.. (Oracle Form 6i)
NOT IN command question.. [message #449249] Sun, 28 March 2010 22:04 Go to next message
Oskar28
Messages: 2
Registered: February 2010
Location: Philippines
Junior Member
Is this possible?..

SELECT DISTINCT A.column
INTO v_column
FROM TABLE_SAMPLE A
WHERE A.column NOT IN (variable)

variable contains 1,2,3,4

it does not work for me.. do you have some suggestions or alternative way of doing it..
Re: NOT IN command question.. [message #449250 is a reply to message #449249] Sun, 28 March 2010 22:10 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>variable contains 1,2,3,4
It is BAD, POOR, & UNDESIRABLE to store more than 1 value in a single column/variable.

Solution suffers from wrong design.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/


SELECT DISTINCT A.column
INTO v_column
FROM TABLE_SAMPLE A
WHERE A.column NOT IN (1,2,3,4);

[Updated on: Sun, 28 March 2010 22:11]

Report message to a moderator

Re: NOT IN command question.. [message #449270 is a reply to message #449249] Mon, 29 March 2010 00:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
do you have some suggestions or alternative way of doing it..

Just search for "varying inlist" or the like.


Regards
Michel
Tell me and I'll forget; show me and I may remember; involve me and I'll understand
Re: NOT IN command question.. [message #449299 is a reply to message #449249] Mon, 29 March 2010 02:21 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
@Oskar28

Search For dynamic SQL with EXECUTE IMMEDIATE
Re: NOT IN command question.. [message #449303 is a reply to message #449299] Mon, 29 March 2010 02:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, do not use EXECUTE IMMEDIATE for this.

Regards
Michel
Re: NOT IN command question.. [message #449307 is a reply to message #449303] Mon, 29 March 2010 02:35 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Michel Cadot wrote on Mon, 29 March 2010 02:23
No, do not use EXECUTE IMMEDIATE for this.

Regards
Michel


Michel and I did not get it way not !!

this Can be Easy and fast solution for OP.

Re: NOT IN command question.. [message #449308 is a reply to message #449307] Mon, 29 March 2010 02:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL Injection, parsing each time...

Regards
Michel
Re: NOT IN command question.. [message #449310 is a reply to message #449308] Mon, 29 March 2010 02:53 Go to previous message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Michel Cadot wrote on Mon, 29 March 2010 02:45
SQL Injection, parsing each time...

Regards
Michel


Yes...
Previous Topic: PLS-00710: PRAGMA AUTONOMOUS_TRANSACTION cannot be declared here
Next Topic: Find out how much Undo will be generated by a DML, DDL
Goto Forum:
  


Current Time: Fri Apr 19 23:09:45 CDT 2024