Home » SQL & PL/SQL » SQL & PL/SQL » INSERT INTO
INSERT INTO [message #213441] Wed, 10 January 2007 15:47 Go to next message
pradkuamr
Messages: 29
Registered: November 2006
Junior Member
Hi

I am trying to insert a record into a table which is already populated. When I ran


insert into TABLE(BEGIN_DT,END_DT,CREATE_DT,VERSION_DT,LAST_UPDATE_DT) VALUES (SYSDATE,SYSDATE, SYSDATE, SYSDATE, SYSDATE)

it is highlighting on INSERT word
Re: INSERT INTO [message #213443 is a reply to message #213441] Wed, 10 January 2007 15:58 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Specify your insert as:

insert into <table_name> (BEGIN_DT,END_DT,CREATE_DT,VERSION_DT,LAST_UPDATE_DT)
 VALUES (SYSDATE,SYSDATE, SYSDATE, SYSDATE, SYSDATE);
Re: INSERT INTO [message #213444 is a reply to message #213443] Wed, 10 January 2007 16:03 Go to previous messageGo to next message
pradkuamr
Messages: 29
Registered: November 2006
Junior Member
Its still highlighting Insert when I run it in TOAD
Re: INSERT INTO [message #213446 is a reply to message #213444] Wed, 10 January 2007 16:10 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You need to replace <table_name> with the actual name of your table. For example,

insert into mytable (BEGIN_DT,END_DT,CREATE_DT,VERSION_DT,LAST_UPDATE_DT)
 VALUES (SYSDATE,SYSDATE, SYSDATE, SYSDATE, SYSDATE);
Re: INSERT INTO [message #213447 is a reply to message #213446] Wed, 10 January 2007 16:12 Go to previous messageGo to next message
pradkuamr
Messages: 29
Registered: November 2006
Junior Member
Hi

I did it already..still its highliting on INSERT
Just to remind you The table is already having some data
Re: INSERT INTO [message #213448 is a reply to message #213447] Wed, 10 January 2007 16:14 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Can you post the error message that you are receiving? The fact that the table already has rows in it is not an issue.
Re: INSERT INTO [message #213450 is a reply to message #213441] Wed, 10 January 2007 16:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
pradkuamr,
We are NOT standing behind you & can NOT see what you are doing!
Stating that "highlightlighting INSERT" is completely useless to us!
I suggest you stop using TOAD & start using SQL*Plus so you can then actually cut & paste the COMPLETE interaction with Oracle.
Re: INSERT INTO [message #213479 is a reply to message #213450] Wed, 10 January 2007 23:40 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Allright! Betting office is open!

I bet @OP is violating unique key constraint.
Re: INSERT INTO [message #213487 is a reply to message #213479] Thu, 11 January 2007 00:14 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
Quote:
Betting office is open!

I bet on NOT NULL constraint on column not specified in the INSERT statement.
Re: INSERT INTO [message #213496 is a reply to message #213487] Thu, 11 January 2007 00:32 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
My bet will be on an invalid tablename. Extra odds: tablename is "table" or "Table".
Re: INSERT INTO [message #213557 is a reply to message #213496] Thu, 11 January 2007 04:51 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
I've gotta go w/ Frank on this one !
Re: INSERT INTO [message #213559 is a reply to message #213557] Thu, 11 January 2007 04:56 Go to previous messageGo to next message
hari.choprala
Messages: 65
Registered: November 2006
Location: Mumbai
Member

even iam also go w/ Frank on this one !
Re: INSERT INTO [message #213581 is a reply to message #213441] Thu, 11 January 2007 05:52 Go to previous messageGo to next message
Alien
Messages: 292
Registered: June 1999
Senior Member
Quote:
it is highlighting on INSERT word


TOAD does this when it finds the SQL-statement invalid. When the table name is not correct, Toad would highlight the tablename.

My guess is that he is trying to execute it as a single statement while it is not separated from other statements.
There is no ; or / in the original post neither.

Regards,

Arian
Re: INSERT INTO [message #213588 is a reply to message #213581] Thu, 11 January 2007 06:23 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Heheheheh! It seems that three of you are about to lose your wager!
Re: INSERT INTO [message #213590 is a reply to message #213588] Thu, 11 January 2007 06:26 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Ahhhh man...not fair...I'm not a TOAD user.

Guess the next wager needs to be if the OP will actually respond back ??
Re: INSERT INTO [message #213593 is a reply to message #213441] Thu, 11 January 2007 06:40 Go to previous messageGo to next message
Alien
Messages: 292
Registered: June 1999
Senior Member
I bet he does. How else can I win the first bet? Cool
Re: INSERT INTO [message #213597 is a reply to message #213593] Thu, 11 January 2007 06:55 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
@Alien: your first guess might be a reason, but not the second one. In TOAD, statements don't have to finish with ; or / - <Shift + F9> will run them nonetheless.

So, don't hold your breath (yet)!
Re: INSERT INTO [message #213598 is a reply to message #213581] Thu, 11 January 2007 06:58 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Alien wrote on Thu, 11 January 2007 12:52
Quote:
it is highlighting on INSERT word


TOAD does this when it finds the SQL-statement invalid. When the table name is not correct, Toad would highlight the tablename.

My guess is that he is trying to execute it as a single statement while it is not separated from other statements.
There is no ; or / in the original post neither.

Regards,

Arian

Depends on your settings in TOAD, Mines goes RED Wink
Re: INSERT INTO [message #213600 is a reply to message #213598] Thu, 11 January 2007 07:16 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
@tahpush: but that's not the question! So, what do you think, why @OP can't INSERT into his/her table?
Re: INSERT INTO [message #213609 is a reply to message #213600] Thu, 11 January 2007 07:38 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member

i bet LF is right OP ...
Re: INSERT INTO [message #213611 is a reply to message #213609] Thu, 11 January 2007 07:52 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
I bet I don't use TOAD, and I'll even raise myself!
Re: INSERT INTO [message #213612 is a reply to message #213609] Thu, 11 January 2007 07:58 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

His Toad version is read only access Razz
Re: INSERT INTO [message #213629 is a reply to message #213612] Thu, 11 January 2007 10:15 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
/forum/fa/449/0/
Re: INSERT INTO [message #213646 is a reply to message #213479] Thu, 11 January 2007 12:36 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
I don't know TOAD, so it is pure speculation, but maybe OP is just not connected to a database yet.
I am trying to come up with some pretty far fetched ideas as all the good ones are taken already.
I have a bad feeling we may never find the answer.
Re: INSERT INTO [message #213729 is a reply to message #213646] Fri, 12 January 2007 01:16 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that I'm fourth one who lost his wager ... inserting SYSDATEs will hardly violate unique key constraint (unless there's a trigger which truncates it).

Flyboy, Alien and Joy Division are the only ones left at the moment.
Re: INSERT INTO [message #213893 is a reply to message #213441] Fri, 12 January 2007 12:49 Go to previous messageGo to next message
pradkuamr
Messages: 29
Registered: November 2006
Junior Member
I solved my issue
Re: INSERT INTO [message #213903 is a reply to message #213893] Fri, 12 January 2007 13:29 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
pradkuamr wrote on Fri, 12 January 2007 13:49
I solved my issue


Well why don't you share it with us?
Re: INSERT INTO [message #213904 is a reply to message #213903] Fri, 12 January 2007 13:30 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
joy_division wrote on Fri, 12 January 2007 14:29
pradkuamr wrote on Fri, 12 January 2007 13:49
I solved my issue


Well why don't you share it with us?

Yeah...there are a lot of bets on the line !!
Previous Topic: DATE
Next Topic: Query regarding Index?
Goto Forum:
  


Current Time: Tue Dec 03 05:55:28 CST 2024