All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
2answers
9k views

Oracle: spool data to different files depending on where condition (loop)

I am trying to get my way around something like this declare filename varchar2(100); begin for condition in (select fieldN from mytable) loop filename := 'data_for_value'||condition.fieldN||'...
2
votes
3answers
23k views

How in Oracle can I export package that will have package and body?

I'm using putty. How in Oracle can I export package and its body to a file in present directory using spool? Thanks
1
vote
2answers
4k views

Compile a PLSQL package code that was passed to an sqlplus session via a shell script?

I have two files: (1) and (2) (1) A Shell script - wrapper.sh #!/bin/sh echo "start of shell script" FILE_NAME="XX_PKGb.sql" sqlplus user/password @sql_deploy.sql $FILE_NAME echo "end of shell ...
0
votes
1answer
8k views

Does PL/SQL code run differently in sql plus vs sql developer?

Today, I stumbled upon a question someone posted about the / character and ; character. The Answer doesn't seem to be down-voted, so I questioned it a little more as to why it wasn't down-voted. ...
2
votes
2answers
5k views

SQLPLUS: SELECT INTO prompting for variable value

Any idea why this is prompting me for the value? I'm calling the script via batch file: DECLARE precount NUMBER; nowcount NUMBER; BEGIN SELECT COUNT(*) INTO precount FROM ...
0
votes
0answers
9k views

execute .sql script inside an anonymous pl/sql block which is invoked by a shell script

I got a shell script which connects to SQLPLUS and executes the .sql file like below: read a x=`echo $a | cut -d , -f 1` y=`echo $a | sed 's/.*,//'` c=`echo $USER | cut -c -2`"OPR"`echo $USER | ...
1
vote
1answer
2k views

Pass the unix variable to the ddl command inside a pl/sql block

I would like to create a db link dynamically, using the input given in the unix session. i.e. the remote db name and db instance would be given by the user, in unix, which are VAR1 and VAR2. Now, from ...
0
votes
1answer
582 views

Delete all types created by a user

In Oracle 10g, how do I delete all the types owned by a specific user? This is the view that gives me the types I want to drop:SELECT type_name FROM user_types;
3
votes
1answer
5k views

halt on error in a sqlplus script

I am deploying pl/sql code using several sql files that are called with @@file. If a package got a compilation error the script continues to the end. Is there a way to stop on every compilation error?...
16
votes
3answers
14k views

How to differentiate between SQL and PL/SQL?

I know the question might sound too stupid, but I never understood this part. SQL*Plus works with both SQL and PL/SQL. How do I know whether some code is SQL or PL/SQL? If my code has a for ...