Space constant

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • koos
    New Member
    • Feb 2008
    • 2

    Space constant

    Hi
    Is it good practice to declare a space constant (' ') and use it in a procedure? Does it make the execution faster??? Why would you do something like that?
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Please post your if any technical probelm in your source code for help from our experts.

    Are you facing any problem by using a space constant in a procedure in your real time applications??

    Comment

    • koos
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by amitpatel66
      Please post your if any technical probelm in your source code for help from our experts.

      Are you facing any problem by using a space constant in a procedure in your real time applications??
      No problem using it like this. I just want to know why you would do this.
      Is it not the same to say. Does the constant make it quicker?

      mySpace CONSTANT VARCHAR2(1) := ' ';
      begin
      select ....into x

      exeption
      no_data_found then
      x:= ' ';

      end;

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by koos
        Does it make the execution faster??? Why would you do something like that?
        Constant makes the execution faster ?

        There is nothing like that. Simply it is a variable whose value can't be changed during the execution of the program.

        Comment

        • subashsavji
          New Member
          • Jan 2008
          • 93

          #5
          Originally posted by amitpatel66
          Please post your if any technical probelm in your source code for help from our experts.

          Are you facing any problem by using a space constant in a procedure in your real time applications??

          once you declared any one of the variables constant so its value becomes constant through out the programme or project. you can not change it again
          so once you declared so once it is loaded in the memory.

          Comment

          • subashsavji
            New Member
            • Jan 2008
            • 93

            #6
            Originally posted by koos
            No problem using it like this. I just want to know why you would do this.
            Is it not the same to say. Does the constant make it quicker?

            mySpace CONSTANT VARCHAR2(1) := ' ';
            begin
            select ....into x

            exeption
            no_data_found then
            x:= ' ';

            end;
            in oracle ' ' is equal to null also. means you can assign value latter also if it is not constant.

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              Originally posted by subashsavji
              in oracle ' ' is equal to null also. ............... ....
              Who told you that ' ' = NULL

              If you do not have the knowledge of the subject ,please do not post wrong answers here.

              Comment

              • subashsavji
                New Member
                • Jan 2008
                • 93

                #8
                Originally posted by debasisdas
                Who told you that ' ' = NULL

                If you do not have the knowledge of the subject ,please do not post wrong answers here.

                i mean to say blank space by mistake i said null;

                you shoud talk politely. if it is your web site, you can ban me.
                do not speak roughly. ok..

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Originally posted by subashsavji
                  i mean to say blank space by mistake i said null;

                  you shoud talk politely. if it is your web site, you can ban me.
                  do not speak roughly. ok..
                  We spend our time to help others. There is no sence posting wrong answers here. I also don't claim to know everything. There are so many things i don't know. If there is any question and i don't know the answer, simply I don't reply to the thread or redirect to some helpful resource.

                  Comment

                  • subashsavji
                    New Member
                    • Jan 2008
                    • 93

                    #10
                    Originally posted by debasisdas
                    We spend our time to help others. There is no sence posting wrong answers here. I also don't claim to know everything. There are so many things i don't know. If there is any question and i don't know the answer, simply I don't reply to the thread or redirect to some helpful resource.

                    if someone sends the wrong answer, you should rectify it. but in a proper way.
                    dont use rash launguage. i am not an expert. sometimes we make mistake so we should rectify it in proper way. but answered me like you are an expert in oracle. and i made very big mistake. you can rectify me in proper way.
                    thank you

                    Comment

                    Working...