بتاريخ: 22 مارس 201016 سنة comment_187950 إلى أعضاء المنتدي الكراممحتاج مساعدة في شرح هذا الكودCopy specific columns (and rows) from one table to another: Insert into postables (postable_id, postable_name, dept, auth_name) VALUES( (Select postables_seq.nextval), (Select 'some static text' postable_name), (Select dept From cost_centres Where cc_code = 123), (Select auth_name From authorisers Where auth_code = 'Z5f') ) [b] -- The same as above written to select alias names:[/b] insert into postables (postable_id, postable_name, dept, auth_name) (select AA,BB,CC,DD from (Select postables_seq.nextval AA), (Select 'some static text' BB), (Select dept CC From cost_centres Where cc_code = 123), (Select auth_name DD From authorisers Where auth_code = 'Z5f')); تقديم بلاغ
بتاريخ: 23 مارس 201016 سنة كاتب الموضوع comment_188044 معقول الكود صعب لدرجة ديبس أعتقد انه مش بالصعوبة على محترفي أوركل بالموقع ولكن أعتقد أنهم مشغولين........... منتظر الردود تقديم بلاغ
بتاريخ: 31 مارس 201016 سنة comment_188738 1- First the insert statements must be wrote as next to run successfully: INSERT INTO postables (postable_id, postable_name, dept, auth_name ) VALUES ((SELECT postables_seq.NEXTVAL FROM DUAL), (SELECT 'some static text' postable_name FROM DUAL), (SELECT dept FROM cost_centres WHERE cc_code = 123), (SELECT auth_name FROM authorisers WHERE auth_code = 'Z5f') ); INSERT INTO postables (postable_id, postable_name, dept, auth_name) (SELECT aa, bb, cc, dd FROM (SELECT postables_seq.NEXTVAL aa FROM DUAL), (SELECT 'some static text' bb FROM DUAL), (SELECT dept cc FROM cost_centres WHERE cc_code = 123), (SELECT auth_name dd FROM authorisers WHERE auth_code = 'Z5f')); 2-It is no difference between the 2 statements, their job is one and its inserting rows into a table. تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.