We want to check where our programmers are using lowercase SQL reserved words, ie "select" instead of "SELECT".
Obviously, we should not raise a warning for code which is commented out with "//".
Suppose I have this input:
So the following code does not work, because it does not return the last line:
How do I change the expression so that lines with lowercase "select" are returned and which are not preceded by "//"?
Hello
#!bin/ksh
sqlplus -s system/manager < |grep '^ORA' |uniq
select * from kk;
set echo on
show spool on
end;
/
EOF
save test.sh
sh test.sh
results
ORA-00942: table or view does not exist (3 Replies)
Greetings & Happy New Years To All!
A client of mine FTP'ed their files up to the server and it all ended up being in UPPERCASE when it all should be in lowercase. Is there a builtin command or a script anyone knows of that will automagically convert all files to lowercase?
Please advise asap... (4 Replies)
Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
... (7 Replies)
Hello again... I have a request from another department to list for them all the columns and tables we use in this certain database. I have spooled the oracle stored procedured into 1 file. I need a way to write out parts of that file. The criteria is to to start the block to be written when... (0 Replies)
Hi,
Iam new to unix. Is there any way to get the sql code "ORA-01847" into a variable.
sqlplus username/password@database name << EOF
set heading off
update TempTable set variable where condition;
exit sql.sqlcode;
commit;
exit;
EOF
Output
ERROR at line 1:
ORA-01847: day of... (1 Reply)
Hi expert,
I have a script which is connecting with sql internally, fetch same data, store it in a file and then from os I cat this file and sending it to mail (windows outlook).
This is working fine, I just need to know wether we can add some html codes with the sql query like we can add... (0 Replies)
Hi Guys :)
need your help once again
I have some files from which I have to fetch the SQL CODE which in anywhere in file. please help me
input files : file1 :
ERROR ON SECTION : 2060-GET-OTHER-DEP-INFO
ERR MSG : ERROR IN FETCH MCURS
SQL CD : 100 SUBS ID : 153687143
input... (5 Replies)
Hello,
I have a list of files in a directory whose names are all in uppercasse, including the file format for eg *.MP3 . I would like to convert these to the normal way we write it ie ABC.MP3 to be converted to Abc.mp3 . I know that this can be done manually by using a lot of "mv" or rename... (6 Replies)
Hi
i need code to get sql queries through a shell script for a text file input which contain the service ids
iputfile
I-H-2048-10GB-M
I-H-4096-12GB-M
I-H-2048-p1000-M
the code should contain below queries among which service_id is replacable with value from input file.
... (4 Replies)
Spotting Aggressive Clandestine BotNets
"Yesterday was making a typical “evening run” in cyberspace and noticed a strange pattern, zoomed in, and found a aggressive clandestine “indexing” botnet operating out of a dedicated hosting provider’s datacenter. The feature image in this post shows a... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT PHP
oci_set_client_identifier
OCI_SET_CLIENT_IDENTIFIER(3)OCI_SET_CLIENT_IDENTIFIER(3)oci_set_client_identifier - Sets the client identifierSYNOPSIS
bool oci_set_client_identifier (resource $connection, string $client_identifier)
DESCRIPTION
Sets the client identifier used by various database components to identify lightweight application users who authenticate as the same
database user.
The client identifier is registered with the database when the next 'roundtrip' from PHP to the database occurs, typically when an SQL
statement is executed.
The identifier can subsequently be queried, for example with SELECT SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER') FROM DUAL. Database admin-
istration views such as V$SESSION will also contain the value. It can be used with DBMS_MONITOR.CLIENT_ID_TRACE_ENABLE for tracing and can
also be used for auditing.
The value may be retained across page requests that use the same persistent connection.
PARAMETERS
o $connection
-An Oracle connection identifier, returned by oci_connect(3), oci_pconnect(3), or oci_new_connect(3).
o $client_identifier
- User chosen string up to 64 bytes long.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Setting the client identifier to the application user
<?php
// Find the application user's login name
session_start();
$un = my_validate_session($_SESSION['username']);
$c = oci_connect('myschema', 'welcome', 'localhost/XE');
// Tell Oracle who that user is
oci_set_client_identifier($c, $un);
// The next roundtrip to the database will piggyback the identifier
$s = oci_parse($c, 'select mydata from mytable');
oci_execute($s);
// ...
?>
NOTES
Caution
Roundtrip Gotcha
Some but not all OCI8 functions cause roundtrips. Roundtrips to the database may not occur with queries when result caching is
enabled.
SEE ALSO oci_set_module_name(3), oci_set_action(3), oci_set_client_info(3).
PHP Documentation Group OCI_SET_CLIENT_IDENTIFIER(3)