Problem of Variable/stored procedure

I hope it's the last issue to work through... but we need to access pictures stored on another server. We have a stored procedure called "get_doc" that accesses the filename of the image, and we have successfully tested it with a hardcoded value. A button called a process that is running the following PL/SQL:

() get_doc
p = > 77456);

However, when I use the same method with a variable on the page (which has the same numerical value of 77456), the procedure shows the value of p is Null.

() get_doc
p = >: P7_STARTERNUM);

Any suggestions or advice?
(With the help of ApEx 4.0 in IE8)

Tags: Database

Similar Questions

  • Problem with the stored procedure

    Hello everyone,
    I am French and I am trying to create a stored procedure in my oracle database 10 g R2.

    Here's the code I developed:

    create or replace procedure recgenerator (max_row in number, min_row number) is
    Start
    cursor c_nume_clie is
    Select nume_clie
    from (select rownum rn, nume_clie of the customer)
    where < = max_row and rn > rn = min_row;
    r_nume_clie c_nume_clie % ROWTYPE;
    Start
    Open c_nume_clie;
    loop
    extract the c_nume_clie in r_nume_clie;
    When the output c_nume_clie % NOTFOUND;
    dbms_output.put_line (r_nume_clie.numero);
    end loop;
    close c_nume_clie;
    end;
    end;
    /

    As you can see, the point is to allow a user to select the folder he wants only. I did a slider to get this, but oracle returns me an error and I can't find the source.

    Here is the oracle error:
    SQL > show errors
    Mistakes pour the RECGENERATOR PROCEDURE:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    3/11 PLS-00103: symbol 'C_NUME_CLIE' met instead of one of
    following symbols:
    := . ( @ % ;

    could you clarify me please?

    Thank you

    PaulNero

    When you want to print something on the screen you should be sure that you have added your connection to DBMS output.

    Go to the menu 'View'--> 'DBMS output. You can see that there is a new Dbms output window, where you can click the green sign to add your connection. Execute the statement again and you will see that the statement was printed.

  • Problems calling a stored procedure with DG4IFMX

    Hi guys,.

    I try to call stored procedures of database Informix, which is connected by an Oracle for Informix database gateway.

    I ran select, update, delete correctly but when I try to execute a stored procedure, that nothing is happening.

    for example:
    When I run
    call branko"@link_informix (1) «»

    It returns that it is performed successfully, without error, but as you can see below no entry is entered in the branko_test table

    to informix:

    drop the branko procedure;
    Create procedure "informix".branko (integer _vlez)
    returning a Boolean;
    If _vlez = 1 then
    insert into branko_test values ('uspesen test', '1');
    on the other
    insert into branko_test values ('test 2 ', 2' uspesen);

    end if;
    end of procedure;

    the procedure runs ok when called to informix.

    Thanks for any help

    P.S I even tried running:

    declare
    Whole RET;
    Start
    RET: = DBMS_HS_PASSTHROUGH. EXECUTE_IMMEDIATE@link_informix (' branko procedure (2)');
    end;

    but the same thing happens, no entry in the branko_test table.

    Find the root cause:
    When you are using dbaccess to call the original procedure it displays on the screen (expression)
    => remove the return value as it is not managed

    -> looks like not supported return Boolean value. Changes to the procedure of

    drop the branko procedure;
    Create procedure "informix".branko (integer _vlez)

    If _vlez = 1 then
    insert into branko_test values ('uspesen test', '1');
    on the other
    insert into branko_test values ('test 2 ', 2' uspesen);

    end if;
    end of procedure;

    allows me to execute the procedure using passthrough
    DECLARE
    result VARCHAR2 (50);
    BEGIN
    result: = DBMS_HS_PASSTHROUGH. EXECUTE_IMMEDIATE@dg4ifmx (' run the informix.branko procedure (1)');
    END;
    /

    Edited by: kgronau may 6, 2011 07:31

  • Problem call Oracle10g stored procedure (bug?)

    Hello everyone, I'm trying to call a stored procedure Oracle on Oracle 10 g XE of Java.
    I can successfully run the query to Java, so I can't tell what driver, connection,... are very good.
    I have the following error when I try to call a stored procedure or a function.
    I think it's a bug OraClient10.Dll file, so, in general, a bug that depends on my code. So I install the latest version of the JDK/JRE, and I download new folder OraClient10.Dll but the result was the same.
    Please help me!
    Thank you
    Manti

    #
    # A fatal error has been detected by Java runtime environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc = 0x61d37460, pid = 3872, tid = 1224
    #
    # Version JRE: 6.0_16 - b01
    # Java VM: Java hotspot Client VM (14: 2 - b01 mixed mode windows - x 86)
    # Problematic frame:
    # C [OraClient10.Dll + 0 x 117460]
    #
    # A file error with more information report is saved as:
    [...]
    #
    # If you want to submit a bug report, please visit:
    [...]
    # The accident happened outside the Virtual Machine Java to native code.
    # See problematic frame for where report them the bug.
    #

    Why not just connect via thin mode of the driver, not the mode of the OIC?
    You will get all the features and no risk of native code bug.

  • Problem with variables stored in memory/cookies.

    I'm not really sure what's going on, but that's what happens.

    I have a swf file that connects to a server through a file, but that seems to hold some variables in memory or something to make it works fine the first time it is loaded, when I load the page again, either the browser or the drive is not compensation on the previous values. I don't know if there is a way to ensure that the swf file when it loads ensures don't not to keep the values in the cache.  In fact, it seems that the only way to get around my problem is to erase cookies from my site and then recharge.

    Any ideas?

    site: http://condechi.com/test/movieTest.html

    Thank you

    O

    generally speaking, adding a query with changing value string will prevent items being retrieved in the browser cache.

  • Basic stored procedure helps - not the return data

    Hi all:

    To be fair, I come from a SQL Server environment and have never written anything for PL/SQL / Oracle before, this is my first attempt, so if nothing is better or more effective, please let me know. The immediate problem I'm having is, I have the following stored procedure, and all I want to do is return the data in the table, so that I can fill my DataSet in code. But when I run the code against this stored procedure, it still don't bring back any data (if I just do a standard "SELECT * FROM lkAllocation", I get the results, so I know data are there and the connection is good). If execution of the procedure in my window in Oracle SQL Developer (call PAYSOL.spallocationselectall ();), my results displays no data as well. What is the problem with this stored procedure?


    create or replace
    PROCEDURE spAllocationSelectAll IS
    Whole AllocationID;
    AllocationName Varchar2 (50);

    BEGIN
    AllocationID: = 0;
    AllocationName: = ";

    SELECT
    AllocationID,
    AllocationName
    IN
    AllocationID,
    AllocationName
    Of
    lkAllocation
    ORDER BY
    AllocationName;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHILE OTHERS THEN
    -Consider recording the error and then re-raise
    LIFT;
    END spAllocationSelectAll;

    Well, I'm not really in .net (I would participate in another forum so ;)), but this might be useful?

    Value (Oracle.DataAccess.Types)      System.Data.DbType      OracleDbType
    OracleRefCursor      Object      RefCursor
    

    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025379
    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025072

    Perhaps the [forum Windows and .net | http://forums.oracle.com/forums/category.jspa?categoryID=44] is worth a try as well.

  • Problems of syntax with a Variable/function/procedure

    Hello
    Some time ago I had advice how to define a simple (not stored) procedure within a PL/SQL Script, see procedure but not stored now, I tried to expand the sample by the use of some additional variables and a function instead of a procedure. The result expected from the following (pseudo) - code is very clear, but I get tons of errors due to problems of syntax. Of course I don't have need of all these variables in the example below, but it's the syntax I will need later. Maybe you can point me to an example which has a similar structure.

    DECLARE  
    
        -- Output Comment and 2*Input
        PROCEDURE OutputDouble(SingleValue IN Number, MyComment IN VARCHAR) IS
            variable MyTextResult VARCHAR(100); 
        BEGIN
            SELECT MyComment || ' ' || to_char(2 * SingleValue)) into MyTextResult from dual;
            dbms_output.put_line(MyResult);
        END;
        
        -- Return Product of Val1 and Val2
        FUNCTION MyProduct(Val1 IN NUMBER, Val2 IN NUMBER) IS
            variable MyNumResult Number := 0;
            returns Number
        BEGIN
            MyNumResult := Val1 *Val2;
            return MyNumResult;
        END;
    
       -- Definitions
       variable MyRes  Number;
       variable MyVal3 Number := 3;
       variable MyTxt3 VARCHAR(30) := 'Text mit 3';
     
    BEGIN
        
        -- Main process block
        OutputDouble(MyVal3, MyTxt3);
        MyRes = MyProduct(MyVal3, 5);
        dbms_output.put_line('Produkt: ' || to_char(MyRes)); 
        
    END;
    /
    Published by: netaktiv on 21.02.2012 13:24

    Published by: netaktiv on 21.02.2012 13:25

    (1) If you declare procedures in an anonymous PL/SQL block (which itself is not a particularly good way to organize the code), the procedure for declarations must come after all the variables are declared.
    (2) you do not use the keyword VARIABLE when you declare variables in PL/SQL
    (3) you have a fence extra paren in the SELECT statement in the OutputDouble that needs to be removed
    (4) the appeal dbms_output.put_line in OutputDouble should, without doubt, refer to the variable local MyTextResult, not same that does not exist.
    (5) the RETURN clause in the declaration of a function must be unique and must come before the IS
    (6) add a little more indented is useful for the following code.

    Put it all together, something like this works

    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2     -- Definitions
      3     MyRes  Number;
      4     MyVal3 Number := 3;
      5     MyTxt3 VARCHAR(30) := 'Text mit 3';
      6      -- Output Comment and 2*Input
      7      PROCEDURE OutputDouble(SingleValue IN Number, MyComment IN VARCHAR)
      8      IS
      9          MyTextResult VARCHAR(100);
     10      BEGIN
     11          SELECT MyComment || ' ' || to_char(2 * SingleValue)
     12            into MyTextResult
     13            from dual;
     14          dbms_output.put_line(MyTextResult);
     15      END;
     16      -- Return Product of Val1 and Val2
     17      FUNCTION MyProduct(Val1 IN NUMBER, Val2 IN NUMBER)
     18          return Number
     19      IS
     20          MyNumResult Number := 0;
     21      BEGIN
     22          MyNumResult := Val1 *Val2;
     23          return MyNumResult;
     24      END;
     25  BEGIN
     26      -- Main process block
     27      OutputDouble(MyVal3, MyTxt3);
     28      MyRes := MyProduct(MyVal3, 5);
     29      dbms_output.put_line('Produkt: ' || to_char(MyRes));
     30* END;
    SQL> /
    Text mit 3 6
    Produkt: 15
    

    As I said above, however, this isn't a particularly good way to code generation. You are much better (a lot!) create a procedure as OutputDouble first just debugging that, then create a function like MyProduct, debugging that and then just try to put it all together. Creating a single block that declares its own procedures and functions only makes it harder to debug and harder to generate the code of the work by the Assembly and testing of small building blocks.

    Justin

  • TSQL stored procedure - passing several variables

    Hello

    I have a drop-down list box in a form that allows you to select more than one. When I process the form, I currently use CF to dynamically generate the SQL WHERE clause creating as much as needed AND instructions.

    I migrate to MS SQL 2005 and the stored procedures on the db. I am trying to create a stored procedure that effectively uses tsql to CF was doing previously (creation in the WHERE clause).

    In the code below, I'm passing tank (22) variable called channel. The code below was my first attempt at trying to create the WHERE clause. Most of the code is focused on the extraction on the individual entities 'channel '. Any thoughts on how to get from this would be GREATLY appreciated!

    I need help on the SELECT side, ultimately I select 'regions', of 'Syndicated', WHERE is based on 'channels' past.

    Thank you

    cfwild

    Hello

    It was quite the adventure of trying to understand this. I learned a little about tsql. Here's the final procedure:

    CREATE PROCEDURE dbo.uspSelectSyndicatedRegion
    @TablePrefix as (7).
    Varchar (100) of @Category,.
    @Channel varchar (2000)

    AS
    BEGIN

    SELECT DISTINCT S.Region
    S Union
    JOIN iter_charlist_to_tbl (@Channel, by DEFAULT) M
    WE S.Channel = M.str
    UNION
    SELECT "
    ORDER BY S.Region

    END

  • Select problem with a statement in the stored procedure oracle

    Hi guys,.

    I am new to oracle. I have a simple sql stored procedure that needs to be converted to oracle. The procedure is,

    CREATE PROCEDURE my_procedure
    Char (4) @my_var = null
    AS

    Select * from my_table where my_variable = @my_var

    I converted this SP as oracle and the convert SP is,

    create or replace
    My_procedure PROCEDURE
    (
    v_my_var in CHAR DEFAULT NULL
    )
    AS

    BEGIN

    SELECT * FROM my_table WHERE my_variable = v_my_var;

    END;

    But the SP above returns an error (Error (13.3): PLS-00428: an INTO clause in the following SELECT statement) when compiling.

    So I used the slider to get the results and send back them. Updated the SP is,

    create or replace
    My_procedure PROCEDURE
    (
    v_my_var in CHAR NULL by DEFAULT,
    cv_1 ON SYS_REFCURSOR
    )
    AS

    BEGIN

    OPEN cv_1 to SELECT * FROM my_table WHERE my_variable = v_my_var;

    END;

    Now, the SP is compiled successfully and return the result set correctly. My doubt is,
    What is the right way to solve the problem that I mentioned above? Is there another way to get the select query result without using a cursor?

    Please advice. Thank you for your help in advance.

    RAM

    Depends on where you are calling from SP.
    I assume you are using a windows client, as you referred to SQL Server.
    The .NET Oracle provider, allowing return of pl/sql types and as you return only all columns in a single line, you could change your procedure to something like this:

    create or replace procedure my_procedure(v_my_var in  char default null
                                            ,cv_1     OUT my_Table%rowtype) as
    
      rt my_table%rowtype;
    begin
    
      SELECT *
      into   rt
      FROM my_table
      WHERE my_var = v_my_var;
    
      cv_1 := rt;
    
    END my_Procedure;
    /
    
  • Beginner - how to pass variable to a trigger in the stored procedure?

    Hello
    I am just using PL/SQL. I have a scenario in which a person is inserting data in this table schema.
    account (Anom, A #, cname, ball) who are the name of the branch, account number, customer name and balance.

    Thus, the user is insert an entry with a name in my table. Using a trigger in PL/SQL, I need to take the bname they inserted and send it to my stored procedure. I can't seem to do so; It keeps send me errors, and I can't find an example how to do that.

    Can someone show me how I could do this?

    Just for reference, here is the trigger as I wrote now. (printBranchesExcept is the name of my stored proc).

    CREATE OR REPLACE TRIGGER checkCity
    AFTER INSERTION
    On the account
    DECLARE localBname VARCHAR2 (10)
    BEGIN
    localBname: =: new.bname;
    printBranchesExcept (localBname);
    END;
    /

    charred wrote:
    DECLARE localBname VARCHAR2 (10) *.<-- missing="">

    Well, Yes, but the main problem is that you can't use: NEW /: OLD in for statement-level triggers. And in fact there is absolutely no need of localBname:

    CREATE OR REPLACE TRIGGER checkCity
    AFTER INSERT
    ON account
    FOR EACH ROW
    BEGIN
    printBranchesExcept(:new.bname);
    END;
    /
    

    SY.

  • Call data of Variable in a stored procedure for the name of the Partition

    Hello

    Here is an excerpt of a Proc Srored I wrote.
    The objective here is to copy data from a partition of a table.
    I have first query the name of the partition of the table ALL_TAB_PARTITIONS and even store in a VARCHAR2 variable named partition_name_low.
    I then try to select the data in that partition of the table using the name of the variable.

    PROCEDURE purge AS

    partition_name_low VARCHAR2 (25);

    BEGIN
    --+
    -Request for the highest value of the timestamp in the 1st partition in the current table.
    --+
    SELECT NOM_PARTITION
    IN partition_name_low
    OF ALL_TAB_PARTITIONS
    WHERE TABLE_NAME = 'TABLE1' AND PARTITION_POSITION IN
    +(+
    SELECT MIN (PARTITION_POSITION)
    OF ALL_TAB_PARTITIONS
    WHERE TABLE_NAME = 'TABLE1 '.
    +);+
    COMMIT;


    COMMIT;
    DBMS_OUTPUT. Put_line (partition_name_low: ' * ' |) TO_char (sysdate, ' ' the HH24: MI: SS DD/MM/YYYY) | ("From scrub data *');

    --+
    -Copy data from a partition 1 to Table Archive
    --+

    INSERT / * ADD * / IN TABLE1_ARCHIVE +.
    SELECT * FROM TABLE1 PARTITION (partition_name_low).


    However, I am facing a problem here because now I get an error that "ORA-02149: specified Partition does not exist.
    As I understand it, is that the Oracle query contains the literal string "partition_name_low", instead of the data in it.
    I tried with
    & partition_name_low
    AND
    : partition_name_low

    with no luck.
    In the 2nd case, I get the obvious exception 'bad bind' variable

    Please can anyone suggest how I can handle this situation where I can use a variable see the partition name in a select query?

    Thanks in advance!
    Abhishek.

    Hello, try:

    EXECUTE IMMEDIATE 'INSERT /*+ APPEND */ INTO TABLE1_ARCHIVE SELECT * FROM TABLE1 PARTITION(' || partition_name_low ||')';
    
  • Problem when executing a stored procedure

    Hello
    im a beginner, using v (10.2.0.1.0) of Oracle 10 g on a linux machine.
    Cannot run after the procedure through query iSQLPLUS im interface.

    create or replace procedure (pd_hr)
    PNO varchar2,
    PDT date default sysdate,
    PHR number,
    perr_msg out varchar2
    ) as
    Start
    PHR: = 2;
    end pd_hr;

    Number of phr VARIABLES;

    Perr_msg VARIABLE VARCHAR2 (250);

    run pd_hr('pno',,phr,perr_msg).

    It flashes the following error when I try to execute the stored procedure:
    ERROR on line 1:
    ORA-06550: line 1, column 44:
    PLS-00201: identifier "PHR" must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    I ran the following query through DBA connection before performing the procedure:
    GRANT EXECUTE ANY PROCEDURE 'SCOTT ';

    Any form of assistance will be invaluable!

    Peter

    Hi, Peter,.

    Put a colon (': ') before binding variable names except when declaring:

    -- No colons here:
    VARIABLE phr number;
    VARIABLE perr_msg VARCHAR2(250);
    
    -- Colons needed here
    execute pd_hr ('pno', NULL, :phr, :perr_msg);
    
  • Problem with stored procedure and validation

    I have the following stored procedure:

    create or replace PROCEDURE SOME_PROC)

    /*

    Some settings

    */

    ) AS

    NUMBER of errors

    BEGIN

    errors: = FN_CHECK_BUSINESS_RULE_1 (/ * some args * /);

    if(Errors > 0) then

    raise_application_error (ERR_CONSTANTS. SOME_ERROR_NUMBER, ERR_CONSTANTS. SOME_ERROR_MESSAGE);

    end if;

    INSERT INTO une_table (/ * columns * /) VALUES (/ * values * /);

    END SOME_PROC;

    Because the business rule 1 is placed inside the stored procedure I can't check it out without calling the stored procedure.

    I need to call the stored procedure 10 times with a different set of parameters and validation of the changes only after all calls to the stored procedure

    are successful. I want to show the user all the errors that occurred during the stored procedure calls. If for a first example of stored procedure call

    succeeds and a second failure no data has to be stored in a database.

    How to prevent the stored procedure for insert lines until I call the method commit of ApplicationModule?

    Thanks in advance.

    No, other users only see the lines until you commit. The search term is the transaction isolation level. Tom Kite write a paper on this here ask Tom: on transaction isolation levels. This article gives some samples, according to theory, and you should read it.

    Timo

  • Problem with the Entity Framework by using stored procedures

    I am developing a project with Oracle DB and Entity Framework.
    Due to performance issues, for some querys I uses procedures stored instead of LINQ queryies,
    When I try to add my model EF procedure, the procedure is added but the Model Designer
    It does not acknowledge the columns returned by the procedure.
    so I can't create something complex to the user the results of the procedure
    in a domain service

    Here's the relevant readme which has some tips: http://www.oracle.com/technetwork/topics/dotnet/tech-info/default-338300.html#mozTocId610465

    If you do a forum search there is further discussion of the issues, and the readme file provided with version beta has also some information.

    But I agree with the general theme: using stored procedures in the EF is a PITA. :( I really hope they do something to make it easier in the future because this is probably the single most important weakness in the implementation of Oracle EF and establishment of a complex type is your time and picky it's ridiculous. (I found it less problematic if your procedure returns a complete picture that your model has already an entity for, because you can get away with only add the entry to one of the configurations for the cursor rather than one for each column.)

    Even an external tool where direct you to the procedure and it creates the configuration entries to be able to copy and paste would be a huge improvement.

  • use the stored procedure VARIABLE in an ODI procedure

    Hello

    I have a stored procedure that takes custId as an input parameter and returns the age as output parameter.

    custId is a varaible ODI that we spend during execution.

    I want to insert the age value in a table.

    declare
    cust_age customer_details.age%type;
    Start
    FETCH_CUSTOMER_DATA(#Customer.CustomerID,cust_age);
    end;

    INSERT INTO CUSTOMER_AGE VALUES(#customerid,*cust_age*)

    Thank you.

    Hello

    Just use the insert in an ODI procedure in an anonymous pl/sql block.

    I mean:

    declare

    cust_age customer_details.age%type;

    Start

    FETCH_CUSTOMER_DATA(#Customer.CustomerID,cust_age);

    INSERT INTO CUSTOMER_AGE VALUES(#customerid,*cust_age*);

    end;

    Ok?

    Cezar Santos
    http://odiexperts.com

Maybe you are looking for