Results 1 to 5 of 5

Thread: an interesting topic

  1. #1
    Contributing Member
    Join Date
    Apr 2006
    Answers
    46

    an interesting topic

    when to use dynamic sql rather than static sql

    if answer is

    in static sql one hve a fixed sql statement but where in dynamic sql u can build sql statements as charecter string at run time

    den wat is the difference between ref cursor and dynamic sql




  2. #2
    Contributing Member
    Join Date
    Sep 2007
    Answers
    35

    Re: an interesting topic

    in normal PL/SQL block it will allow only DML statements to execute.if we are executing other than DML like DDL(CREATE ,ALTER ,DROP),DCL(GRANT,REVOKE) AND SESSION CONTROL LANGUAGE(CREATE SESSION) it will come out from the block and gives an error.
    by using dynamic sql we can execute DDL ,DCL,SESSION CONTROL langueges.this is one advantage of dynamic sql.


  3. #3
    Contributing Member
    Join Date
    Apr 2006
    Answers
    46

    Re: an interesting topic

    Quote Originally Posted by ashalalaxmi2002 View Post
    in normal PL/SQL block it will allow only DML statements to execute.if we are executing other than DML like DDL(CREATE ,ALTER ,DROP),DCL(GRANT,REVOKE) AND SESSION CONTROL LANGUAGE(CREATE SESSION) it will come out from the block and gives an error.
    by using dynamic sql we can execute DDL ,DCL,SESSION CONTROL langueges.this is one advantage of dynamic sql.
    question is not advantage of dynamic sql but in such case i mentioned which is appropriate?


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: an interesting topic

    Quote Originally Posted by bhaski View Post
    question is not advantage of dynamic sql but in such case i mentioned which is appropriate?
    Use dynamic sql when the anme of the objects are not known in advance and passed only at runtime.


  5. #5

    Re: an interesting topic

    use the execute immediate statement to do ddl statement in oracle


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact