in the created sql query i need to add two static table v_prt_class and v_vmf_class in all the query as i need to extract one attribute from each of these two tables,
condition here is if v_prt_class part of the it should not duplicate
If u take the first output it does not contain V_PRT_CLASS table in the query, if u take 3rd output it contains V_PRT_CLASS table.
new sqlquery for the 3rd output should be
Code:
select a.v_prt_nbr, b.v_vmf_name, c.V_MOUNT_FEATURE, d.V_TECHNOLOGY, a.V_MFR_PKG_DESC from v_prt_class a, v_vmf_class b, V_RES_CLASS c, V_RES_NW_CLASS d where c.V_MOUNT_FEATURE='SURFACE MOUNT' and d.V_TECHNOLOGY NOT LIKE 'CARBON%' and a.V_MFR_PKG_DESC LIKE 'DIP%' and a.obj_id=c.obj_id and c.obj_id=d.obj_id and a.V_PRT_MFG_PTR=b.obj_id;
here a.obj_id=c.obj_id and c.obj_id=d.obj_id and a.V_PRT_MFG_PTR=b.obj_id; is a static line
for 1st output
Code:
select a.v_prt_nbr, b.v_vmf_name, c.V_MOUNT_FEATURE, d.V_TECHNOLOGY from v_prt_class a, v_vmf_class b, V_RES_CLASS c, V_RES_NW_CLASS d where c.V_MOUNT_FEATURE='SURFACE MOUNT' and d.V_TECHNOLOGY LIKE 'CARBON%' and a.obj_id=c.obj_id and c.obj_id=d.obj_id and a.V_PRT_MFG_PTR=b.obj_id;
Instead of writing the output to terminal I need to write it to some output file, Also I need to retain clolumn 1 ,7 and 8 along with the corresponding query.
Last edited by Franklin52; 07-07-2011 at 03:23 AM..
Reason: Please use code tags for code and data samples, thank you
I have a script that looks for all jobs that contain a particular calendar.
Some of the calendars have '&' in them and sql freaks out when it encounters that.. is there a way around this?
I have tried:
select job_name from job where run_calendar='1&15dom'
select job_name from job... (3 Replies)
Hi ...
I am doing a switch user and then rsh and then running a sql query .
I am successfull in rsh and logging into the database , but my query doesnt run ..
Here's the command :
su - linus -c "rsh -l linus psmf ORACLE_SID=SMP;export ORACLE_SID;sqlplus... (1 Reply)
Hello Everyone,
I am looking to write a script that will run on many machines in a network at the same time. They need to write a result to a common location. I plan to use a SQLlite database as this common writing point. But the concern I have is how SQLlite will react to multiple writes that... (1 Reply)
Hi,
I am passing an argument for the script and that argument values should exist in database.
bill_period_input="'""$1""'"
bill_period=`sqlplus uname/pwd@dbname <<eof!
set verify off
set heading off
set feedback off
select bill_period from bill_period_ref where... (4 Replies)
Hi ,
I used the below script to get the sql data into csv file using unix scripting.
I m getting the output into an output file but the output file is not displayed in a separe columns .
#!/bin/ksh
export FILE_PATH=/maav/home/xyz/abc/
rm $FILE_PATH/sample.csv
sqlplus -s... (2 Replies)
I used the following code
code
select * from tablename where columnname
Instead of printing the expected output it prints all the files in the present directory since there is a "*" in the code. Is there any way to overcome the problem?
Thanks
Ananth (2 Replies)
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Hi All ,
I have tried many times am getting syntax error on 'UNION'
can anybody tell me ...
INSERT INTO table1
(
Type
, num_items
, num_letters
, total_value
)
(select
type='1',
num_items,
num_letters=count(*),
total_value=sum(letter_value)
from
table2
where
num_items = 1 (1 Reply)
Hello All,
I hope I'm posting this in the right section.
I have zero sql query writing skill, in fact, I've never done it before, but for some reason, a request came across my desk to get information from one of our databases. I have about 200 ticket numbers that have no information attached,... (8 Replies)
Hi
I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query
select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p
inner join v$session se on p.addr = se.paddr
inner join
( select... (2 Replies)
Discussion started by: tharmendran
2 Replies
LEARN ABOUT MOJAVE
fsgetpath
FSGETPATH(2) BSD System Calls Manual FSGETPATH(2)NAME
fsgetpath -- get the path associated with filesystem node identifier (inode number/link id/object id)
SYNOPSIS
#include <sys/attr.h>
#include <sys/fsgetpath.h>
ssize_t
fsgetpath(char * restrict_buf, size_t buflen, fsid_t * fsid, uint64_t obj_id);
DESCRIPTION
The fsgetpath() function returns the path in a caller provided buffer restrict_buf of length indicated by buflen associated with a filesys-
tem object identified by fsid and obj_id. fsid is a pointer to a structure which identifies a filesystem to which the object belongs. It is
obtained by the value returned for ATTR_CMN_FSID in a previous call to getattrlist(2) or the f_fsid field of the statfs structure returned by
statfs(2). obj_id can be any one of of a object identifier i.e. ATTR_CMN_FILEID returned by getattrlist(2) or st_ino field of the stat
structure returned by stat(2) or a link id returned in ATTR_CMNEXT_LINKID by a previous call to getattrlist(2). Using a linkid will result
in a more accurate path in case the filesystem object is a hard link. If a inode number is passed and the object is a hard link, any one of
the multiple paths to that filesystem object may be returned.
RETURN VALUES
Upon successful completion, fsgetpath() returns the path length. Otherwise, a value of -1 is returned and errno is set to indicate the error.
COMPATIBILITY
Not all volumes support fsgetpath(). A volume can be tested for fsgetpath() support by using getattrlist(2) to get the volume capabilities
attribute ATTR_VOL_CAPABILITIES, and then testing the VOL_CAP_FMT_PATH_FROM_ID flag.
ERRORS
The fsgetpath() function will fail if:
[EACCES] Read permissions are denied on any component of the pathname.
[ENOTSUP] The underlying filesystem does not support this call.
[EINVAL] buflen is larger than PAGE_SIZE
[EIO] An I/O error occurred while reading from the file system.
[EPERM] The calling process does not have appropriate privileges.
[ENOENT] The Filesystem object does not exist.
[EFAULT] restrict_buf points to memory not valid in the callers address space.
[ENOSPC] restrict_buf is not large enough to hold the path.
SEE ALSO getattrlist(2)statfs(2)stat(2)HISTORY
The fsgetpath() function call appeared in macOS version 10.13
Darwin July 27, 2017 Darwin