Topic
  • 5 replies
  • Latest Post - ‏2012-05-15T10:15:03Z by mor
DF5V_krishna_Bissa
DF5V_krishna_Bissa
42 Posts

Pinned topic why the files needed to save with .sql extension in db2

‏2012-05-13T14:13:34Z |
i am newbee to db2 ,even though its silly question to ask in forum but sill i need clear explanation on why the files needed to save with .sql extension in db2
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: why the files needed to save with .sql extension in db2

    ‏2012-05-13T18:07:15Z  
    Hi,

    I supposed you are talking about the files that you execute in DB2
    
    db2 -tvf fileToExecute.sql
    

    Well, they do not need to have a sql extension, it is just a convention that helps to recognize a file that contains sql commands.
    You can give any extension to this kind of files, however, many text editor recognize this convention and they put the formatting in a SQL fashion. But for DB2 it is not important.
  • DF5V_krishna_Bissa
    DF5V_krishna_Bissa
    42 Posts

    Re: why the files needed to save with .sql extension in db2

    ‏2012-05-14T05:02:07Z  
    Hi,

    I supposed you are talking about the files that you execute in DB2
    <pre class="jive-pre"> db2 -tvf fileToExecute.sql </pre>
    Well, they do not need to have a sql extension, it is just a convention that helps to recognize a file that contains sql commands.
    You can give any extension to this kind of files, however, many text editor recognize this convention and they put the formatting in a SQL fashion. But for DB2 it is not important.
    thanks for your reply .
    if i want to run the file which contains SQL statements from normal shell ,the file must contains .SQl extention ,here i wants to know why it so?
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: why the files needed to save with .sql extension in db2

    ‏2012-05-14T05:52:14Z  
    thanks for your reply .
    if i want to run the file which contains SQL statements from normal shell ,the file must contains .SQl extention ,here i wants to know why it so?
    No, what I said was that the extension is not important, you can give any name, even a filename without extension. At the end, this is a plain file, thus the important is the content, not the filename or extension.
    You can give any name, such as
    
    filename file.name.queries
    
  • DF5V_krishna_Bissa
    DF5V_krishna_Bissa
    42 Posts

    Re: why the files needed to save with .sql extension in db2

    ‏2012-05-14T17:01:20Z  
    No, what I said was that the extension is not important, you can give any name, even a filename without extension. At the end, this is a plain file, thus the important is the content, not the filename or extension.
    You can give any name, such as
    <pre class="jive-pre"> filename file.name.queries </pre>
    thanks for your time.file extensions does not matters. can you help me out in understanding redirect restore or sent me the link where i can get the clear idea on redirect restore.
  • mor
    mor
    577 Posts

    Re: why the files needed to save with .sql extension in db2

    ‏2012-05-15T10:15:03Z  
    thanks for your time.file extensions does not matters. can you help me out in understanding redirect restore or sent me the link where i can get the clear idea on redirect restore.
    If you are a newbie, you should remember one important thing: When you ask for help, always post for each question your DB2-server version and fixpack level, and the name+version of the Operating-System on which your DB2-server is running.

    If you don't give that information, people either will not reply, or may reply with the wrong answer.