10-30-2009
Quote:
Originally Posted by
SFNYC
This question is best answered in an Oracle Forum such as
OTN Discussion Forums : SQL and PL/SQL
You should also:
- Post the code
- Tell us what environment you are running under (Linux/Windows?)
- What is the version of Oracle you are running (8, 9, 10, 11?)
- Look into using the MERGE statement
- Oracle is rarely wrong about UNIQUE constraints. If it says it has one, it's probably right and it is a logic bug.
- Try dumping the values of your bind variables
Sam
I posted the part of code where i know the error is produced... I working Under SuSe Linux enterprise 10, with Perl 5.8 against Oracle 10gR2.
As i said, I know that in my process can be inserts of duplicated values for de primary key, but i handle the error trying an update instead... that's suppose to be the right logic. I cannot make a MERGE couse i'm inserting calculated variables in columns each LOOP.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I am using sqlplus.
I have the stored procedure name.
How can i print the stored procedure content? (2 Replies)
Discussion started by: kamil
2 Replies
2. Shell Programming and Scripting
Hi:
How will I execute a Stored Procedure that sits on NT/SQLServer.
Any help would be appreciated.
Thanks (3 Replies)
Discussion started by: mayohan
3 Replies
3. Shell Programming and Scripting
Hi,
Can anyone help me with the correct syntax to call a MYSQL stored procedure from a shell script.
I have tried the following, (no input params):
/usr/bin/mysql -uadmin -ppassword call TL_CLENSEDATA();
resulting in error:
/home/hosting/data/scripts/dbclense.sh: line 12: syntax error... (3 Replies)
Discussion started by: kshelluser
3 Replies
4. Shell Programming and Scripting
Hi GUYS,
I need to trigger 3 stored procedure at the same time..
I know how to trigger the stored procedure. If anybody can tell me how to trigger 3 different process at the same time parallelly.. that would be helpful..
Thanks for your help in advance,
Magesh (1 Reply)
Discussion started by: mac4rfree
1 Replies
5. Programming
Hi,
Can anyone please let me know where to check if a particular stored procedure exists.
If the procedure exists I want to display some message and if the procedure does not exists i want to exit with error message.
checking from dba_objects doesnt help. suprisingly the procedure i... (3 Replies)
Discussion started by: justchill
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
My stored procedure returns a value.
How to retrieve the value and display in unix.
Stored procedure
CREATE OR REPLACE
PROCEDURE gohan(num INT) IS
BEGIN
DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num);
END;
Unix Scripting i used
sqlplus -s... (7 Replies)
Discussion started by: gohan3376
7 Replies
7. Shell Programming and Scripting
Hi,
I want to create MySQL stored procedure and call the stored procedure using perl.
I tried like this:
use DBI;
my $dbh = DBI->connect ("DBI:mysql:test",
"root", "ibab",
{ RaiseError => 1, PrintError => 0});
$create_procedure =... (5 Replies)
Discussion started by: vanitham
5 Replies
8. UNIX for Advanced & Expert Users
Hi,
I am looking for a script wherein i will be able to execute below procedures one by one in line and next procedures starts only when the previous one completes and also after execution of each procedure i will be getting a automted mail as "PL/SQL PROCEDURE SUCCESSFULLY EXCETUTED".
... (1 Reply)
Discussion started by: sv0081493
1 Replies
9. Shell Programming and Scripting
below code is not executing the stored procedure,not sure what the issue.Even sqllog is blank.please help me its very urgent.
sqlplus -s $connect_str@$DB_ORACLE_SID >> ${SQL_LOG_FILE} << EOF
set serverout on
set feed off
set head off
set pages 0
set colsep ,
set tab off
set lin 150... (3 Replies)
Discussion started by: katakamvivek
3 Replies
10. Solaris
Am trying to install a account script in oracle 8i and I keep getting ORA-00001: unique constraint violated as the screen shot below shows so am wondering how do i fix this i have posted the full code that is the issue.
i hope some one can help me, thanks a lot
http://www.livve.com/sqlbug.jpg... (2 Replies)
Discussion started by: Wpgn
2 Replies
LEARN ABOUT DEBIAN
sql::translator::schema::constraint
SQL::Translator::Schema::Constraint(3pm) User Contributed Perl Documentation SQL::Translator::Schema::Constraint(3pm)
NAME
SQL::Translator::Schema::Constraint - SQL::Translator constraint object
SYNOPSIS
use SQL::Translator::Schema::Constraint;
my $constraint = SQL::Translator::Schema::Constraint->new(
name => 'foo',
fields => [ id ],
type => PRIMARY_KEY,
);
DESCRIPTION
"SQL::Translator::Schema::Constraint" is the constraint object.
METHODS
new
Object constructor.
my $schema = SQL::Translator::Schema::Constraint->new(
table => $table, # table to which it belongs
type => 'foreign_key', # type of table constraint
name => 'fk_phone_id', # name of the constraint
fields => 'phone_id', # field in the referring table
reference_fields => 'phone_id', # referenced field
reference_table => 'phone', # referenced table
match_type => 'full', # how to match
on_delete => 'cascade', # what to do on deletes
on_update => '', # what to do on updates
);
deferrable
Get or set whether the constraint is deferrable. If not defined, then returns "1." The argument is evaluated by Perl for True or False,
so the following are eqivalent:
$deferrable = $field->deferrable(0);
$deferrable = $field->deferrable('');
$deferrable = $field->deferrable('0');
expression
Gets and set the expression used in a CHECK constraint.
my $expression = $constraint->expression('...');
is_valid
Determine whether the constraint is valid or not.
my $ok = $constraint->is_valid;
fields
Gets and set the fields the constraint is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the
field names and keep them in order by the first occurrence of a field name.
The fields are returned as Field objects if they exist or as plain names if not. (If you just want the names and want to avoid the Field's
overload magic use field_names).
Returns undef or an empty list if the constraint has no fields set.
$constraint->fields('id');
$constraint->fields('id', 'name');
$constraint->fields( 'id, name' );
$constraint->fields( [ 'id', 'name' ] );
$constraint->fields( qw[ id name ] );
my @fields = $constraint->fields;
field_names
Read-only method to return a list or array ref of the field names. Returns undef or an empty list if the constraint has no fields set.
Useful if you want to avoid the overload magic of the Field objects returned by the fields method.
my @names = $constraint->field_names;
match_type
Get or set the constraint's match_type. Only valid values are "full" "partial" and "simple"
my $match_type = $constraint->match_type('FULL');
name
Get or set the constraint's name.
my $name = $constraint->name('foo');
options
Gets or adds to the constraints's options (e.g., "INITIALLY IMMEDIATE"). Returns an array or array reference.
$constraint->options('NORELY');
my @options = $constraint->options;
on_delete
Get or set the constraint's "on delete" action.
my $action = $constraint->on_delete('cascade');
on_update
Get or set the constraint's "on update" action.
my $action = $constraint->on_update('no action');
reference_fields
Gets and set the fields in the referred table. Accepts a string, list or arrayref; returns an array or array reference.
$constraint->reference_fields('id');
$constraint->reference_fields('id', 'name');
$constraint->reference_fields( 'id, name' );
$constraint->reference_fields( [ 'id', 'name' ] );
$constraint->reference_fields( qw[ id name ] );
my @reference_fields = $constraint->reference_fields;
reference_table
Get or set the table referred to by the constraint.
my $reference_table = $constraint->reference_table('foo');
table
Get or set the constraint's table object.
my $table = $field->table;
type
Get or set the constraint's type.
my $type = $constraint->type( PRIMARY_KEY );
equals
Determines if this constraint is the same as another
my $isIdentical = $constraint1->equals( $constraint2 );
AUTHOR
Ken Youens-Clark <kclark@cpan.org>.
perl v5.14.2 2012-01-18 SQL::Translator::Schema::Constraint(3pm)