Re: Sybase Tutorial



Thanks for the information.
I would like to know, how can I execute the qurries in my local
machine.
I have cygwin installed in my machine, and tried to install sqsh.
But it does not get installed.
If anybody knows a better way to set up the environment on my windows
machine please let me know.

thanks
ria.

pokerdragon wrote:
> D_Peglow wrote:
> > ria_rohitraj@xxxxxxxxxxx schrieb:
> >
> > > I am new to this group and looking for a good tutorial to start with
> > > sybase. I would like to know about how to execute the queries within a
> > > script. Please help.
> >
> > There a several ways to do it.
> >
> > Some Unix-Shells Scripts:
> >
> > #!/bin/sh
> > isql -U<USER> -P<PASSWORD> <<SQL
> > SELECT *
> > FROM Table
> > GO
> > SQL
> > # End
> >
> > Or put yor query in a file query.sql
> >
> > #!/bin/sh
> > isql -U<USER> -P<PASSWORD> -i query.sql
> > # end
> >
> > Dietmar
>
> Some enhancements to Dietmar's ideas:
>
> To avoid confision... the "SQL" in the above isn't saying put your SQL
> here... it's a delimiter that tells the script the beginning and the
> end of the actual statement. You can put any delimiter here... I
> usually use an exclamation point.
>
> Some issues if security is a concern:
> Ideally, you'll create a password variable, and populate it with some
> other command that grabs it, encrypted, from some location before
> calling the ISQL. Then, instead of specifying the -P on the isql
> command line, put the password variable as the very first line of your
> SQL. Otherwise the password will appear plain text to anyone who does
> a 'ps' on the box while the isql is running.
>
> So you would have:
>
> #!/bin/sh
>
> ## Call some script to retrieve the password
> SYBASE_PW=`/somepath/.get_password`
>
> ## Execute the sql
> isql -Uuser -Sserver << ! >>
> $SYBASE_PW
> select * from table
> go
> !
>
> At the very least, if you don't have a password generation script and
> have to hard code the password into the script, put it within the isql
> as above so it doesn't show up when doing a 'ps', and set read access
> on the script to only those who should know the password.
>
> You could pass the password in on the command line, but again, doing
> this causes it to appear when doing a PS during the entire time the
> script is running (as opposed to only when the isql statements are
> running). If this is an interactive script you could prompt for the
> password of course.
>
> Just keep in mind that the password has to be on a line by itself as
> the first line if your sql statement inside of your delimiter ('!',
> 'SQL', or whatever else you choose).
>
> The method of passing in the sql with the -i option also works, but
> again with this option you allow the password to be clearly displayed
> on a 'ps' listing while the isql is running.
>
> -Mike

.



Relevant Pages

  • Re: Vista hosting XPe tools/db
    ... Are you running this script on the machine that actually has the SQL server ... machine hosting the database. ... i don't know if you can install a second instance of SQL ...
    (microsoft.public.windowsxp.embedded)
  • Re: Vista hosting XPe tools/db
    ... SQL Express isn't installing that should be there. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Yes - I'm running the script on a machine that has SQL 2005 Express SP1 ... Although I managed to install the SP1 database with no errors, ...
    (microsoft.public.windowsxp.embedded)
  • Re: Vista hosting XPe tools/db
    ... Yes - I'm running the script on a machine that has SQL 2005 Express SP1 ... All rights reserved. ... i don't know if you can install a second instance of SQL ...
    (microsoft.public.windowsxp.embedded)
  • Re: Sybase Tutorial
    ... the "SQL" in the above isn't saying put your SQL ... it's a delimiter that tells the script the beginning and the ... instead of specifying the -P on the isql ... command line, put the password variable as the very first line of your ...
    (comp.databases.sybase)
  • Re: Creating a VBScript to execute .SQL file
    ... > source and then open the SQL file to process the SQL commands. ... If the SQL client tools are installed on the machine that is running the ... can download and install the doc umentation from http://tinyurl.com/7rk6. ... client tools installation to run your script file. ...
    (microsoft.public.scripting.vbscript)