How to reutrn a sqlplus procedure value to dos

Hi all,
How to return the sql procedure value to dos variable.
like returning a char value 'Y' to dos variable.
thanks
Regards
S. Djeanthi

I googled for this answer.
Cheers, APC

Similar Messages

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

  • How to pass more than one value for one column in procedure

    hi
    select id, name from col_tab where dept_name in ('ECE','CIVIL');
    when i was running this it is working well.
    CREATE OR REPLACE PACKAGE pack_str
    AS
    TYPE type_refcur IS REF CURSOR;
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
    PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
    IS
    BEGIN
    OPEN ans FOR
    select id,name from col_tab where dept_name in char_in ;
    END str;
    END pack_str;
    the package was created.
    my doubt is
    1.how to pass more than one value for char_in (e.g ('ECE','CIVIL'))
    2. when i was storing the value in string like val = 'ECE,CIVIL' ,
    how to get the id,name for ECE and CIVIL.
    plz help me

    Hi Rebekh ,
    I am recreating your packages for the desired output.
    CREATE OR REPLACE PACKAGE pack_str
    AS
         TYPE type_refcur IS REF CURSOR;
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur);
    END pack_str;
    CREATE OR REPLACE PACKAGE BODY pack_str
    AS
         PROCEDURE str(char_in VARCHAR2,ans OUT type_refcur)
         IS
              lv_t varchar2(200);
         BEGIN
              lv_t := REPLACE(char_in,',',''',''');
              lv_t := 'select id,name from col_tab where dept_name in (''' || lv_t || ''')' ;
              OPEN ans FOR lv_t;
         END str;
    END pack_str;
    Note:-
    Input Parameter char_in is a comma seperated value for dept_name
    -Debamalya

  • How to have an Oracle procedure send and receive value from a java program.

    The below procedure is place inside a package. This procedure "get_extract_ready_headers " is selecting columns store_number, terminal_number, tran_number, tran_date, cust_id from the source REX_HEAD_EXTRACT table. This information is selected into a ref cursor. The data has cust_id field which is encrypted. How do I modify the procedure get_extract_ready_headers and accomplish 2 things?
    1. Make this procedure to read the "cust_id" value from the source table and send the value to a Java program "getheaderinfo" (this java program decrypts the cust_id field).
    2. When we get the unencrypted value back from the Java program, make the procedure accept this decrypted value and use it to update CUST_ID value in the target table TRAN_HEAD table. I am using Oracle 11.2.0.2, and TOAD 10.5.1.3.
    -- Procedural code
    PROCEDURE get_extract_ready_headers (p_records OUT SYS_REFCURSOR)
    IS
    BEGIN
       OPEN p_records FOR
       SELECT store_number, terminal_number, tran_number, tran_date, cust_id FROM REX_HEAD_EXTRACT;
    END;--Table Structure for source table REX_HEAD_EXTRACT
    CREATE TABLE REX_HEAD_EXTRACT
      REX_SEQ_NBR         NUMBER(20),
      REVISION_NUMBER         NUMBER,
      DAY                     NUMBER(3),
      RESA_TRAN_SEQ_NO        NUMBER(20),
      BUSINESS_DATE           DATE,
      TRAN_SEQ_NBR            NUMBER(12),
      ORG_NUMBER              NUMBER,
      STORE_NUMBER            NUMBER,
      TRAN_DATE               DATE,
      TERMINAL_NUMBER         NUMBER,
      TRAN_NUMBER             NUMBER,
      TRAN_TIME               DATE,
      BATCH_NUMBER            VARCHAR2(8 BYTE),
      BATCH_TYPE              VARCHAR2(4 BYTE),
      TRAN_TYPE               VARCHAR2(4 BYTE),
      SUB_TRAN_TYPE           VARCHAR2(4 BYTE),
      CLERK_CODE              VARCHAR2(15 BYTE),
      TRAN_TAXABLE_AMOUNT     NUMBER(12,2),
      TRAN_TAX_TOTAL          NUMBER(12,2),
      TRAN_GROSS_TOTAL        NUMBER(12,2),
      COUP_TOTAL              NUMBER(9,2),
      MKD_TOTAL               NUMBER(9,2),
      EMPLOYEE_NUMBER         VARCHAR2(15 BYTE),
      EMPLOYEE_NAME           VARCHAR2(40 BYTE),
      TRAN_ALTTAXABLE_AMOUNT  NUMBER(12,2),
      TRAN_ALTTAX_TOTAL       NUMBER(12,2),
      SALE_AMOUNT             NUMBER(9,2),
      RETURN_AMOUNT           NUMBER(9,2),
      RETURNED_AMOUNT         NUMBER(9,2),
      NETCASH                 NUMBER(12,2),
      TENDER_CODE             VARCHAR2(4 BYTE),
      MULT_RCPT               VARCHAR2(1 BYTE),
      SPLIT_TENDER            VARCHAR2(1 BYTE),
      RTN_WITH_PURCHASE       VARCHAR2(1 BYTE),
      RTN_WITH_RCPT           VARCHAR2(1 BYTE),
      REASON_CODE             VARCHAR2(4 BYTE),
      PASSWORD                VARCHAR2(10 BYTE),
      RINGTIME                DATE,
      CUST_NUMBER             VARCHAR2(12 BYTE),
      CUST_ID                 VARCHAR2(50 BYTE),
      ZIP_CODE                NUMBER,
      POSTAL_CODE             VARCHAR2(9 BYTE),
      PV_TIME_LAPSE           NUMBER,
      ORIG_STORE_NBR          NUMBER,
      ORIG_TRAN_DATE          DATE,
      ORIG_TRAN_TYPE          VARCHAR2(4 BYTE),
      ORIG_TERM_NBR           NUMBER,
      ORIG_TRAN_NBR           NUMBER,
      ORIG_SALE_AMT           NUMBER(12,2),
      ORIG_TENDER_CODE        VARCHAR2(4 BYTE),
      ORIG_CLERK_CODE         VARCHAR2(15 BYTE),
      PREV_TRAN_TYPE          VARCHAR2(4 BYTE),
      PREV_SUB_TRAN_TYPE      VARCHAR2(4 BYTE),
      GIFT_REGISTRY_ID        VARCHAR2(25 BYTE),
      NO_OF_ITEMS             NUMBER,
      TAX_EXEMPT_ID           VARCHAR2(18 BYTE),
      TRAN_RINGTIME           NUMBER,
      AUDITED                 VARCHAR2(1 BYTE),
      BATCH_VERSION           NUMBER(9,2),
      BATCH_SOURCE            VARCHAR2(5 BYTE),
      CREATE_DATE             DATE,
      CREATE_ID               VARCHAR2(32 BYTE),
      CREATE_PROC             VARCHAR2(32 BYTE),
      MOD_DATE                DATE,
      MOD_ID                  VARCHAR2(32 BYTE),
      MOD_PROC                VARCHAR2(32 BYTE),
      TERMINAL_GROUP          NUMBER,
      USER_DEF_1              NUMBER,
      USER_DEF_2              NUMBER,
      USER_DEF_3              NUMBER,
      USER_DEF_4              NUMBER(12,2),
      USER_DEF_5              NUMBER(12,2),
      USER_DEF_6              NUMBER(12,2),
      USER_DEF_7              VARCHAR2(50 BYTE),
      USER_DEF_8              VARCHAR2(50 BYTE),
      USER_DEF_9              VARCHAR2(50 BYTE),
      MANAGER_NUMBER          VARCHAR2(15 BYTE),
      MANAGER_REASON_CODE     VARCHAR2(10 BYTE),
      MANAGER_SWIPED          VARCHAR2(1 BYTE),
      PHONE_NO                NUMBER(11),
      KCPOS_KTH_USER_101      NUMBER,
      KCPOS_KTH_USER_102      NUMBER,
      KCPOS_KTH_USER_103      NUMBER,
      KCPOS_KTH_USER_104      NUMBER,
      KCPOS_KTH_USER_105      NUMBER,
      KCPOS_KTH_USER_106      NUMBER,
      KCPOS_KTH_USER_107      NUMBER,
      KCPOS_KTH_USER_108      NUMBER,
      KCPOS_KTH_USER_109      NUMBER,
      KCPOS_KTH_USER_110      NUMBER,
      KCPOS_KTH_USER_201      NUMBER(12,2),
      KCPOS_KTH_USER_202      NUMBER(12,2),
      KCPOS_KTH_USER_203      NUMBER(12,2),
      KCPOS_KTH_USER_204      NUMBER(12,2),
      KCPOS_KTH_USER_205      NUMBER(12,2),
      KCPOS_KTH_USER_206      NUMBER(12,2),
      KCPOS_KTH_USER_207      NUMBER(12,2),
      KCPOS_KTH_USER_208      NUMBER(12,2),
      KCPOS_KTH_USER_209      NUMBER(12,2),
      KCPOS_KTH_USER_210      NUMBER(12,2),
      KCPOS_KTH_USER_301      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_302      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_303      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_304      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_305      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_306      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_307      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_308      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_309      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_310      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_401      DATE,
      KCPOS_KTH_USER_402      DATE,
      KCPOS_KTH_USER_403      DATE,
      DISC_TOTAL              NUMBER(9,2)
    CREATE INDEX REX_HEAD_EXTRACT_NDX ON REX_HEAD_EXTRACT
    (REX_SEQ_NBR, REVISION_NUMBER, STORE_NUMBER, TRAN_DATE, TERMINAL_NUMBER, TRAN_NUMBER)-- Create table DDL for target table TRAN_HEAD
    CREATE TABLE NAVISTOR.KCPOS_TRAN_HEADER_BASE
      TRAN_SEQ_NBR            NUMBER(12),
      ORG_NUMBER              NUMBER,
      STORE_NUMBER            NUMBER,
      TRAN_DATE               DATE,
      TERMINAL_NUMBER         NUMBER,
      TRAN_NUMBER             NUMBER,
      TRAN_TIME               DATE,
      BATCH_NUMBER            VARCHAR2(8 BYTE),
      BATCH_TYPE              VARCHAR2(4 BYTE),
      TRAN_TYPE               VARCHAR2(4 BYTE),
      SUB_TRAN_TYPE           VARCHAR2(4 BYTE),
      CLERK_CODE              VARCHAR2(15 BYTE)     NOT NULL,
      TRAN_TAXABLE_AMOUNT     NUMBER(12,2),
      TRAN_TAX_TOTAL          NUMBER(12,2),
      TRAN_GROSS_TOTAL        NUMBER(12,2),
      COUP_TOTAL              NUMBER(9,2),
      MKD_TOTAL               NUMBER(9,2),
      EMPLOYEE_NUMBER         VARCHAR2(15 BYTE),
      EMPLOYEE_NAME           VARCHAR2(40 BYTE),
      TRAN_ALTTAXABLE_AMOUNT  NUMBER(12,2),
      TRAN_ALTTAX_TOTAL       NUMBER(12,2),
      SALE_AMOUNT             NUMBER(9,2),
      RETURN_AMOUNT           NUMBER(9,2),
      RETURNED_AMOUNT         NUMBER(9,2),
      NETCASH                 NUMBER(12,2),
      TENDER_CODE             VARCHAR2(4 BYTE),
      MULT_RCPT               VARCHAR2(1 BYTE),
      SPLIT_TENDER            VARCHAR2(1 BYTE),
      RTN_WITH_PURCHASE       VARCHAR2(1 BYTE),
      RTN_WITH_RCPT           VARCHAR2(1 BYTE),
      REASON_CODE             VARCHAR2(4 BYTE),
      PASSWORD                VARCHAR2(10 BYTE),
      RINGTIME                DATE,
      CUST_NUMBER             VARCHAR2(12 BYTE),
      CUST_ID                 VARCHAR2(50 BYTE) ENCRYPT USING 'AES256' NO SALT,
      ZIP_CODE                NUMBER,
      POSTAL_CODE             VARCHAR2(9 BYTE),
      PV_TIME_LAPSE           NUMBER,
      ORIG_STORE_NBR          NUMBER,
      ORIG_TRAN_DATE          DATE,
      ORIG_TRAN_TYPE          VARCHAR2(4 BYTE),
      ORIG_TERM_NBR           NUMBER,
      ORIG_TRAN_NBR           NUMBER,
      ORIG_SALE_AMT           NUMBER(12,2),
      ORIG_TENDER_CODE        VARCHAR2(4 BYTE),
      ORIG_CLERK_CODE         VARCHAR2(15 BYTE),
      PREV_TRAN_TYPE          VARCHAR2(4 BYTE),
      PREV_SUB_TRAN_TYPE      VARCHAR2(4 BYTE),
      GIFT_REGISTRY_ID        VARCHAR2(25 BYTE),
      NO_OF_ITEMS             NUMBER,
      TAX_EXEMPT_ID           VARCHAR2(18 BYTE),
      TRAN_RINGTIME           NUMBER,
      AUDITED                 VARCHAR2(1 BYTE),
      BATCH_VERSION           NUMBER(9,2),
      BATCH_SOURCE            VARCHAR2(5 BYTE),
      CREATE_DATE             DATE,
      CREATE_ID               VARCHAR2(32 BYTE),
      CREATE_PROC             VARCHAR2(32 BYTE),
      MOD_DATE                DATE,
      MOD_ID                  VARCHAR2(32 BYTE),
      MOD_PROC                VARCHAR2(32 BYTE),
      TERMINAL_GROUP          NUMBER,
      USER_DEF_1              NUMBER,
      USER_DEF_2              NUMBER,
      USER_DEF_3              NUMBER,
      USER_DEF_4              NUMBER(12,2),
      USER_DEF_5              NUMBER(12,2),
      USER_DEF_6              NUMBER(12,2),
      USER_DEF_7              VARCHAR2(50 BYTE),
      USER_DEF_8              VARCHAR2(50 BYTE),
      USER_DEF_9              VARCHAR2(50 BYTE),
      MANAGER_NUMBER          VARCHAR2(15 BYTE),
      MANAGER_REASON_CODE     VARCHAR2(10 BYTE),
      MANAGER_SWIPED          VARCHAR2(1 BYTE),
      PHONE_NO                NUMBER(11),
      KCPOS_KTH_USER_101      NUMBER,
      KCPOS_KTH_USER_102      NUMBER,
      KCPOS_KTH_USER_103      NUMBER,
      KCPOS_KTH_USER_104      NUMBER,
      KCPOS_KTH_USER_105      NUMBER,
      KCPOS_KTH_USER_106      NUMBER,
      KCPOS_KTH_USER_107      NUMBER,
      KCPOS_KTH_USER_108      NUMBER,
      KCPOS_KTH_USER_109      NUMBER,
      KCPOS_KTH_USER_110      NUMBER,
      KCPOS_KTH_USER_201      NUMBER(12,2),
      KCPOS_KTH_USER_202      NUMBER(12,2),
      KCPOS_KTH_USER_203      NUMBER(12,2),
      KCPOS_KTH_USER_204      NUMBER(12,2),
      KCPOS_KTH_USER_205      NUMBER(12,2),
      KCPOS_KTH_USER_206      NUMBER(12,2),
      KCPOS_KTH_USER_207      NUMBER(12,2),
      KCPOS_KTH_USER_208      NUMBER(12,2),
      KCPOS_KTH_USER_209      NUMBER(12,2),
      KCPOS_KTH_USER_210      NUMBER(12,2),
      KCPOS_KTH_USER_301      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_302      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_303      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_304      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_305      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_306      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_307      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_308      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_309      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_310      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_401      DATE,
      KCPOS_KTH_USER_402      DATE,
      KCPOS_KTH_USER_403      DATE,
      DISC_TOTAL              NUMBER(9,2),
      RTA_RTN_AUTCOD          VARCHAR2(4 BYTE),
      RTA_RTN_COMMID          NUMBER,
      RTA_RTN_EVNTID          NUMBER,
      RTA_RTN_QTY             NUMBER,
      RTA_RTN_RCPT_SCAN       VARCHAR2(1 BYTE),
      RTA_RTN_REFUND_AMT      NUMBER(9,2),
      RTA_RTN_TYPE_CODE       VARCHAR2(4 BYTE),
      RTA_RTN_WITH_RCPT       VARCHAR2(1 BYTE),
      RTA_RTN_COUNT           INTEGER,
      SDEDVAL1                VARCHAR2(50 BYTE)
    )--sample data
    REX_SEQ_NBR,REVISION_NUMBER,DAY,RESA_TRAN_SEQ_NO,BUSINESS_DATE,TRAN_SEQ_NBR,ORG_NUMBER,STORE_NUMBER,TRAN_DATE,TERMINAL_NUMBER,
    TRAN_NUMBER,TRAN_TIME
    478,1,11,12024005,6/11/2012,,1,692,6/11/2012,155,5,6/11/2012 12:57:17 PM,
    479,1,11,12024006,6/11/2012,,1,692,6/11/2012,155,6,6/11/2012 2:01:51 PM,
    480,1,11,12024007,6/11/2012,,1,692,6/11/2012,155,7,6/11/2012 2:47:10 PM

    Assuming that SomeJavePgm is a Java stored function (not a Java program running outside the database) and that it takes as a parameter whatever data type CUST_ID is in TABLE_A (hopefully RAW but potentially VARCHAR2) and returns a string, you would call it just as you would a PL/SQL stored function
    INSERT INTO table_b( cust_id, <<other columns>> )
      SELECT SomeJavaPgm( a.cust_id ), <<other columns>>
        FROM table_a aIf SomeJavePgm is not a Java stored procedure, calling it from PL/SQL becomes much more complicated. You would need whatever machine hosts this program to expose an appropriate API (for example, a web service interface) that you could invoke via UTL_HTTP). You'd need to tell us what that API was, however.
    Justin

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • How To Pass Oracle Procedure Value using Tidal Oracle Database Job Definition to Tidal Variable

    how do i pass the parameter value from an oracle database tidal job to a tidal variable? for example i have this oracle db job that is defined to execute an oracle database procedure and i need to pass the parameter value to the tidal variable.
    SQL tab:
    begin
      procedure_get_user_info(<OracleUserVariable.1>);
    end;
    thanks,
    warren

    tesmcmd is a binary that sits in your TIDAL master installation bin directory. It takes options, one of which is varset which let's you set variable values.
    So you can run a system level script ( a unix example is given below) which can set values for group variables.
    Looking at your example you need to find a way to define OracleUserVariable.1
    Where does the value for this variable come from?
    Sample variable set script:
    GROUP_FILE_VAR=`echo $2 | sed -e 's/\.xml\.pgp/\.xml/'`
    tesmcmd varset -i $1 -n GROUP_FILE_XML -v $GROUP_FILE_VAR
    XSD_FILE_VAR=`echo $2 | sed -e 's/\.xml\.pgp/\.xsd/'`
    tesmcmd varset -i $1 -n GROUP_FILE_XSD -v $XSD_FILE_VAR
    And we call the job using
    setvar.sh <JobID..p> <Group.REQUEST_FILE>
    which are overrides from a file event.

  • How to get a list of values used in the WHERE filter of stored procedures and functions in SQL Server

    How can I get a list of values (one or more) used in the WHERE filter of stored procedures and functions in SQL Server?
    How can get a list of values as shown (highlighted) in the sample stored procedure below?
    ALTER PROC [dbo].[sp_LoanInfo_Data_Extract] AS
    SELECT   [LOAN_ACCT].PROD_DT,
                  [LOAN_ACCT].ACCT_NBR, 
                  [LOAN_NOTE2].OFCR_CD, 
                  [LOAN_NOTE1].CURR_PRIN_BAL_AMT, 
                  [LOAN_NOTE2].BR_NBR,
    INTO #Table1
    FROM
                    dbo.[LOAN_NOTE1],
                    dbo.[LOAN_NOTE2],
                    dbo.[LOAN_ACCT]
    WHERE
                    [LOAN_ACCT].PROD_DT = [LOAN_NOTE1].PROD_DT
                    and
                    [LOAN_ACCT].ACCT_NBR = [LOAN_NOTE1].ACCT_NBR
                    and
                    [LOAN_NOTE1].PROD_DT = [LOAN_NOTE2].PROD_DT
                    and
                    [LOAN_NOTE1].MSTR_ACCT_NBR = [LOAN_NOTE2].MSTR_ACCT_NBR
                    and
                    [LOAN_ACCT].PROD_DT = '2015-03-10'
                    and
                    [LOAN_ACCT].ACCT_STAT_CD IN
    ('A','D')
                    and
                    [LOAN_NOTE2].LOAN_STAT_CD IN
    ('J','Z')
    Lenfinkel

    Hi LenFinkel,
    May I know what is purpose of this requirement, as olaf said,you may parse the T-SQL code (or the execution plan), which is not that easy.
    I have noticed that the condition values in your Stored Procedure(SP) are hard coded and among them there is a date values, I believe some day you may have to alter the SP when the date expires. So why not declare 3 parameters of the SP instead hard coding?
    For multiple values paramter you can use a
    table-valued parameter. Then there's no problem getting the values.
    If you could elaborate your purpose, we may help to find better workaround.
    Eric Zhang
    TechNet Community Support

  • How to execute oracle stored procedure through php as externally?

    hi...
    i am searching for the way that how to execute oracle stored procedure through web service, i am using php and mysql, i have some stored procedures in oracale database, i want to execute them, from php, means the database will be remain mysql, and the stored procedures of oracle will be executed externally...
    Kind regards,
    Wilayat.

    Ok, so first of all this is a kind of strange question. Since Oracle and MYSQL can happily live side by side.
    Make sure you have the oracle client (instant or regular ) installed and OCI_8 is set up and working correctly in PHP. If it is, when you run the phpinfo() routine you will see oci_8 on there. IF PHP connects just fine from the command line yet apache wont connect check permissions and things like the LD_Library Path.
    Then in php, right along with your MySQL statements run Oracle Statements eg:
    <?php
    $OraDB = oci_connect(name,pass,tnsname);
    $MySQLdb = mysql_connect([parms]);
    $oraQueryText = "begin sp_some_proc([some parms]); end;" ;
    $mysqlQuery = " Some mysql Query";
    $oraQuery = oci_parse($OraDB,$oraQueryText );
    oci_execute($oraQuery);
    mysql_execute([parms]);
    ?>
    Use the standard fetch code to get data from either of them.
    If you cannot and I mean absolutely cannot get an admin to link in OCI_8 then you still have recourse although it will be tedious as hell. PHP allows you to exec calls to the OS. You still MUST make sure the Oracle Client is installed and that sqlplus runs from the command line. You will more then likely have to have a shell script written to do this as well, but maybe not as I have never tried it with the exception of capturing the return value of sqlplus and you will have to dig into sqlplus to get it to send its results to a file you can then parse with php.
    Good Luck!

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How to Execute a Remote Procedure in Portal using Database Link

    Hi,
    I followed the instructions to create a Portal form for a remote procedure. But I am encountering the following error. Can someone advise what may be the cause?
    Failed to execute - Missing string(create_package_body) language(us) domain (wwv) sub_domain (wwv_builder) (WWV-04300)
    ORA-04020: deadlock detected while trying to lock object PUBLIC.PORTLET_SCHEMA (WWV-11230)
    Failed to parse as PORTAL - (WWV-08300)
    PURPOSE
    How to execute a remote procedure in Portal using Database Link.
    DESCRIPTION
    This procedure assumes that you have two databases, one of which is remote, and Portal is configured in the other.
    Remote Database A:
    ==================
    1) Create a procedure as follows: Create or Replace PROCEDURE SCOTT.ADD_TWO_VALUES ( v_one IN NUMBER, v_two IN NUMBER, v_result OUT NUMBER) as begin v_result :=v_one+v_two; end; 2) Grant execute privileges to PUBLIC on the procedure.
    Database B (where Portal is configured): ========================================
    1) Create a public database link and choose to connect as a specific user (say SYSTEM). By default, in an Oracle 8i database, the "global_names" parameter in initSID.ora (or init.ora) file is set to "true". This Global Naming parameter enforces that a dblink has the same name as the database it connects to. Therefore, if the remote global database (A) name is "ora8.acme.com" then the database link should also be named as "ora8.acme.com".
    2) Create a synonym for the procedure in Database A. Make sure you fully qualify the procedure name in the remote database (like SCOTT.ADD_TWO_VALUES).
    3) Create a dynamic page to execute the procedure. The ORACLE tags in the dynamic page will look similar to the following: <ORACLE> DECLARE v_total NUMBER; BEGIN ADD_TWO_VALUES(:v_one,:v_two, v_total); htp.p('The total is => '); htp.p('<input type="TEXT" VALUE='||v_total||'>'); htp.para; htp.anchor('http://<machine.domain:port#>/pls/portal30/SCOTT.DYN_ADD_TWO_VALUES.show_parms', 'Re-Execute Procedure'); END; </ORACLE>
    4) Portal does not have an option to create a form based on a synonym. Therefore, if you want to create a form instead of a dynamic page, create a wrapper procedure and then create a form based on this procedure. For example: Create or Replace PROCEDURE PORTAL30.ADD_TWO_VALUES_PR ( v_one IN NUMBER, v_two IN NUMBER, v_total OUT NUMBER) as begin add_two_values(v_one, v_two, v_total); end;
    5) Grant execute privileges to PUBLIC on the procedure.

    hello...
    any input will welcomed... Thanks..

  • How do I pass a null value to the reportDocument?

    I'm using CR 2008 and VS 2005. 
    I am using a stored procedure as the datasource for one of my report, which we run using the C# API.   The stored procedure is expecting a NULL in certain cases and I find I cannot pass a NULL with my current code:
    // Here I get the parameter
    // If we are dealing with an empty string or a NULL value, let's give it
                            // a value of a space so that Crystal's DLLs don't choke.
                            if ((value.Length == 0) || (value == "NULL"))
                                value = " ";
                            arrParams.Add(value);
    Object strParam = arrParams<i>;
    this.reportDocument1.SetParameterValue(num, strParam);
    The stored procedure parameter type is INT so in the report it shows up as NUMBER.
    How do I get a NULL value to the stored procedure?
    Thanks.

    See if this does the trick:
    Dim crParameterDiscreteValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
    crParameterDiscreteValue.Value = Nothing
    C# would look something like;
    CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue;
    crParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
    crParameterDiscreteValue.Value = null;
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • How can I get the element value with namespace?

    I tried to get a element value in xml has namespace but i can't.
    I removed the namespace, i can get a element value.
    How can i get a element value with namespace?
    --1. Error ----------- xml ------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    *<TaxInvoice xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0 http://www.kec.or.kr/standard/Tax/TaxInvoiceSchemaModule_1.0.xsd">*
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    --2. sucess ----------- xml ---------remove namespace---------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <TaxInvoice>
    <ExchangedDocument>
    <IssueDateTime>20110810133213</IssueDateTime>
    <ReferencedDocument>
    <ID>318701-0002</ID>
    </ReferencedDocument>
    </ExchangedDocument>
    <TaxInvoiceDocument>
    <IssueID>201106294100</IssueID>
    <TypeCode>0101</TypeCode>
    <IssueDateTime>20110810</IssueDateTime>
    <PurposeCode>02</PurposeCode>
    </TaxInvoiceDocument>
    <TaxInvoiceTradeLineItem>
    <SequenceNumeric>1</SequenceNumeric>
    <InvoiceAmount>200000000</InvoiceAmount>
    <TotalTax>
    <CalculatedAmount>20000000</CalculatedAmount>
    </TotalTax>
    </TaxInvoiceTradeLineItem>
    </TaxInvoice>
    ---------- program ------------
    procedure insert_table
    l_clob clob,
    wellformed out boolean,
    error out varchar2
    is
    l_parser dbms_xmlparser.Parser;
    xmldoc xmldom.domdocument;
    l_doc dbms_xmldom.DOMDocument;
    l_nl dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    l_root DBMS_XMLDOM.domelement;
    l_node DBMS_XMLDOM.domnode;
    l_node2 DBMS_XMLDOM.domnode;
    l_text DBMS_XMLDOM.DOMTEXT;
    buf VARCHAR2(30000);
    xmlparseerror exception;
    TYPE tab_type is Table of xml_upload%ROWTYPE;
    t_tab tab_type := tab_type();
    pragma exception_init(xmlparseerror, -20100);
    l_node_name varchar2(300);
    begin
    l_parser := dbms_xmlparser.newParser;
    l_doc := DBMS_XMLDOM.newdomdocument;
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    l_n := dbms_xmldom.makeNode(l_doc);
    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');
    FOR cur_tax In 0..dbms_xmldom.getLength(l_nl) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl, cur_tax);
    t_tab.extend;
    t_tab(t_tab.last).ed_id := '5000000';
    dbms_xslprocessor.valueOf(l_n, 'IssueID/text()', t_tab(t_tab.last).tid_issue_id);
    dbms_xslprocessor.valueOf(l_n, 'TypeCode/text()', t_tab(t_tab.last).tid_type_code);
    END LOOP;
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO xml_upload VALUES t_tab(i);
    COMMIT;
    dbms_xmldom.freeDocument(l_doc);
    wellformed := true;
    exception
    when xmlparseerror then
    --xmlparser.freeparser(l_parser);
    wellformed := false;
    error := sqlerrm;
    end insert_table;

    l_nl := dbms_xslprocessor.selectNodes(l_n, '/TaxInvoice/TaxInvoiceDocument');try to change as follow
    l_nl := dbms_xslprocessor.selectnodes(l_n,'/TaxInvoice/TaxInvoiceDocument','xmlns="urn:kr:or:kec:standard:Tax:ReusableAggregateBusinessInformation:1:0"');Edited by: AlexAnd on Aug 17, 2011 12:36 AM

  • Need an Example for How to call a Stored Procedure using DBAdapter

    Hi
    I am trying to invoke a stored procedure in Oracle Database using DB Adapter. I have successfully invoked and when i try to run it i got the following error.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ExecuteScript' failed due to:
    Stored procedure invocation error.
    Error while trying to prepare and execute the RESONANCEDEMO.SP_QUERY API.
    An error occurred while preparing and executing the RESONANCEDEMO.SP_QUERY API. Cause: java.sql.SQLSyntaxErrorException: ORA-00917: missing comma
    ORA-06512: at "RESONANCEDEMO.SP_QUERY", line 7
    ORA-06512: at line 1
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API.
    This exception is considered not retriable, likely due to a modelling mistake.
    To classify it as retriable instead add property nonRetriableErrorCodes with value "-917" to your deployment descriptor (i.e. weblogic-ra.xml).
    To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.
    All properties are integers.
    I am trying to have a Out Parameter in my Procedure. Please provide me an example on how to invoke a Stored Procedure using Out Paramter using DB Adapter.

    Hi,
    It looks more like an Oracle error and not within the DbAdapter.
    Try to test first your procedure from PL/SQL or other developer you are using.
    Arik

  • How to execute a SQL procedure in UNIX

    How to execute a SQL procedure in UNIX

    Check this out..
    -Sri
    << a.sql >>
    create or replace procedure junk(nout out varchar2) is
            x varchar2(20);
    begin
            select 'Sam' into x
            from dual;
            nout := x;
    end;
    << Shell script >>
    sqlplus -s / << DOC
    scott/tiger
    variable x varchar2(20);
    set autoprint on
    @a.sql
    begin
    junk(:x);
    end;
    exit
    DOC
    << Execution of Shell SCript >>
    # sh b.sh
    Procedure created.
    PL/SQL procedure successfully completed.
    X
    Sam

Maybe you are looking for