I need to save the result in variables or files with the same name ($SELECT_RESULT)
This sentence does not make any sense. Also your second and third queries are the same.
Please give a good clear example making it clear what is a file and what is a variable. Please make is clear whether any or all of them are different for each query.
You could combine the queries into one query:
Also personally I would use an Oracle "spool" command to write the results to a file (i.e. not a Shell redirect).
Hi-
I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment...
I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Hi,I have a single sql file containing many create table ddl's.Example:
CREATE TABLE sec_afs
(
rpt_per_typ_c char(1) NOT NULL,
rpt_per_typ_t varchar(20) NULL,
LOCK ALLPAGES
go
EXEC sp_primarykey 'sec_afs', rpt_per_typ_c
go
GRANT SELECT ON sec_afs TO developer_read_only... (5 Replies)
Is there anyway to spool my select statement into spool files of max 10000 records each?
eg I have a select statement that will return 45000 records.
A normal spool command will output the 45000 into just one spool file.
How can I make sqlplus do this?
00001 - 10000 records --- spool... (3 Replies)
Hi guys,
I am new on here, I have a function in oracle that returns a specific value:
create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete... (1 Reply)
Hi All,
Please help me to write a shell script to execute the below sql query.
select c.account_no,b.bill_no,a.pay_type,(b.total_due + b.recvd + b.adjusted + b.disputed + b.transferred) as amt_not_billed,d.cash_on_delivery,
(select j.bill_no from
billinfo_T y,
bill_t j
where... (1 Reply)
I am using HP-UX:
I have written a ksh script where I need to connect to sqlplus and execute few sql scripts. Part of this code is -
sqlplus user/temp1234 <<!
set serverout on
set feedback off
set pages 1000
set colsep ,
set echo off
spool /home/supp1/pks/output.csv... (8 Replies)
Hi,
I'm trying to build a shell script that reads a set of accounts from a file. For each account I need to perform a set of sql queries. So I have a loop with a set of sqlplus connections to retrieved my data.
Is it possible to have a single sqlplus connection before entering the loop and... (4 Replies)
Hi Experts:
I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks
any help would be appreciated
:wall: (1 Reply)
Hello ,
Im calling every single file inside my script like 1.sql,2.sql so on it looks so tedious. I want to replace with for loop where every file gets executed. When i use for loop im getting errorUnexpected EOF] , can anyone please help me out in this..
How i can use for loop to invoke my... (6 Replies)
Discussion started by: preethi87
6 Replies
LEARN ABOUT PHP
pdo_sqlsrv-dsn
PDO_SQLSRV-DSN(3) 1 PDO_SQLSRV-DSN(3)PDO_SQLSRV DSN - Connecting to MS SQL Server and SQL Azure databases
The PDO_SQLSRV Data Source Name (DSN) is composed of the following elements:
o DSN prefix
- The DSN prefix is sqlsrv:.
o APP - The application name used in tracing.
o ConnectionPooling - Specifies whether the connection is assigned from a connection pool (1 or TRUE) or not (0 or FALSE).
o Database - The name of the database.
o Encrypt - Specifies whether the communication with SQL Server is encrypted (1 or TRUE) or unencrypted (0 or FALSE).
o Failover_Partner - Specifies the server and instance of the database's mirror (if enabled and configured) to use when the primary
server is unavailable.
o LoginTimeout - Specifies the number of seconds to wait before failing the connection attempt.
o MultipleActiveResultSets - Disables or explicitly enables support for multiple active Result sets (MARS).
o QuotedId - Specifies whether to use SQL-92 rules for quoted identifiers (1 or TRUE) or to use legacy Transact-SQL rules (0 or
false).
o Server - The name of the database server.
o TraceFile - Specifies the path for the file used for trace data.
o TraceOn - Specifies whether ODBC tracing is enabled (1 or TRUE) or disabled (0 or FALSE) for the connection being established.
o TransactionIsolation - Specifies the transaction isolation level. The accepted values for this option are PDO::SQL-
SRV_TXN_READ_UNCOMMITTED, PDO::SQLSRV_TXN_READ_COMMITTED, PDO::SQLSRV_TXN_REPEATABLE_READ, PDO::SQLSRV_TXN_SNAPSHOT, and PDO::SQL-
SRV_TXN_SERIALIZABLE.
o TrustServerCertificate - Specifies whether the client should trust (1 or TRUE) or reject (0 or FALSE) a self-signed server cer-
tificate.
o WSID - Specifies the name of the computer for tracing.
Example #1
PDO_SQLSRV DSN examples
The following example shows how to connecto to a specified MS SQL Server database:
$c = new PDO("sqlsrv:Server=localhost;Database=testdb", "UserName", "Password");
The following example shows how to connect to a MS SQL Server database on a specified port:
$c = new PDO("sqlsrv:Server=localhost,1521;Database=testdb", "UserName", "Password");
The following example shows how to connecto to a SQL Azure database with server ID 12345abcde. Note that when you connect to SQL
Azure with PDO, your username will be UserName@12345abcde (UserName@ServerId).
$c = new PDO("sqlsrv:Server=12345abcde.database.windows.net;Database=testdb", "UserName@12345abcde", "Password");
PHP Documentation Group PDO_SQLSRV-DSN(3)