Ever_forEver Posted July 13, 2013 Report Posted July 13, 2013 table lo distinct columns on PLAN_ID theesukoni same table lo aaa particular PLAN_IDs ki different values insert cheyyali [b]ee table ni[/b] PLAN_ID 1 1001 default 2 1002 default 3 1003 default [b]I want like this[/b] PLAN_ID 1 1001 default 2 1002 default 3 1003 default 4 1001 choice 5 1002 choice 6 1003 choice please guys... 1 day nundi chastunnaa
dotnetrockz Posted July 13, 2013 Report Posted July 13, 2013 declare that 1st column as identity and insert
rondon Posted July 13, 2013 Report Posted July 13, 2013 primary_key only plan_id aithe u cannot insert into the table as u told
mukunda Posted July 13, 2013 Report Posted July 13, 2013 see the idea here is you make template of first table as second table, you insert values in the second table, you append them. try it.
Ever_forEver Posted July 13, 2013 Author Report Posted July 13, 2013 [quote name='mukunda' timestamp='1373758035' post='1303949221'] see the idea here is you make template of first table as second table, you insert values in the second table, you append them. try it. [/quote] okatee table bhayyaa.... same table lo new records insert cheyyali using particular column in that table
faf Posted July 13, 2013 Report Posted July 13, 2013 requirement sariga ardam kaaledu bhayya,, nuvvu insert cheyyalsina values already table lo unna value meeda dependent ga untaya,, konchem example unte cheppu.. will try
Darling999 Posted July 13, 2013 Report Posted July 13, 2013 [quote name='Ever_forEver' timestamp='1373757513' post='1303949200'] table lo distinct columns on PLAN_ID theesukoni same table lo aaa particular PLAN_IDs ki different values insert cheyyali [b]ee table ni[/b] PLAN_ID 1 1001 default 2 1002 default 3 1003 default [b]I want like this[/b] PLAN_ID 1 1001 default 2 1002 default 3 1003 default 4 1001 choice 5 1002 choice 6 1003 choice please guys... 1 day nundi chastunnaa [/quote] Dat depends on order which u r inserting. Neeku Ela insert chesinaaa adey order follow avvala?
Ever_forEver Posted July 13, 2013 Author Report Posted July 13, 2013 [quote name='faf' timestamp='1373758810' post='1303949239'] requirement sariga ardam kaaledu bhayya,, nuvvu insert cheyyalsina values already table lo unna value meeda dependent ga untaya,, konchem example unte cheppu.. will try [/quote] already PLAN_ID s evaitho vunnayo table lo malli ade same PLAN_IDs ki different values insert cheyyali select distinct PLAN_ID from PLAN_TABLE where PLAN_VALUE=3001 ila vachina PLAN_ID s ki insert into PLAN_TABLE values(primary_id, PLAN_ID(piana vachina distnct values), 3001(PLAN_VALUE), 'choice' (instead of default), expiration_date,...........)
Ever_forEver Posted July 13, 2013 Author Report Posted July 13, 2013 [quote name='DARLING...' timestamp='1373759055' post='1303949242'] Dat depends on order which u r inserting. Neeku Ela insert chesinaaa adey order follow avvala? [/quote] order emundi?... paina malli cheppa okasari choodu bhayya...
faf Posted July 14, 2013 Report Posted July 14, 2013 [quote name='Ever_forEver' timestamp='1373759566' post='1303949251'] already PLAN_ID s evaitho vunnayo table lo malli ade same PLAN_IDs ki different values insert cheyyali select distinct PLAN_ID from PLAN_TABLE where PLAN_VALUE=3001 ila vachina PLAN_ID s ki insert into PLAN_TABLE values(primary_id, PLAN_ID(piana vachina distnct values), 3001(PLAN_VALUE), 'choice' (instead of default), expiration_date,...........) [/quote] create a staging table, insert this plan_id, plan_value to that table. and insert all the other columns like 'choice, expiration_date' and all.. once done,, insert into main_table select * from staging_table chesey
Ever_forEver Posted July 14, 2013 Author Report Posted July 14, 2013 [quote name='faf' timestamp='1373761295' post='1303949281'] create a staging table, insert this plan_id, plan_value to that table. and insert all the other columns like 'choice, expiration_date' and all.. once done,, insert into main_table select * from staging_table chesey [/quote] maaku aa permission ledu bhayya tables create cheyyadaniki
raja8112 Posted July 14, 2013 Report Posted July 14, 2013 Create a temp table and insert from that table
faf Posted July 14, 2013 Report Posted July 14, 2013 [quote name='Ever_forEver' timestamp='1373762297' post='1303949297'] maaku aa permission ledu bhayya tables create cheyyadaniki [/quote] hmm,, then you can use a procedure.. get the required values into a cursor,, and then isert into your main table.. I think may be u will get mutation error,, but you can try it..
Recommended Posts