About using dynamic sql in jsp

I make a jsp file with "CreateViewObjec".I can get the message from db ,but I get the same message when I push the button "next" .Please help me!
my jsp file is:
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ page contentType="text/html;charset=MS936"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=MS936">
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<H2>
The current time is:
</H2>
<P>
<% out.println((new java.util.Date()).toString()); %>
</P>
<jbo:ApplicationModule id="MypackageModule" configname="mypackage.MypackageModule.MypackageModuleLocal" releasemode="Stateful" />
<jbo:CreateViewObject appid="MypackageModule" name="dyname" rangesize="10" >
select PRODUCT_NAME from product_information
</jbo:CreateViewObject>
<jbo:DataSource id="id" rangesize="20" appid="MypackageModule" viewobject="dyname" />
<table border="0">
<tr>
<td ALIGN="right"><jbo:DataScroller datasource="id" /></td>
</tr>
<tr><td>
<jbo:DataTable datasource="id" />
</td>
</tr>
</BODY>
</HTML>
<jbo:ReleasePageResources />

David,
I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
Thx

Similar Messages

  • Using Dynamic SQL in Forms

    Does anyone know anything about Dynamic SQL not being available in Forms v. 6.0.8.11.3? I trying to use Dynamic SQL for the first time and am having some difficulty. When I try to put my SQL in a function and run it straight into the database through SQLPlus, it works fine, but when trying to compile the code in Forms Builder (in a library), I get compiler errors. Any help would be appreciated...
    Thanks!
    Vanessa

    When I tried to compile the following code in Forms, the compiler error I got was Encountered the symbol "STMT_STR" when expecting one of the following: select. However, when I run it in SQLPlus, it creates the function without any errors.
    FUNCTION my_func
    return number
    is
    TYPE DiaryCurTyp IS REF CURSOR;
    cur DiaryCurTyp;
    stmt_str VARCHAR2(200);
    dmonth NUMBER;
    dday NUMBER;
    BEGIN
    stmt_str := 'SELECT dmonth, dday FROM p2_diary
    WHERE dmonth = :1';
    OPEN cur FOR stmt_str USING '12';
    LOOP
    FETCH cur INTO dmonth, dday;
    EXIT WHEN cur%NOTFOUND;
    -- <process data>
    END LOOP;
    CLOSE cur;
    END;

  • Can we use Dynamic SQL in Oracle Reports ?

    Hi ,
    Can we use Dynamic SQL in Oracle Reports ?
    If yes please give some examples .
    Thanx
    srini

    I believe the built-in package SRW.Do_Sql is what you are looking for
    Example from the document:
    /* Suppose you want to create a "table of contents" by getting the
    ** first character of a columns value, and page number on which its
    ** field fires to print. Assume that you want to put the "table of
    contents"
    ** into a table named SHIP. You could write the following construct:
    DECLARE
    PAGE_NO NUMBER;
    PAGE_FOR INDEX NUMBER;
    SORT_CHAR CHAR(1);
    CMD_LINE CHAR(200);
    BEGIN
    SORT_CHAR := :SORT_NAME ;
    IF :CALLED = Y THEN
         SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
         SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
         P_START_PAGENO);
         SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
    END IF;
    SRW.GET_PAGE_NUM(PAGE_NO);
    CMD_LINE := INSERT INTO SHIP VALUES
                          (||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
    SRW.MESSAGE(2,CMD_LINE);
    SRW.DO_SQL(CMD_LINE);
    COMMIT;
    EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
            NULL;
      WHEN SRW.DO_SQL_FAILURE THEN
            SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
      WHEN OTHERS THEN
           COMMIT;
    END;

  • How to Use Dynamic SQL

    Can anybody please send me a small program on How to Use Dynamic SQL.
    How to execute and run give details.
    Thanks
    null

    You can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
    EXECUTE IMMEDIATE sqlStmt
      USING variable1, variable2
       INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Getting error while using DYNAMIC SQL

    Hi Team,
    I am Oracle DBA. I have limited knowledge on PL/SQL. I used below PL/SQL code to drop 50 partitons from one of the table.
    I used Dynamic SQL EXECUTE IMMEDIATE to drop partions. But error occured. If I commented EXECUTE IMMEDIATE, procedure executed successfully.
    Please suggest me, where i did the mistake. Also please suggest for better code than my code. please find below code and error details.
    SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
    3 BEGIN
    4 for curr IN DROP_PARTITON LOOP
    5 DBMS_output.put_line(curr.partition_name);
    6 execute immediate(Alter table Table_Name drop partition curr.partition_name);
    7 end loop;
    8* END;
    SQL> /
    execute immediate(Alter table BILLCHRG drop partition curr.partition_name);
    ERROR at line 6:
    ORA-06550: line 6, column 19:
    PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternative
    SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
    3 BEGIN
    4 for curr IN DROP_PARTITON LOOP
    5 DBMS_output.put_line(curr.partition_name);
    6 --execute immediate(Alter table TABLE_NAME drop partition curr.partition_name);
    7 end loop;
    8* END;
    SQL> /
    ABCD_2009_06
    ABCD_2009_06
    ABCD_2009_06
    BILLCHRG_2011_04
    PL/SQL procedure successfully completed.

    PL/SQL code runs on the server, inside an Oracle process - thus PL/SQL code cannot dynamically write and display messages to the client. That server process is not connected to any keyboard, mouse or display.
    DBMS_OUTPUT can be used. This is a PL/SQL buffer area in that server process that code can write lines of text too. When the server process informs the client that it has completed, the client can now request the contents of the DBMS_OUTPUT buffer and the client can display it on the client device.
    This is what set serveroutput on in SQL*Plus does - tell the sqlplus client to request the DBMS_OUTPUT buffer after each Oracle server call made and to display the contents locally.
    So to display the SQL command can be done using DBMS_OUTPUT. E.g.
    declare
      dropPart varchar2(32767);
    begin
      for c in (select...) loop
        dropPart := 'alter table my_tab drop partition '||c.partition_name';
        --// write the SQL command to DBMS_OUTPUT
        DBMS_OUTPUT.put_line( dropPart );
        --// execute the SQL using a begin..end block in order to catch error
        begin
          execute immediate dropPart;
          DBMS_OUTPUT.put_line( 'command completed successfully' );
        exception when OTHERS then
          DBMS_OUTPUT.put_line( 'command failed with: '||SQLERRM(SQLCODE) );
        end;
      end loop;
    end;So after this code block has been executed and partitions dropped, sqlplus will display the DBMS_OUTPUT generated by this code block.

  • Delcare Cursor using Dynamic SQL using PL/SQL in Oracle 7.3.4

    In Oracle 7.3.4, can I declare a cursor at run time using Dynamic SQL. From the sample code in this website, it seems that Oracle 8 support this function. Please help. Thanks a lot.
    If I can do this on Oracle 7.3.4, could you give me some sample codes? Thanks.
    Regards,
    Raymond

    Hi,
    Try using the the following code where you can dynamically build the Valid Select stmt. and call that where ever you want.
    declare
    Type Cur_ref Is Ref Cursor;
    C_ref Cur_ref;
    V_Str Varchar2(100);
    V_Name Varchar2(100);
    Begin
    V_Str := 'Select Ename from Scott.emp Where empno = 7369';
    Open C_Ref for V_Str;
    Fetch C_ref Into V_Name;
    close C_Ref;
    dbms_output.put_line(V_Name);
    End;
    regards
    gaurav
    null

  • Using dynamic sql in triggers with :OLD values

    i need to record all deleted rows from an entire schema in a single table. for that matter i created a function that receives a table name and generate an insert command according to it's primary key columns. i call this function in the table triggers. in order to insert the old values before the delete i use :OLD with "execute immediate" as followed :
    create or replace trigger trg_some_tbl_bd
    before delete on some_tbl
    for each row is
    declare
    v_sql varchar2(4000);
    begin
    v_sql := generate_insert_command('some_table');
    execute immediate v_sql;
    end;
    the return value from "generate_insert_command" function is the string:
    insert into deleted_table (table_name , date , pk1 , pk2) values
    ('some_table' , sysdate , :OLD.pk1 , :OLD.pk2)
    the execute immediate command notice the :OLD and looks for bind variables.
    i need to know i can i bypass that. i tried looking for escape characters but couldent find any...
    i would appriciate any help , it's kynda urgent
    Thanks !

    I don't believe this is going to work. Even if you could get around the fact that :old looks like a bind variable, the :old values are not visible to the dynamic SQL statement, they're like local variables in that respect.
    If you wanted to pass old values in, those values would have to be passed in as bind variables, i.e.
    EXECUTE IMMEDIATE v_sql USING :old.pk1, :old.pk2which defeats the purpose of using dynamic SQL.
    Since you have to create a trigger for each table, I don't see why you would bother with dynamic SQL inside the trigger-- your table structure is fixed when the trigger is created. You could write dynamic SQL that generated the triggers in the first place, but the code inside the trigger should be dynamic.
    As an aside, you realize that logging every audit record into a single table creates rather massive contention issues, right? And have you considered how painful it is to query this sort of table? Have you considered other options for maintaining history like Workspace Manager? Or at least separate history tables for each table?
    Justin

  • ORA-01006 using Dynamic SQL

    Hello,
    I'm trying to create a function utilizing Dynamic SQL. The function compiles fine, but when I go to call it using the select staement below, I get :
    ORA-01006: bind variable does not exist
    ORA-06512: at "ICIM.PROD_SALES_DATA", line 24
    select prod_sales_data('09','I',2009,'Awning')
    from dual;
    CREATE OR REPLACE FUNCTION prod_sales_data
    (p_ahl1 IN VARCHAR2, p_phl1 IN VARCHAR2, p_fisyr IN NUMBER,
    p_prod_str IN VARCHAR2)
    RETURN NUMBER IS
    v_return NUMBER;
    query_str VARCHAR2(10000);
    BEGIN
    query_str :='select sum(a.qsh*a.unitcnt)'||chr(13)
    ||'from sh_units a, sh_product_desc b, sh_ad_glass c'||chr(13)
    ||'where a.unittype = b.unittype'||chr(13)
    ||'and a.sh_id = c.sh_id(+)'||chr(13)
    ||'AND a.ahl1 = '||chr(39)||p_ahl1||chr(39)||chr(13)
    ||'AND a.phl1 = '||chr(39)||p_phl1||chr(39)||chr(13)
    ||'AND a.fisyr ='|| p_fisyr||chr(13)
    ||'AND UPPER(b.descrip) = UPPER('||chr(39)||p_prod_str||chr(39)||')'||chr(13)
    ||'AND a.invdt between b.eff_beg and b.eff_end'||chr(13)
    ||'and a.parts_flag <>'||chr(39)||'Y'||chr(39)||chr(13)
    ||'and a.unittype <>'||chr(39)||'OTHE'||chr(39)||chr(13)
    ||'and icim.sh_rept_chk_ortp(a.ortp) = 1'||chr(13)
    ||'and A.REPT_RELEASE_DT is not null';
    DBMS_OUTPUT.PUT_LINE(query_str) ;
    EXECUTE IMMEDIATE query_str
    INTO v_return
    USING p_ahl1,p_phl1,p_fisyr,p_prod_str;
    RETURN v_return;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    END prod_sales_data ;
    Any help as to what is going wrong would be greatly appreciated.
    Thanks,
    Tyler

    Hello,
    >
    I'm trying to create a function utilizing Dynamic SQL. But why?
    Whenever you turn towards dynamic SQL, ask yourself why?
    I bet for a couple of years you aren't able rto come up with an answer. Meaning you shouldn't.
    Even if you do come up with an answer, think again. The answer may very well be wrong.
    Wouldn't it be nice if your function was as simple as:
    CREATE OR REPLACE FUNCTION prod_sales_data
       ( p_ahl1      IN VARCHAR2
       , p_phl1      IN VARCHAR2
       , p_fisyr     IN NUMBER,
         p_prod_str  IN VARCHAR2)
    RETURN NUMBER
    IS
       v_return NUMBER;
    BEGIN
        select sum(a.qsh*a.unitcnt)
          into v_return
          from sh_units a
             , sh_product_desc b
             , sh_ad_glass c
         where a.unittype = b.unittype
           and a.sh_id = c.sh_id(+)
           and a.ahl1 =  p_ahl1
           and a.phl1 =  p_phl1
           and a.fisyr = p_fisyr
           and upper(b.descrip) = upper(p_prod_str)
           and a.invdt between b.eff_beg and b.eff_end
           and a.parts_flag != 'Y'
           and a.unittype != 'OTHE'
           and icim.sh_rept_chk_ortp(a.ortp) = 1
           and a.rept_release_dt is not null;
    RETURN v_return;
    EXCEPTION
       WHEN NO_DATA_FOUND THEN
          RETURN NULL;
    END prod_sales_data ;
    /Now using proper bind variables, plain static pre-compiled SQL. And even works properly WITH NO DATA FOUND.
    I know it's dangerous to use words as always and never, but i dare say
    Always (Whenever you can) use static SQL. Never (Unless you must) use dynamic SQL (When you can use static).
    Regards
    Peter

  • Should I use dynamic SQL for simple updates?

    Please tell me, out of the two options given below, which option should i use to update columns in a table and why?
    what will be the performance difference between the two approaches?
    Please note: The options given below is just for an example
    procedure proc1(var1 varchar2)
    is
    begin
    update tab1 set col1 = var1;
    commit;
    end;
    procedure proc1(var1 varchar2)
    is
    sqlstr varchar2(1000);
    begin
    sqlstr := 'update tab1 set col1 = :v1';
    execute immediate sqlstr using var1;
    commit;
    end;
    Thanks
    Arun

    Arun G Nath wrote:.
    Should I use dynamic SQL for simple updates? No way, not a chance.
    Performance is not the issue (as long as you are using bind variables).
    But with dynamic SQL, you loose compile time checking; you do not know until runtime if the SQL is valid.
    You also loose the dependency between proc1 and tab1, which can be found only if you search user_source.
    (And in either case, you probably want to remove the commit)
    Regards
    Peter

  • How to use dynamic SQL in this case for best performance

    I have the table with following columns
    ID NUMBER,
    DATA LONG,
    TAG VARCHAR2(255)
    Records in this table will be like following
    1 this is an abstract ABSTRACT
    1 this is author AUTHOR
    1 100 PRICE
    2 this is an abstract ABSTRACT
    2 this is author AUTHOR
    3 contract is this CONTRACT
    Basically all the records with the same number constitute 1 record for another table. Tag in the above table indicates that what column it is and DATAwill have the actual data for that column. I need to populate the second table based an the above table but will not get the same number of TAGS all the time. I need to insert the values only for the columns provided in the TAG field. How will I accomplish this by dynamic sql. Do I create a loop and create two strings one with columns and one with values and then combine them and use execute immediate to insert into table? Is there an easier way to do this??
    Please respond quickly.
    Thanks
    Bhawna
    null

    > so which collection should i use to perform it..
    so that performance is best......
    Program to interfaces. That way, you can switch out implementations and test for yourself which performance is best in an actual production context. But first, write your program so that it works. Worry about refactoring for performance once your program is written and it works.
    > plz send me the logic....
    Give it a shot on your own first; we can help if you get stuck.
    ~

  • Using dynamic SQL (native) in triggers.

    Hi All:
    As a part of client requirement, I need to capture all column data from tables when rows get deleted. I am using a single table to capture deleted column data (not concatenated but one column data per row).
    I am using native dynamic SQL as I need to get the most recent column list for any table from USER_TAB_COLUMNS table. Somehow, Oracle does not allow me to use :old.xxx syntax when doing a EXECUTE IMMEDIATE insert_statment;
    Can't I use native dynamic SQL in triggers to refer to :old and :new values?
    Thanks,
    Sankar.

    No, you cannot use NDS to refer to the :old values. You can use the data dictionary to automate the writing of the audit trigger code itself though. Hi Todd,
    Can you please explain your comment about using the data dictionary to automate writing the audit trigger code..
    Thanks.

  • RFC WHICH CAN USE DYNAMIC SQL AS INPUT AND SHOW COMPLETE DATA FOR TABLE

    Hi Expert,
    I am trying to create a FM like RFC_READ_TABLE. In this table we put table name and the field name for which we write a query and option for query we get the out put only for that field in this case.
    My requirement is very similar to this. But here i want to enter any table name and in option i want to write dynamic sql query for any filed of table then i want data based on this so that it will display the entire table entries.
    Like TABNAMELIKE     EKKO
    OTHERCON     bukrs_k = 3000.
    Based on this selection it has to show the entire table fields.
    To make this easy to understand i made a custom FM which are getting data from table or view and i select any field and put query it will show the result.
    FUNCTION ZDYNSQL_EKKO_EKPO.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(ERNAMLIKE) TYPE  CHAR15 OPTIONAL
    *"     VALUE(OTHERCON) TYPE  CHAR50 OPTIONAL
    *"  TABLES
    *"      VALUE STRUCTURE  V_EKKO_EKPO
    *TABLES : V_EKKO_EKPO, EKKO, EKPO.
    DATA: STR_WHERE TYPE TABLE OF EDPLINE.
    DATA: STR_LINE TYPE EDPLINE.
    *CONCATENATE 'EBELN LIKE''' EBELNLIKE '%''' INTO STR_LINE.
            CONCATENATE 'ERNAM LIKE ''' ERNAMLIKE '%''' INTO STR_LINE.
            IF OTHERCON <> '            '.
            CONCATENATE STR_LINE 'AND' OTHERCON '            ' INTO STR_LINE SEPARATED BY SPACE.
            ENDIF.
          APPEND STR_LINE TO STR_WHERE.
          SELECT * FROM  V_EKKO_EKPO INTO CORRESPONDING FIELDS OF TABLE VALUE WHERE (STR_WHERE).
    ENDFUNCTION.
    Now here is sample code of exact requirement.
    FUNCTION ZDYNSQL_TABLE_READ.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(TABNAMELIKE) TYPE  DD02L-TABNAME
    *"     VALUE(OTHERCON) TYPE  CHAR80 OPTIONAL
    *"  TABLES
    *"      VALUE STRUCTURE  DD02L
    DATA: STR_WHERE TYPE TABLE OF EDPLINE.
    DATA: STR_LINE TYPE STRING.
            CONCATENATE 'TABNAME LIKE ''' TABNAMELIKE '%' 'DD02L' 'TABNAME' INTO STR_LINE.
            IF OTHERCON <> '            '.
            CONCATENATE STR_LINE 'AND' OTHERCON '            ' INTO STR_LINE SEPARATED BY SPACE.
            ENDIF.
          APPEND STR_LINE TO STR_WHERE.
          SELECT * FROM DD02L INTO CORRESPONDING FIELDS OF TABLE VALUE WHERE (STR_WHERE).
    ENDFUNCTION.
    In this i put table name as EKKO and put sql query as bukrs_k = 3000 it provide a short dump.
    How can i solve this problem. Please provide some input or modification
    Thanks And Regards
    Ranjeet Singh

    Hi Kris,
    I tried to make sample using that link you provide to me. How can i declare Global Interface in FM and in import parameter references like "REFERENCE(I_INTERFACE_CHECK) DEFAULT SPACE".
    Also it uses a function-pool.
    Let me tell you about my exact requirement about FM.
    I want in import parameter input as any SAP Table name like
    TABNAME TYPE EKKO
    OPTIONS TYPE CHAR80
    I want my output to be stored in TABLES attributes as per the table name entered in import parameter. In import parameter Table name can be any one of SAP tables and Option based on that particular table. Like if i go with table EKKO and put OPTIONS as
    ebelp = 4 then TABLES attributes Tab  contains all the relevant data for input.
    Is there any way with the help of that i can put my data into internal tables. I tried to put in TABLES as VALUE LIKE ANY but it shows that generic are not allowed. Can you provide some sample on this.
    I also getting exceptions like CX_SY_DYNAMIC_OSQL_SEMANTICS, SAPSQL_INVALID_FIELDNAME.
    Waiting for your valuable reply.
    Thanks And Regards
    Ranjeet Singh

  • Using Dynamic SQL in OWB maps

    Hi,
    Is there any way that we can write dynamic SQL in OWB.As per my requirement i want to change the where clauses dynamically on need basis.
    Thx

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • Using Dynamic SQL to populate ALV

    Hi,
    Does anyone know if it is possible to use the Runtime Type Services to obtain the structure definition for the results a dynamic select statement?
    I am looking to create a simple web dynpro app that that will populate an ALV grid with the results of a SQL Select statement that has been manually typed in by a user. Is there an easy way to do this without having to pull apart the relevant details from (column_syntax), (from_syntax) etc.. in order to create a dynamic type that the ALV Data Node will be mapped to?
    Kind Regards
    Simon

    Hi Clemens,
    Thanks for your reply.
    It is the result table that I am actually interested in. I know how to build the actual SELECT statement from user input but I'm struggling to capture the results into a table without having to define the result table structure first (i.e. in order to implement the 'INTO CORRESPONDING FIELDS OF TABLE' clause). If I could somehow capture the results into a generically defined table and then use CL_ABAP_TABLEDESCR to get the actual line structure, I could then build the Context Node that will be mapped to the ALV Data interface node.
    What I am trying to avoid, if at all possible, is having to deconstruct the actual SQL statement in order to pull out the parts that I would have to use to get RTTS to manually create a custom descriptionfor the results table.
    Is this possible?
    I have also come across classes in the SDB_ADBC package which look that they could possibly do the job. However, my understanding is that these use Native SQL rather then Open SQL.

  • Doubt & Error Using Dynamic SQL

    Hello,
    According to oracle documentation for Dynamic SQL using ' Method 2 ' ... which says ...
    Method 2
    This method lets your program accept or build a dynamic SQL statement, then process it using the PREPARE and EXECUTE commands. The SQL statement must not be a query. The number of placeholders for input host variables and the datatypes of the input host variables must be known at precompile time. For example, the following host strings fall into this category:
    'INSERT INTO EMP (ENAME, JOB) VALUES (:emp_name, :job_title)'
    'DELETE FROM EMP WHERE EMPNO = :emp_number'
    Now for trying this method i created a procedure .. named .. 'aj_proc_1'
    CREATE OR REPLACE PROCEDURE aj_proc_1(p_id IN NUMBER)
    IS
    BEGIN
         EXECUTE IMMEDIATE 'delete from aj_test_1 where id = :p_id';
    END aj_proc_1;
    And the table which m using in this procedure is ...
    SQL> select * from aj_test_1;
    ID NAME
    1 aijaz
    2 melwin
    3 aasim
    4 satish
    5 ashok
    So now whn m calling this Procedure & wanted to delete the record with id '2' ... m getting an Error...the way m executing this procedure is ...
    SQL> execute aj_proc_1(2);
    BEGIN aj_proc_1(2); END;
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-06512: at "FA.AJ_PROC_1", line 4
    ORA-06512: at line 1
    Please Help me .. As i have no idea ..wats goin wrong over here...

    Now whats Wrong with this 1 ....
    CREATE OR REPLACE PROCEDURE aj_proc_1(p_id IN NUMBER)
    IS
         val_name varchar2(34);
    BEGIN
         EXECUTE IMMEDIATE 'select name into '||val_name||' from aj_test_1 where id = :p_id'
                        USING p_id ;
              dbms_output.put_line(val_name);
    END aj_proc_1;
    SQL> exec aj_proc_1(2);
    BEGIN aj_proc_1(2); END;
    ERROR at line 1:
    ORA-00936: missing expression
    ORA-06512: at "FA.AJ_PROC_1", line 5
    ORA-06512: at line 1
    -----------------------------------------------------------------------------------

Maybe you are looking for

  • Need help urgently on Backup!!

    Hi there, I have a Macbook that I bought 2 years ago, and due to loads of photos and videos etc etc, the memory is full to the top.  I don't know much about Time Machine or Hard Drives, but I do know that I need to find out and I need a hard drive by

  • How to Merge Report of ManagedBy Attribute with Collection Membership

    I would like to merge the query below: SELECT   v_R_System.Name0   ,v_R_System.managedBy0   ,v_R_User.Full_User_Name0   ,v_R_User.Distinguished_Name0 FROM   v_R_System   INNER JOIN v_R_User     ON v_R_System.managedBy0 = v_R_User.Distinguished_Name0

  • How to reset/delete autocomplete entries in file info metadata?

    I've got some autocomplete junk in some fields of the file info metadata - how do I delete it? Vista 64. Thanks.

  • Unable to set printer name after latest update.

    I updated my airport extreme with the 7.4.1 updater and now am unable to configure a printer name for my USB connected Canon MP530 with the airport utility. The printer name field in Airport Utiliuty comes up blank, and the secondary device (FAX) has

  • SUID archive

    hello.. i have recently experienced some problems with my MacBook. sometimes the system is stalling and the only thing that happens is that the cursor starts to be a multi colored wheel in up to 1 min, then it gets back to normal, but then the next i