Need an example of loop with sql statement in shell script values

Hello

I have to present a simultaneous program to each line of the table through script shell (only).

The table has all the parameters required to pass to the concurrent program.

I have trouble in a loop with the lines of sql statement results.

Could someone give me an example of a shell script with a loop with the sql statement values.

appreciate your time and your help.

Thank you

Ganesh

Hello

Here is a guide using 3 parameters:

{

sqlplus-s $OA_USR / $OA_PWD<>

SET THE OFF POSITION;

SET FEEDBACK OFF;

SET LINESIZE 300;

SELECT param1, param2, param3

Of your_param_table;

ENDOFSQL

} | while reading line

do

If ['$line'] # line non-NULL

then

set $line

param1 = "$1."

param2 = "$2."

param3 = "$3."

# Pass parameters to a script, sql more

sqlplus-s $apps_usr / $apps_pwd @SUBMIT_CONC_PROG.sql $param1 $param2 $param3

FI

fact

}

In your SQL * more script you run 3 parameters into variables:

declare

VARCHAR2 (10) param1: = ' & &1';

VARCHAR2 (10) param2: = ' & &2';

param3 varchar2 (10): = ' & &3';

.....

Tags: Database

Similar Questions

  • Coil in SQL * Plus with SQL statements

    Hi guru,.

    Greetings.

    I work 10 R2 Solaris oracle

    I have the file new.sql having count (*) select statements of 10000 +. I want the result with the sql statement in the coil. How?

    New.SQL

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE;

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE_GROUP;

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE_GROUP_TR;

    ....

    ....

    Coil new.txt

    @new.sql

    spool off

    Spooled results is

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE;

    COUNT (*)

    ----------

    199

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE_GROUP;

    COUNT (*)

    ----------

    220

    SELECT COUNT (*) IN XYZ. CPEP_ARTICLE_GROUP_TR;

    COUNT (*)

    ----------

    0

    but I'm getting plain County, I need select statement and respective numeration.

    How to get it. could you help on this.

    Thank you

    REDA

    Like this.

    Select "double ==>" | Count (*) twice;

  • Sql statement variable gives several values

    Hello

    I have a variable that has sql statement and it gives several values and I want to use this variable in one of the filter of interface condition to filter the data in the source table (which has millions of records).

    some could let me know the best method to achieve this scenario.

    Appreciate your help.

    You are right. Yesterday, I don't think in this case where the data could be from a different server. But I completely forgot today.
    Ok. Here you can find how to use sys_connect_by_path

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:907278700346567560

    Be careful with the size because I think that there is a limit to what can contain the variable ODI.

    After you have assessed the variable is how it could be used in the filter

    ITEM_TYPE_ID IN (#var_csv_id_list)

  • Need help with some cluster power shell scripts

    Guys,

    I need help with 2 scripts.

    Text 1.

    I need a power shell script that will get all the virtual machine in a specific cluster.  Virtual machine names as well as the number of processors, output allocated RAM and size of CSV file.

    Text 2.

    I need a script that will get all data warehouses in a specific cluster and store name data as well as the amounf of free space for a CSV output.

    Thanks in advance guys.

    Greetings, @peter79 -.

    For the first part:

    Get-Cluster myClusterName | Get-VM | Select-Object Name, MemoryMB, NumCpu | Export-Csv -NoTypeInformation c:\temp\myVMInfo.csv
    

    And for the second, how about:

    Get-Cluster myClusterName | Get-VMHost | Get-Random | Get-Datastore | Select-Object name, FreeSpaceMB, CapacityMB | Export-Csv -NoTypeInformation c:\temp\myDaterstoreInfo.csv
    

    The first would be quite a bit faster by using Get - view instead of Get - VM.  It would be like:

    ## get an array of VM View objects with just the desired/needed properties
    $arrVMViews = Get-View -ViewType VirtualMachine -SearchRoot (Get-Cluster myClusterName).MoRef -Property Config.Hardware,Name
    ## make the two filters for displaying the desired info
    $hshCPUCountFilter = @{n="NumCPUs"; e={$_.Config.Hardware.NumCPU}}
    $hshMemAmtFilter = @{n="MemoryMB"; e={$_.Config.Hardware.MemoryMB}}
    ## display the info, and export to CSV
    $arrVMViews | Select-Object name, $hshCPUCountFilter, $hshMemAmtFilter | Export-Csv -NoTypeInformation c:\temp\myVMInfo.csv
    

    Enjoy.

  • will not appear sql statemnt in shell script

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Hello

    2650697 wrote:

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Your postal code.  It is very difficult to tell what you're doing wrong without knowing what you are doing.

    You can have SQL statements directly in your shell script.  They must be in a script by themselves, said fubar.sql, and shell script must contain

    @fubar

    instead of real SQL statements.

  • pl/sql to java shell script

    This issue crosses many boundaries, but it begins with PL/SQL, and I hope that there is sufficient expertise here in order to cover the basics.

    System: Oracle 11.2.0.1.0 on Oracle 5, 64 - bit Linux

    I have a PL/SQL, java appeal procedure, which in turn calls a shell script. I put a few diagnostic output in the shell script, the redirection of stdout to a file in / tmp. running the script from the command line works perfectly. When it is called by procedures, no output.

    Here is the 'chain of traceability', somehow...

    In the PL/SQL:
    Host_Command (p_command => v_command||v_control_file||v_orasid);
    where the variable v_command = /opt/u01/app/oracle/admin/control/sqlldr3_test.script


    So this is 'Host_command', the whole procedure procedure:
    CREATE OR REPLACE  PROCEDURE "DW"."HOST_COMMAND" (p_command  IN  
        VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    And the shell script /opt/u01/app/oracle/admin/control/sqlldr3_test.script:
    #!/bin/ksh
    export trcfle=/tmp/edstest.$$
    export ORACLE_SID=$2
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dwdev
    export PATH=$PATH:/u01/app/oracle/product/11.2.0/dwdev/bin
    export ORACLE_BASE=/u01/app/oracle
    export SQLLDR_CONTROLFILE=$1
    #
    echo input parms are $* >> $trcfle
    echo environment is: >> $trcfle
    env|grep -i ORACLE|grep -v grep|sort >> $trcfle
    #
    exit
    but in the end, there is no /tmp/edstest.* file
    oracle$ ls -ltr /tmp/eds*
    ls: /tmp/eds*: No such file or directory
    oracle$
    open to all ideas.

    I cut things down to their bases, but with the exception of the line of the high level process, the code above is finished... is that my test cut original scripts to exactly what is show. Requriement of business is to take existing scripts and remove some of the stuff that is hard coded, allowing procedures move from dev to qa to prod without hardcoded values unique to each environment.

    I'm very comfortable with PL/SQL and more with shell scripts, but the java link is a black hole for me.

    When the proc of Java runs the external command, a child process of Unix/Linux is created for it. This process inherits the environment settings of the parent process - that would be a dedicated server process, a work process or shared in the pool of the MTS server process.

    These processes have parameters of environment of bare bones and something fundamental that + $PATH + should not be approved as being valid and usable.

    If the Java code should fully qualify the path to the executable file to run.

    Java code should do 2 things - stdout (and stderr if possible) back to the appellant to PL/SQL as vacrhar2 of the parameters out. And return the exit code of the child process.

    They help a lot in troubleshooting why an outgoing external call failed.

    We use these external calls widely enough (through a number of interfaces, treatments to distance running and pulling on the release of data by the latter in the database). All driven from PL/SQL using the proc of Java to make an outgoing call. If the basics are working-, but there seems to be a constant learning and troubleshooting curve to follow to get this working in a robust way.

  • Need help with SQL statement

    So I am new to SQL and ORACLE. I need to know how to do the commands below in a single statement. I did it in two here, but I have no idea how do it in one. Any ideas?

    ALTER TABLE books
    ADD Catcode VARCHAR2 (3);

    ALTER TABLE books
    ADD CONSTRAINT books_catcode_fk FOREIGN KEY (catcode)
    REFERENCES (catcode) category;

    Any help appreciated ^^
    SQL> ed
    Wrote file afiedt.buf
    
      1  alter table books
      2    add( catcode varchar2(3),
      3         constraint books_catcode_fk
      4            foreign key( catcode )
      5*        references category( catcode ) )
    SQL> /
    
    Table altered.
    

    Justin

  • Update a table in a loop with a table, not a single value

    Hey everybody,

    I'm new to the Forum, but I do LabVIEW for almost a year now.  I work to make my code much more simple, but I encountered a problem that I can't seem to overcome.

    Say I want to graph a numeric control.  I'm updating the digital control to 5 and 5 graphic updates.  Whenever my loop is executed, the 5 is reloti.  Easy to see that the updates fast loop, my FP will have too much processing time.  How to pass control to an array and only draw table each, for example, 10 iterations of the While loop?  I thought using the 'i' in the While loop and a structure case (use is equal to? 10 as the true to update case).  That doesn't really seem to be the answer... Any help is appreciated.

    Hi, Mr. Bass,.

    Thank you for your post and welcome to the forums of NOR.

    If you want to update every 10 iterations, for example, you can use "Quotient and remainder" LabVIEW function found in the palette of the digital - divide the number of iteration by 10 and check the rest, if it is equal to zero then you're on the 10th, 20th, 30th, etc the iteration. You can then use a case structure and write your chart in the case of true, with the condition is true, if the remainder is zero.

    Let me know how you go with this method.

    Thank you

  • Select SQL statement - See all the value of the range of month of entry

    Hi all

    I have a vision that is a union of other views
    But the description of the view is as below
    desc dashboard_monthly_view
    Name                           Null Type         
    ------------------------------ ---- ------------ 
    MONTHS                              VARCHAR2(17) 
    NUM_DEPENDENT_IN_ASSESSMENT         NUMBER       
    NUM_REFERRED_AODTC                  NUMBER       
    NUM_AT_DETERMINATION_HEARING        NUMBER       
    NUM_ACCEPTED                        NUMBER       
    NUM_NOT_ACCEPTED                    NUMBER       
    NUM_EXITED_SUCCESS                  NUMBER       
    AVERAGE_DAY_TO_EXIST                NUMBER       
    NUM_EXITED_UNSUCCESS                NUMBER       
    AVERAGE_DAY_TO_EXIST_UNSUCCESS      NUMBER       
    COURT_NAME                          VARCHAR2(9)  
    -current data in the view
    MONTHS            NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS COURT_NAME 
    ----------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ ---------- 
    AUG 2012          1                           0                      0                            0                      0                      0                      0                      0                      0                              AAA   
    OCT 2012          8                           1                      3                            1                      1                      1                      44                     1                      4                              AAA   
    SEP 2012          2                           0                      2                            2                      0                      0                      0                      0                      0                              AAA   
    *UNDEFINED*       0                           11                     7                            1                      1                      0                      0                      1                      0                              AAA   
    NOV 2012          0                           0                      0                            0                      0                      0                      0                      1                      54                             BBB  
    OCT 2012          4                           1                      2                            1                      1                      1                      9                      0                      0                              BBB  
    SEP 2012          1                           0                      0                            0                      0                      1                      14                     0                      0                              BBB  
    *UNDEFINED*       0                           5                      4                            1                      0                      0                      0                      1                      0                              BBB  
    AUG 2012          1                           0                      0                            0                      0                      0                      0                      0                      0                              COMBINED   
    NOV 2012          0                           0                      0                            0                      0                      0                      0                      1                      54                             COMBINED   
    OCT 2012          12                          2                      5                            2                      2                      2                      26.5                   1                      4                              COMBINED   
    SEP 2012          3                           0                      2                            2                      0                      1                      14                     0                      0                              COMBINED   
    *UNDEFINED*       0                           16                     11                           2                      1                      0                      0                      2                      0                              COMBINED   
    
     13 rows selected 
     
    -My select query is
     DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Nov 2012";
    with all_months as
    ( select to_char(which_month, 'MON YYYY') month from
      (select
            add_months(to_date('&startmonth','MON YYYY'), rownum-1) which_month
        from
            all_objects
        where
            rownum <= months_between(to_date(NVL('&endmonth', '&startmonth'),'MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
        order by
            which_month )
    )
    
    select nvl(months, '**ALL**')    AS "MONTHS", TO_DATE(MONTHS, 'MON YYYY') AS MONTH_SORT
        , sum(num_dependent_in_assessment)    AS num_dependent_in_assessment
        , sum(num_referred_aodtc)    AS num_referred_aodtc
        , sum(num_at_determination_hearing) as num_at_determination_hearing
        , sum(num_accepted) AS num_accepted
        , sum (num_not_accepted) AS num_not_accepted
        , sum(num_exited_success) as num_exited_success
        , sum(average_day_to_exist) as average_day_to_exist
        , sum(num_exited_unsuccess) as num_exited_unsuccess
        , sum (average_day_to_exist_unsuccess) as average_day_to_exist_unsuccess
    from 
      DASHBOARD_MONTHLY_VIEW    right outer join all_months
      on DASHBOARD_MONTHLY_VIEW.months = all_months.month
    --where months in (select month from all_months)
      and upper(court_name) like 'AAA'
    group by (months)
    order by month_sort
     
    - And the result is
    MONTHS            MONTH_SORT                NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS 
    ----------------- ------------------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ 
    AUG 2012          01/08/12                  1                           0                      0                            0                      0                      0                      0                      0                      0                              
    SEP 2012          01/09/12                  2                           0                      2                            2                      0                      0                      0                      0                      0                              
    OCT 2012          01/10/12                  8                           1                      3                            1                      1                      1                      44                     1                      4                              
    **ALL**                                                                                                                                                                                                                                                                       
    
     
    -The requirement of results I have to produce is
    MONTHS            MONTH_SORT                NUM_DEPENDENT_IN_ASSESSMENT NUM_REFERRED_AODTC     NUM_AT_DETERMINATION_HEARING NUM_ACCEPTED           NUM_NOT_ACCEPTED       NUM_EXITED_SUCCESS     AVERAGE_DAY_TO_EXIST   NUM_EXITED_UNSUCCESS   AVERAGE_DAY_TO_EXIST_UNSUCCESS 
    ----------------- ------------------------- --------------------------- ---------------------- ---------------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------ 
    AUG 2012          01/08/12                  1                           0                      0                            0                      0                      0                      0                      0                      0                              
    SEP 2012          01/09/12                  2                           0                      2                            2                      0                      0                      0                      0                      0                              
    OCT 2012          01/10/12                  8                           1                      3                            1                      1                      1                      44                     1                      4                              
    NOV 2012          01/11/12                  0                           0                      0                            0                      0                      0                      0                      0                      0                          
    **ALL**
     
    On the tota (* EVERYTHING *) l, I tried to use the rollup but he total average too, which is not correct. I think the reason because he cannot read the form that was used to calculate the column.
    How can I fix this, should I create, select another below one, with the sum of each column and the average for the other columns.
    Also, the business analyst want to show all the months between the start and end of the month.
    I used the right outer join, but apparently does not produce the right result.
    If anyone of you have any ideas, please advise.
    We use Oracle 11 g, it is a select statement for an Oracle APEX report.
    The APEX version is 4.0.2. I'm a junior developer of the APEX and I still have to learn a lot about SQL Oracle analytic function.

    Thank you very much in advance.

    Ann

    Hi, Ann.

    Ann586341 wrote:
    ... I created a table to contain a simplified version of this view

    Thank you. It is much easier to work with.

    ... My query is

    DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Nov 2012";
    with all_months as
    ( select to_char(which_month, 'MON YYYY') month from
    (select
    add_months(to_date('&startmonth','MON YYYY'), rownum-1) which_month
    from
    all_objects
    where
    rownum <= months_between(to_date(NVL('&endmonth', '&startmonth'),'MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
    order by
    which_month )
    )
    , tbl_dashboard_active as
    ( select *
    from tbl_dashboard_monthly
    where months != '**UNDEFINED**' )
    
    select tbl.months    AS "MONTHS" --, TO_DATE(tbl.MONTHS, 'MON YYYY') AS MONTH_SORT
    , tbl.num_hearing
    , tbl.num_exited_success
    , tbl.avg_day_success_exist
    , tbl.num_exited_unsuccess
    , tbl.avg_day_unsuccess_exist
    
    from
    tbl_dashboard_active  tbl right outer join all_months am
    on tbl.months = am.month
    and upper(tbl.court_name) like 'BBB'
    
    UNION ALL
    
    select 'ALL'    AS "TOTAL"
    , SUM(tbl.num_hearing)
    , SUM(tbl.num_exited_success)
    , round(AVG(tbl.avg_day_success_exist),2)
    , SUM(tbl.num_exited_unsuccess)
    , round(AVG(tbl.avg_day_unsuccess_exist),2)
    --order by to_date(am.month,'MON YYYY')
    
    from
    tbl_dashboard_monthly  tbl right outer join all_months am
    on tbl.months = am.month
    and upper(tbl.court_name) like 'BBB'
    

    - And the result I got

    MONTHS            NUM_HEARING NUM_EXITED_SUCCESS AVG_DAY_SUCCESS_EXIST NUM_EXITED_UNSUCCESS AVG_DAY_UNSUCCESS_EXIST
    ----------------- ----------- ------------------ --------------------- -------------------- -----------------------
    AUG 2012                    1                  0                     0                    0                       0
    OCT 2012                    1                  0                     0                    2                      35
    SEP 2012                    1                  0                     0                    0                       0 
    
    ALL                         3                  0                     0                    2                   11.67 
    

    I don't know why even I already filter all lines that the month is undefined, I still have a blank line in the result set.

    This is the line for November. You do an outer join, in order to ensure that each value of am.month is displayed, even if it does not match what anyone in tbl. When it does not match anything, then all the columns tbl is supposed to provide will be NULL. You decide to view tbl. months, which is one of the following columns will be NULL. You should display mod. monmth instead.

    But if I run for handset Court, I don't see this problem. The reason is that the Court combined have given for all four months?

    When you say "on behalf of the combined Court", do you mean the unconditional "upper (tbl.court_name) as"BBB "?
    If Yes, that would explain it.

    Also is it possible to list all the months between the start and end month assuring the user even if the statistics are 0.

    Once again, in the case of lines that are present, even if they do not have the status of outer join, all of these columns will be NULL. Use NVL to map these nulls to 0.

    and how to sort the month

    GROUP OF two expressions, which depend on each other: one for sorting and the other for display.
    For the sort expression, you can use months as a DATE. (It seems that you have tried this, but commented on the ORDER BY clause in your query is before the FROM clause.) The ORDER BY clause is always at the end of the query, after the FROM clause.)
    Another expression of sorting is the number you used to generate the first month. That's what I used below.

    Here's a way to get the results you requested:

    WITH   got_months    AS
    (
         SELECT     TO_DATE ('&startmonth', 'Mon YYYY')     AS startmonth_dt
         ,     TO_DATE ( NVL ( '&endmonth'
                         , '&startmonth'
                         )
                   , 'Mon YYYY'
                   )                    AS endmonth_dt
         FROM    dual
    )
    ,     all_months     AS
    (
         SELECT  rownum               AS month_num
         ,     TO_CHAR ( ADD_MONTHS ( m.startmonth_dt
                                , ROWNUM - 1
                             )
                   , 'MON YYYY'
                   )              AS months
         FROM        got_months  m
         CROSS JOIN  all_objects
         WHERE     ROWNUM <= 1 + MONTHS_BETWEEN ( m.endmonth_dt
                                              , m.startmonth_dt
                                  )
    )
    SELECT    NVL ( am.months
               , 'All'
               )                              AS months
    ,        SUM (NVL (tbl.num_hearing,             0))     AS num_hearing
    ,        SUM (NVL (tbl.num_exited_success,      0))     AS num_exited_success
    ,       AVG (NVL (tbl.avg_day_success_exist,   0))     AS avg_day_success_exist
    ,       SUM (NVL (tbl.num_exited_unsuccess,    0))     AS num_exited_unsuccess
    ,       AVG (NVL (tbl.avg_day_unsuccess_exist, 0))     AS avg_day_unsuccess_exist
    FROM              all_months          am
    LEFT OUTER JOIN      tbl_dashboard_monthly  tbl  ON  am.months           = tbl.months
                                           AND  UPPER (tbl.court_name) = 'BBB'
    GROUP BY  GROUPING SETS ( (am.month_num, am.months)
                              , ()
                   )
    ORDER BY  am.month_num
    ;
    

    Again, I used two GROUP BY expressions: one for sorting, the other for display. These depend on each other, that is, given one, you could derive from each other, and it is not sensible to dependent ROLLUP GROUP BY expressions like that, so I used GROUPING SETS ROLLUP instead, so it would be only 1 rank of great aggregate (in other words, 'all').

    Output:

    `                               AVG_                 AVG_
                         NUM_       DAY_      NUM_       DAY_
                 NUM_ EXITED_    SUCCESS   EXITED_  UNSUCCESS
    MONTHS    HEARING SUCCESS     _EXIST UNSUCCESS     _EXIST
    --------- ------- ------- ---------- --------- ----------
    AUG 2012        1       0          0         0          0
    SEP 2012        1       0          0         0          0
    OCT 2012        1       0          0         2         35
    NOV 2012        0       0          0         0          0
    All             3       0          0         2       8.75
    
  • SQL statement in Unix script

    Hello
    10 g R2 on AIX 6.1.

    in a shell script, I want to do:
    sqlplus user/password@mydb
    
    select * from mytable.
    How to do this?

    Thank you.

    sqlplus user/password@mydb<>
    Select * from myTable.
    output
    EXPRESSIONS OF FOLKLORE

  • Member not found when loading data with SQL

    Hello everyone:

    I created a cube map extract all information with SQL statements and it works perfectly. Now I'm trying to load data in the same way, but I can't.

    I created a view that returns data in this format:

    Dimension 1 < tab > axis 2 < tab > member... Member of dimension 5 < tab > measure 1 < tab > 2 < tab > measure 3

    I designed a new rule, indicating for each column in the dimension; and for each measure which specific member of dimension of accounts must be used. I have check and everything is ok, but when I try to load data, it does not work and tells me error:

    + "Data value [3.5] met before that all the selected Dimensions, [1] Records duly filled.
    + Essbase error unexpected 1003007 "+"

    If I get the names of the members with quotes (because they contain spaces, and it is perhaps the reason for the previous error, although the rule analysis correctly) with the SQL statement, when Essbase import, it deletes these quotes. I must use another symbol, and as a rule change this another symbol quotes. Is this normal? I know that this issue when importing formulas, but not here.

    Why in 'Dimension building' I don't have this problem with quotes?

    And when changing the symbols of quotes, this error occurs:

    + "Member x not found in the database" +. " But I check the Member and there are in general terms. What's wrong with that? »


    Thanks in advance

    Concerning

    Javier

    Published by: Javi M on 26-mar-2011 05:52

    Yes, the SQL files and data (of all kinds) are supported by more than one column of data. As you noted, you just point to the Member that represents the column.

    That said, I bet that if you look at your view/table and load the rule against your outline, I bet you find a dimension be mismapped, for example, you think that this column 4 points to the scenario, but you really repointe it produces and which purported to be the column 1, or you missed a dimension. Happens to me all the time.

    Kind regards

    Cameron Lackpour

  • Using a Bind Variable in the FROM of a SQL statement part?

    Hi all

    I have a problem, I am trying to execute a SQL statement. However, I need the FROM part of the SQL statement in a variable binding. This is because the end user will have to choose between 2 views of database.

    I tried this:
    Select CON_ID from: P23_DB_NAME where CON_LEGACY_ID =: P23_CONLEG_NO

    I had no chance. The error I got was,
    '+ The query cannot be parsed in the generator. If you believe that your request is
    syntactically correct, choose the generic "columns" box below the
    the source of the region without analysis.
    "ORA-00903: invalid table name +".
    What makes sence, but now I'm a little stuck.

    Does anyone have ideas for a workaround?

    Thanks in advance.
    -N.S.N.O.

    The example I gave you is quite simple. You must take some time to study it to see where you need to be very careful what put you where. Now, of course your example does not work becaues you have several errors. It will work for you:

    DECLARE
       x   VARCHAR2 (4000);
    BEGIN
       x := x || 'SELECT CON_ID FROM ';
       x := x || :p23_db_name;
       x := x || ' WHERE CON_LEGACY_ID = ' || :p23_conleg_no;
       RETURN (x);
    END;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • Component sql through shell script

    How to call a sql through UNIX shell script file?

    Rahul India wrote:

    export ORACLE_HOME=$ORACLE_BASE/product/10g
    
    cd $ORACLE_HOME
    set `sqlplus -s / <
    

    THIS SCRIPT IS OK?

    You will also need to set ORACLE_SID

    And I don't know why everyone puts the reference to sqlplus context of a 'set' assessment, nor why they put the reference to Scripture in a redirected input stream. What you need is

    sqlplus -s user/password  @r_100.sql
    

    And to make sure the environment is set correctly:

    export ORACLE_SID=whatever
    export ORAENV_ASK=NO
    . oraenv
    unset ORAENV_ASK=NO
    sqlplus -s user/password  @r_100.sql
    
  • Coil PL/SQL parameter value using shell script

    Hello

    I execute PL/SQL procedure using shell script. I want the value of parameter in a coil OUTPUT text file. to_msg is the IN OUT parameter in the script below. Is this possible?

    sqlplus test/***@db < < EOFSQL
    COIL Status.txt
    HEAD off SET
    SET SERVEROUTPUT ON
    declare
    to_msg varchar2 (8000): = 'status ';
    EXEC P_Status (to_msg);
    SPOOL off
    "exit";
    EOFSQL

    AravindhK wrote:
    Thanks for your reply. When I roll the result, sql statements is also copied to the text file. How can I eliminate the sql statements.

    What are the results when you do as below

    sqlplus-s

  • Need to find all the possible child records with SQL

    Hello - I am trying to find a way to solve the following with a sql statement:

    I have a table with columns, and the following values:
    Trans_Id   Parent_Trans_id
    1             null
    2             1
    3             2
    4             3
    So basically, 1 is the master parent and I need to bring all ranks, because they are all ultimately originated due to 1. How to write sql code to return all possible levels associated with parent_id = 1?

    I hope I'm communicate that effectively do this, but please let me know if it needs to be clarified.

    Any help is greatly appreciated...

    Thank you
    Christine

    Hi, Christine.

    I think you want to CONNECT BY, something like this:

    SELECT     *
    FROM     a
    START WITH     trans_id      = 1
    CONNECT BY     parent_trans_id      = PRIOR trans_id
    ;
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.
    See the FAQ forum {message identifier: = 9360002}
    You will find the answers better faster if you always provide this information whenever you post a question.

Maybe you are looking for

  • I must have multirow bookmarks!

    Since the update Firefox 33, the addon 'Multirow Bookmarks Toolbar Plus' shows only 2 rows! I have TO be able to have lines of 5 or more like I did until a few days ago! Pleass help!

  • Audio has recently stopped working on macbook pro 2014, Win7 x 64

    Material: Retina Macbook Pro mid 2014-15 "2.8 GHz 16 GB of RAM Software: Mac OS + installed bootcamp Windows 7 business N SP1 64-bit with latest updates attached to the field Audio worked absolutely the facility for a year or two. Just recently the s

  • Satellite L300 booted on battery but not on power supply

    I have a problem that has developed with a computer for daily use about 3 months ago. When the computer is connected to power at startup, the computer starts at halfway in Windows XP with the first XP screen and then it sounds like the disk hard knoc

  • About adding Ram

    Hi I want to add ram to my HP Pavilion Media Center a1340n PC What I see on my ram is this 1 G 2rx8 pc2-4200u-444-12.  I can't find all online.  What should I look for? Thank you

  • Refurbished or used 70-200mm?

    Wandering between these two choices. Whitch is better? Anyone used lens refurbished?