stgreSQL (opensource)
>
> Eric
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 2:21 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Query with return value
>
>
> Eric,
PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Query with return value
Eric,
PL/SQL (Procedural Language SQL) is an Oracle product. It allows you to make
a script that combines a lot of rudimentary procedural language stuff with
sql statements. So you can create variables, arrays
Oh ... my database is PostgreSQL (opensource)
Eric
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 2:21 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Query with return value
Eric,
PL/SQL (Procedural
Audet [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 1:31 PM
To: '[EMAIL PROTECTED]'; Eric, Audet; [EMAIL PROTECTED]
Subject: RE: Query with return value
Oh ... no, I am not familiar with this style ... Where can I find some
documents with examples on this?
Eric
-Origi
Oh ... no, I am not familiar with this style ... Where can I find some
documents with examples on this?
Eric
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 1:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Query with return
Eric,
Do you realize that you can put all sorts of pl/sql stuff into a DBI cursor?
You could do both of your inserts within one cursor, greatly simplifying
things.
Try something like this:
my $insertCursor = q {
DECLARE custId number(8);
BEGIN
SELECT cust
How about currval?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 1:03 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Query with return value
This is really an oracle specific question I think:
In a before insert trigger
This is really an oracle specific question I think:
In a before insert trigger on your table add the following:
select customer_custid_seq.nextval into :new.custid from dual;
You can also do the equivalent in DBI... but I prefer a trigger for
this kind of thing.
Lincoln
-Original Message-
If I were you I would not define custid as a function default, but rather
call it separatelly, therefore you can run a select on dual first, retrieve
the value and then proceed with transaction. You can then roll or commit
the rest of the queries, other than nextval, since that can't be rolled
ba