database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
ㆍSybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Sybase Q&A 2309 게시물 읽기
No. 2309
간단한 셀 스크립트
작성자
초보
작성일
2008-10-14 08:40
조회수
8,911

 Unix HP상에서 IQ12의 SQL를 

in.sh파일로 만들어 실행할려고 합니다.



insert into xx

select * from xx_01


초보라서 in.sh 만 실행하면 SQL문이 실행되는 셀 작성방법좀알려주시면 감사하겠습니다.

자세히 알려주시면 더욱 감사하겠습니다.

이 글에 대한 댓글이 총 2건 있습니다.

isql -Usa -Pxxxx << __EOF

use db_name

go

insert into xx select * from xx_01

go

__EOF

를 in.sh로 저장후 chmod 777 in..sh를 한후 $in.sh 하거나

$sh in.sh로 실행하면 됩니다.


iq에서는 use db_name이 없지요 ???? (ASE 기준 입니다)

갈매기(갈매기)님이 2008-10-14 16:38에 작성한 댓글입니다.
이 댓글은 2008-10-14 16:39에 마지막으로 수정되었습니다.

출처 : http://www.ianywhere.com/developer/product_manuals/sqlanywhere/1000/en/html/dbdaen10/da-dbisqlc-interactive-dbutilities.html


dbisqlc [ options ] [ dbisqlc-command | command-file ]

Option  Description 
-c "keyword=value; ..." Supply database connection parameters. 
-d delimiter Use the given string as the command delimiter. 
-q Run in quiet mode?do not display messages or windows. (Note that this does not suppress error messages.) 
-x Syntax check only?no commands executed. 



Examples
The following command, entered at a command prompt, runs the command file mycom.sql against the current default server, using the user ID DBA and the password sql. If there is an error in the command file, the process terminates.

dbisqlc -c "UID=DBA;PWD=sql" mycom.sqlThe following command, when entered on a single line at a command prompt, adds a user to the current default database:

dbisqlc -c "UID=DBA;PWD=sql" GRANT CONNECT TO joe IDENTIFIED passwd


ㅇ 사용예 : 
   - 유닉스상에서 a.sh 파일을 만들고 다음 내용을 입력
      dbisqlc -c dsn=xxx -q sql파일명  (여기서 xxx는 위 설명처럼 연결 파라미터)

   - 파일실행: sh a.sh(또는 a.sh를 실행권한을 준후 a.sh를 직접 실행)

디비좋아님이 2008-10-17 13:08에 작성한 댓글입니다.
이 댓글은 2008-10-17 13:09에 마지막으로 수정되었습니다. Edit
[Top]
No.
제목
작성자
작성일
조회
2312update 후에 update 건수를 알려면 어떻게 하나요. [3]
권대욱
2008-10-20
7755
2311solaris9에 sybase 12.5.4 설치가 가능한지요?? [1]
solaris
2008-10-15
7184
2310sybase 처음 깔아서 일주일만에 연결 했을뿐이고..! [2]
구로머신
2008-10-15
7983
2309간단한 셀 스크립트 [2]
초보
2008-10-14
8911
2308Sybase SQL anywhere Database Engine 5.5 한글 깨짐 [1]
kaki104
2008-10-14
10193
2307컬럼의 크기를 늘릴려는데 안되네요. [2]
지나가다가
2008-10-10
7810
2306트랜잭션 처리시 @@ERROR코드 [1]
초보자
2008-10-09
7529
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.021초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다