|
|
|
|
|
Re: While inserting record i got error ORA-00903: invalid table name [message #636556 is a reply to message #636555] |
Tue, 28 April 2015 02:42 |
|
pandilakshmanan1989@gmail
Messages: 3 Registered: April 2015 Location: chennai
|
Junior Member |
|
|
Hi team,
i try to insert p_id,'pandi','laksh' to test_link table. i have to get p_id from another table called p_link_count, so i using subquery. but while run below query i getting error.
could anybody assist me whether i have done any mistake with this query?
INSERT INTO TEST_LINK(h_id,h_person_id,pr_code)
(SELECT P_ID FROM P_LINK_COUNT,'PANDI','laksh')
;
Error starting at line : 99 in command -
INSERT INTO TEST_LINK(hie_id,hie_person_id,practice_code)
(SELECT PATIENT_ID FROM PATIENT_LINK_COUNT,'PANDI','laksh')
Error at Command Line : 100 Column : 54
Error report -
SQL Error: ORA-00903: invalid table name
00903. 00000 - "invalid table name"
*Cause:
*Action:
Thanks in advance
|
|
|
Re: While inserting record i got error ORA-00903: invalid table name [message #636557 is a reply to message #636554] |
Tue, 28 April 2015 02:45 |
|
Michel Cadot
Messages: 68641 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
You didn't read Littlefoot's answer, did you?
Or you are just unable to read?
Don't you see the difference between (I format Littlefoot's query like yours):
INSERT INTO TEST_LINK(h_id, h_person_id, pr_code)
(SELECT P_id, 'P', 'l' FROM P_LINK_COUNT)
;
INSERT INTO TEST_LINK(h_id,h_person_id,pr_code)
((SELECT P_ID FROM P_LINK_COUNT),'PANDI','laksh')
;
|
|
|
|
Re: While inserting record i got error ORA-00903: invalid table name [message #636566 is a reply to message #636556] |
Tue, 28 April 2015 05:36 |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
Maybe, before any attempt of calling INSERT statement (or any other one), you should get acquainted with its syntax.
Some good guys from Oracle already did that job of writing it down and it is available in the documentation, e.g. online on http://docs.oracle.com/en/.
I recommend you to open SQL Language Reference book for your Oracle version.
In fact, there are two INSERT statement variants:
INSERT INTO <table_name> (<column_list>) <select_query>; or
INSERT INTO <table_name> (<column_list>) VALUES (<expression_list>);
Your attempt does not meet any of them (note the keyword VALUES in the second case).
|
|
|