connect to SQL server from shell script


 
Thread Tools Search this Thread
Operating Systems Solaris connect to SQL server from shell script
# 1  
Old 12-15-2010
connect to SQL server from shell script

Hi all,

I need to connect to SQL server from shell script. Then need to execute queries from shell script as below
1. To compare values of an array with SQL table's entry.


Kindly let me know on how to do this

Thanks,

Moderator's Comments:
Mod Comment Double post. Continue here
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Not able to connect to Oracle server from shell script

Hi, I am facing an issue in connecting to database from Linux shell script. Here is my code export ORACLE_BASE=xxx export ORACLE_SID=xxx export ORACLE_HOME=xxxx DB_PATH=xxx/'yyy@yy' UserId=`sqlplus -s $DB_PATH <<EOF set head off feedback off select max(USER_ID)+1 from USERS;... (6 Replies)
Discussion started by: yuvi
6 Replies

2. AIX

Connect to a SQL server from AIX

Hello aix community, After scouring the internet to find a step by step process, I've exhausted my efforts. Although I have learned a lot which brings me to this forum. I'm totally new and hope to ask the right questions. What is the easiest way to connect to a SQL server from aix? ... (2 Replies)
Discussion started by: TechStudent36
2 Replies

3. Shell Programming and Scripting

Shell script to connect from one server to other

Dear Experts, I am new to the shell scripting. I am looking for a shell script to connect to one Unix/Linux server1 to other Unix/Linux server2 and trigger a SAP Event in that server2 (Which will trigger a job in SAP). Is this possible to connect from one server to the other server securely... (7 Replies)
Discussion started by: Venu V Reddy
7 Replies

4. Shell Programming and Scripting

how to Connect from ksh script to SQL server

I need to connect sql server 2008 from korn shell script. Can you please give me the script which connects sql server 2008 from korn shell script. (2 Replies)
Discussion started by: santoshhegde
2 Replies

5. Shell Programming and Scripting

connect to SQL server from shell script

Hi all, I need to connect to SQL server from shell script. Then need to execute queries from shell script as below 1. To compare values of an array with SQL table's entry. I am using solaris-5.1 to run shell script and want to connect to SQL-5.1 which is installed on SantOS. Kindly let... (3 Replies)
Discussion started by: amitbhelave
3 Replies

6. Shell Programming and Scripting

connect to SQL server from shell script

Hi all, I need to connect to SQL server from shell script. Then need to execute queries from shell script. Kindly let me know on how to do this Thanks, Ananthi.U (1 Reply)
Discussion started by: ananthi_ku
1 Replies

7. Shell Programming and Scripting

Shell Script to connect to another server and copying files

Hi Unix Gurus, I have a doubt reg file transfer. I have used the below script to connect to another server and find files having modified for the last 24 hours and have to move the file to another server. While i tried i am getting authentication failed, destination path not found issue. ... (2 Replies)
Discussion started by: incepted
2 Replies

8. Programming

How to write a shell script to connect to another server?

Hello friends I want to write a script in which I will connect to my friends network. I want to use SSH. Even they can use the script to log into my network and copy files. ssh user@hostname command I know the following command will help me to log into Google's servers and see all the... (12 Replies)
Discussion started by: Angelo
12 Replies

9. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

10. Solaris

Connect From VB to SQL Server

Dear All Now I can't connect from VB to Sybase on Unix. How could I do? Please help me. (0 Replies)
Discussion started by: Than Chanroeun
0 Replies
Login or Register to Ask a Question
SQL-ACCEPTABLE-BY-4D(3) 						 1						   SQL-ACCEPTABLE-BY-4D(3)

SQL acceptable by 4D - PDO and SQL 4D

	4D  implements	strictly  the  ANSI  89 standard, and have it enforced. It is highly recommended to read the 4D SQL documentation to learn
       about the available commands. The URL of the manual is : http://doc.4d.com/. Below is a list of 4D SQL characteristics: it is  not  exhaus-
       tive, but may serve as an introduction.

       Characteristics of 4D SQL

       +-------------------------------------+--------------------------------------+---+
       |	  Characteristics	     |					    |	|
       |				     |					    |	|
       |				     |		   Alternative		    |	|
       |				     |					    |	|
       |				     |		       Note		    |	|
       |				     |					    |	|
       +-------------------------------------+--------------------------------------+---+
       |	      INTEGER		     |					    |	|
       |				     |					    |	|
       |				     |	    Modify the SQL to use INT.	    |	|
       |				     |					    |	|
       |				     | INT is the supported integer type in |	|
       |				     | 4Dv12.0. 			    |	|
       |				     |					    |	|
       |		CHAR		     |					    |	|
       |				     |					    |	|
       |				     |	       Use VARCHAR instead.	    |	|
       |				     |					    |	|
       |				     |	      Unsupported in 4Dv12.0	    |	|
       |				     |					    |	|
       |	       UNION		     |					    |	|
       |				     |					    |	|
       |				     | Unsupported. Make separate queries.  |	|
       |				     |					    |	|
       |				     |	      Unsupported in 4Dv12.0	    |	|
       |				     |					    |	|
       |	   SELECT 1 + 1;	     |					    |	|
       |				     |					    |	|
       |				     |	 SELECT 1 + 1 FROM _USER_SCHEMAS;   |	|
       |				     |					    |	|
       |				     |		 FROM is required	    |	|
       |				     |					    |	|
       |	       FLOAT		     |					    |	|
       |				     |					    |	|
       |				     | Cast the FLOAT value into a FLOAT or |	|
       |				     | STRING,	with  an  SQL  4D  function |	|
       |				     | (CAST, ROUND, TRUNC or TRUNCATE)     |	|
       |				     |					    |	|
       |				     | Unsupported in current  versions  of |	|
       |				     | the PDO_4D driver		    |	|
       |				     |					    |	|
       |	   Strong typing	     |					    |	|
       |				     |					    |	|
       |				     | Take  care  your  SQL query, or your |	|
       |				     | PHP  code  provides  data  with	the |	|
       |				     | expected type			    |	|
       |				     |					    |	|
       |				     |	One  must  provide  the  right type |	|
       |				     | that 4D expect. One can't insert '1' |	|
       |				     | (as a string) in an INTEGER column.  |	|
       |				     |					    |	|
       |PDO.execute(row)(3)  : only works if |					    |	|
       |all the table's column are  of	type |					    |	|
       |TEXT or VARCHAR 		     |					    |	|
       |				     |					    |	|
       |				     | Use the prepared statements, and use |	|
       |				     | the right types. 		    |	|
       |				     |					    |	|
       |				     | The PDO extension  cast	all  values |	|
       |				     | through	execute()  as  string,	and |	|
       |				     | expect the SQL database to parse the |	|
       |				     | values.				    |	|
       |				     |					    |	|
       |       SELECT NULL FROM TABLE	     |					    |	|
       |				     |					    |	|
       |				     | Do  not	use NULL constants. Extract |	|
       |				     | them from the table		    |	|
       |				     |					    |	|
       |				     | It is not allowed to  use  the  NULL |	|
       |				     | constant in the select list	    |	|
       |				     |					    |	|
       |    SELECT * FROM TABLE WHERE 1      |					    |	|
       |				     |					    |	|
       |				     |		 Use WHERE 1 = 1	    |	|
       |				     |					    |	|
       |				     | A  constant can't be used in a WHERE |	|
       |				     | clause				    |	|
       |				     |					    |	|
       |	    SHOW TABLES 	     |					    |	|
       |				     |					    |	|
       |				     |		Use system tables	    |	|
       |				     |					    |	|
       |				     |	The list of tables, schemas, index, |	|
       |				     | etc.  are  in  these system tables : |	|
       |				     | _USER_TABLES,	     _USER_COLUMNS, |	|
       |				     | _USER_INDEXES,	 _USER_CONSTRAINTS, |	|
       |				     | _USER_IND_COLUMNS,   _USER_CONS_COL- |	|
       |				     | UMNS, and _USER_SCHEMAS. 	    |	|
       |				     |					    |	|
       |      SQL structure delimiter	     |					    |	|
       |				     |					    |	|
       |				     |	Use  the following function to pro- |	|
       |				     | tect    SQL    elements:    function |	|
       |				     | sqlEscapeElement(elem)  { return '[' |	|
       |				     | .  str_replace(']',']]',  $elem)   . |	|
       |				     | ']'; }				    |	|
       |				     |					    |	|
       |				     |	To   escape   SQL   elements  names |	|
       |				     | (tables,  fields,   users,   groups, |	|
       |				     | schema,	 primary  key,	etc.),	the |	|
       |				     | whole  identifier  must	be  between |	|
       |				     | square  brackets,  and  the  closing |	|
       |				     | brackets ']' must be doubled.	    |	|
       |				     |					    |	|
       +-------------------------------------+--------------------------------------+---+
PHP Documentation Group 												   SQL-ACCEPTABLE-BY-4D(3)