Home » SQL & PL/SQL » SQL & PL/SQL » Code1 (Oracle 9i, win 2000)
Code1 [message #303725] Sun, 02 March 2008 07:19 Go to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Hi,

Can you decipher this? The file is attached and the following code is taken from the body of the type created in the file. I understand that bind variables are being used (:1,:2..) but

- what does this part do? or rather how does it work

- how can we insert 6 values into two column (sname_m and t_mname)

- why does the statement use . between columns as when executed it will be sname_m.tname_m

sqlstmt := 'insert into ' || sname_m ||'.' || tname_m 
  ||' select :1, ref(a),:3,:4,:5,:6 from ' || sname_m ||'.'||tname1_m || ' a  
  where a.advrtsr_c = :2 ' ; 
  execute immediate sqlstmt 
  using 
   pcampgn_c 
  ,padvrtsr_c 
  ,pcampgn_m 
  ,pmailstatus_i 
  ,pcampgndesc_x 
  ,pcampgnstatus_i 
  ; 


Note - u_advrtsr_ty is a type


- Das
Re: Code1 [message #303726 is a reply to message #303725] Sun, 02 March 2008 07:21 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
sorry for the file...here it is
  • Attachment: code.txt
    (Size: 1.46KB, Downloaded 93 times)
Re: Code1 [message #303737 is a reply to message #303726] Sun, 02 March 2008 09:23 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Check the Documentation for Native Dynamic SQL.
Previous Topic: Select in trigger - strange NO_DATA_FOUND
Next Topic: Code
Goto Forum:
  


Current Time: Sun Dec 04 06:36:21 CST 2016

Total time taken to generate the page: 0.05831 seconds