Uderc programming article aggregator sites
Index -> anonymous block in mysql example

anonymous block in mysql example

Advertisement

Select after anonymous blocks no INTO allowed

hi I need to run an EXECUTE IMMEDIATE command to create a SEQUENCE in oracle sql 10g. I can only call EXECUTE IMMEDIATE between a BEGIN and a END; thus creating an anonymous block after the EXECUTE I need to do a select the problem is I get an error

INVALID CURSOR - Anonymous Block calling Cursor in function

I am getting an error when trying to call my cursor. CREATE OR REPLACE PACKAGE tax_update AS TYPE gencur IS ref cursor; FUNCTION tax_sf    p_state IN bb_tax.state%type,    p_thecursor IN OUT gencur RETURN NUMBER; END; CREATE OR REPLACE PACKAGE BODY t

Reference value of an SQLPLUS variable in a PL/SQL anonymous block

All, Is there a way of referencing an SQLPLUS variable within a PL/SQL anonymous block. See my example below........ sqlplus -s /@${L_DB_SID} <<-ENDOFSQL >> ${L_LOGFILE} SET FEEDBACK OFF SET PAGES 0 SET SERVEROUTPUT ON WHENEVER SQLERROR EXIT S

How to declare in anonymous block

Declare CURSOR c_je2acct_othr IS SELECT j.jemq_num, j.ml_retail_account, -- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04 /* Commented 02/01/07*/ (CASE WHEN j.exer_type = 4 THEN

Cursor query works in anonymous block but not in procedure

Hello, My cursor query works fine in anonymous blcok but fails in pl/sql block. Anonymous block: declare cursor c1 is select object_name from all_objects where owner='IRIS_DATA' and object_type='SEQUENCE'; v_string varchar2(2000); begin for c2 in c1

Getting value with an anonymous block using ODP

Hi all! I have a problem I hope someone can help me with. I believe it to be a minor one. I am trying to imbed an anonymous block into my .net app and use it dynamically to get a value from the database depending on the values in a tables. Since my p

Performance problem due to anonymous blocks

Hi, One of the users on our database has created a procedure consisting of many blocks like the one given below: begin select func1(var1,var2,var3)into vcompvalue from dual; if vcompvalue < 0 then vcompvalue := 0; end if;      exception when no_data_

Printing the Package output from Anonymous block

Hi, I need to call the below package from anonymous block and get the output. Could you let me know. I tried using this, but i don't get data. ===========Anonymous Block===================================================================== declare var

Error in Stoerd Procedure But working in Anonymous Block.

declare           Cursor Cur Is      Select 'Alter '||Object_Type||' '||Object_Name||' Compile' Invalid_Obj, Object_Type, Object_Name      From Dba_Objects A      Where A.Owner='Dataload' And A.Status='Invalid' ; Begin      For I In Cur      Loop    

Handling loop exception in an anonymous block

hI , I have a an anonymous block declare cursor local variables begin open cursor some statements loop some statement ; some othet statement; select something from sometablein local variable where some field = cursor.value ; some more statements end

How to use anonymous block in select statement

Hello Experts. I have one requirement which i can resolve using anonymous block in plsql. But i want implement it in select query only. Database: Oracle 11.2.0 select count(*) from emp where name='xyz' and sal=50 if count(*)>0 then select dept,sector

Oracle SQL Developer 3.0: PL/SQL debugging of anonymous blocks: ISSUES

Hello, I just downloaded the Oracle SQL Developer 3.0. I have been using the EA releases as they came into existence and was happy to see the released version. So I immediately tried to debug an anonymous block (something I did not try to do in the E

Can select resource content in anonymous block, but not in stored procedure

I know the problem relates to the ACLs but am curious about the following behaviour: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for 32-bit Windows: Version 10

Calling PL/SQL anonymous block from href in tabular report

apex 2.2. I've got a tabular report where I've added some img columns with a href to call diff processes for example "<a href="f?p=&APP_ID.:22:&APP_SESSION.:BRANCH_TO_PAGE_ACCEPT|NEW_PROXY:NO:::22,ABCDEF ><img src="/i/asyl.

Autonomous Transactions usage in PL/SQL anonymous block coding

Hi, I am trying to incorporate Autonomous Transaction for our work. I am using the tables provided below, CREATE TABLE T1 F1 INTEGER, F2 INTEGER CREATE TABLE T2 F1 INTEGER, F2 INTEGER insert into t1(f1, f2) values(20, 0) insert into t2(f1, f2) values

Calling a function which has a CLOB parameter via an anonymous block.

OK, we are moving a lot of exports currently done by Crystal to just be done by stored procs. So we have a load of existing, some extremely length SQL statements used for these exports. IN the exports, we have meaningful column headings, so we have a

Ref cursor from anonymous block

I have no problem to get a ref cursor from a Fill method call with an anonymous pl/sql block. But if my anonymous block contains a DECLARE section, the dataset is not populated. ex: BEGIN OPEN :cuInscription FOR SELECT column FROM table; END; is ok b

PL anonymous block does everything, but then gets stuck

We have a PL/SQL block that loops through a cursor, and inserts data into another table. We're having a strange issue with it... Every single line of code within it appears to function correctly... It does everything we want it to. The last line on i

Using Create table command in a Pl/Sql Anonymous Block

Hi, I need to create a table dynamically based on the table_name and column_names that a user wants. When I use a Pl/sql Anonymous block to do this, it complains. Any suggestions ? Thanks, MarisaPersonally this sounds like a bad design to me. I would

How come the item value does not come thru via PL/SQL anonymous block?

Hi, It's a Form with 3 tables - 1) ClinicianProfileTb (with about 40 columns, insert/update via DML), 2) PeopleTb (with about 7 columns, insert/update via PL/SQL anonymous block) and 3) ClinicianPracticeTb (with about 10 columns, insert/update via PL