Help with pl /sql script

Hello everyone.
Can sb help me in creating the following script based on three tables:
id
col1
314
somevalue2
id
id1
col2
314
1
somevalue4
314
2
somevalue5
314
3
somevalue6
id
id1
id2
cod
qty
314
1
1
LTR
10
314
1
2
KG
20
314
2
1
LTR
40
The result should be like this:
id
id1
id2
cod_1
qty_1
cod2
qty_2
col1
col2
314
1
1
LTR
10
KG
20
somevalue2
somevalue4
314
2
1
LTR
40
somevalue2
somevalue5
Message was edited by: 933651

Hi,
here's my view to this problem. Perhaps need some adjusting in join conditions when data model and data is clearer
create table t1 (
  id number,
  col1 varchar2(10)
insert into t1 values (314, 'somevalue2');
create table t2 (
  id number,
  id1 number,
  col2 varchar2(10)
insert into t2 values (314, 1, 'somevalue4');
insert into t2 values (314, 2, 'somevalue5');
insert into t2 values (314, 3, 'somevalue6');
create table t3(
    id  number,
    id1 number,
    id2 number,
    cod varchar2(3),
    qty number
insert into t3 values (314, 1, 1, 'LTR', 10);
insert into t3 values (314, 1, 2, 'KG', 20);
insert into t3 values (314, 2, 1, 'LTR', 40);
with ltr as (
  select id, id1, id2, cod, qty  from
    select id, id1, id2, cod as code, cod, qty from t3
  pivot
    sum(qty) for code in ('LTR' as qty)
  where qty is not null
), kg as (
  select id, id1, id2, cod, qty  from
    select id, id1, id2, cod as code, cod, qty from t3
  pivot
    sum(qty) for code in ('KG' as qty)
  where qty is not null
select
  t2.id,
  t2.id1,
  ltr.id2,
  ltr.cod,
  ltr.qty,
  kg.cod,
  kg.qty,
  t1.col1,
  t2.col2
from t2 join ltr on (
  t2.id = ltr.id and t2.id1 = ltr.id1
) full join kg on (
  t2.id = kg.id and t2.id1 = kg.id1
) left join t1 on (
  t1.id = t2.id
order by id, id1
drop table t1 purge;
drop table t2 purge;
drop table t3 purge;
table T1 created.
1 rows inserted.
table T2 created.
1 rows inserted.
1 rows inserted.
1 rows inserted.
table T3 created.
1 rows inserted.
1 rows inserted.
1 rows inserted.
        ID        ID1        ID2 COD        QTY COD        QTY COL1       COL2  
       314          1          1 LTR         10 KG          20 somevalue2 somevalue4
       314          2          1 LTR         40                somevalue2 somevalue5
table T1 dropped.
table T2 dropped.
table T3 dropped.

Similar Messages

  • Help with T-SQL script. I cannot tell where is that line based on line number. Thx

    rrr

    If the error is indeed here, then try
    CAST(@KillDays * @VarianceFactorPrcnt * -0.24 AS INT)
    But in fact the value should be INT, not decimal for the DATEADD function.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Help with an SQL Query on the Logger

    We are running UCCE 8.5(3) and need help with an SQL query. When I run the below I would also like to see skill group information(name preferably)? Any help would be greatly appreciated!
    select * from dbo.t_Termination_Call_Detail where DateTime between '10-11-2012 00:00:00:00' and
    '10-11-2012 23:59:59:59'

    David, thanks for replying.  Unfortunitly I don't know enough about SQL to put that into a query and have it return data.  Would you be able to give an example on what the query would look like?

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • TestStand 2013 ships with invalid SQL scripts

    Hi all,
    I tried to submit this through the official support channel, but ran into this roadblock. So, I'm reporting the issue here.
    =================================================
    I wanted to set up TestStand to log results to an SQL Server 2008 R2 database. I followed the instructions at http://zone.ni.com/reference/en-XX/help/370052M-01/tsfundamentals/infotopics/database_logging/
    I tried to run C:\Program Files\National Instruments\TestStand 2013\Components\Models\TestStandModels\Database\SQL Server Create Generic Recordset Result Tables.sql However, SQL Server reported that the script contains syntax errors.
    To fix the issue, I had to modify the script (replace "//" with "--", and replace "~" with ";") before running it.
    It looks like other scripts in this folder have syntax errors too. Please fix the SQL scripts shipped with TestStand.

    Hey JKSH,
    Thanks for reporting this--we've filed an internal report for one of our developers to examine the syntax of our SQL files.
    In the meantime, it sounds like you were able to work around the issue by changing the characters in the scripts, but have you run into any other problems using the scripts? I'd be happy to help out in any way I can. Just let us know if there's anything we can do to assist!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • Help with Custom calculation script in Acrobat 8

    Hi all, I am using acrobat 8 on OS 10.5
    I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
    I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
    Thanks for any help in advance
    Swen

    This should get you started:
    >if (event) {
    // get values from two text fields
    var a = Number(this.getField('Text1').value);
    var b = Number(this.getField('Text2').value);
    // subtract the values and show it
    this.event.target.value = a - b;
    Place this in a 3d text field, as a Custom Calculation Script.

  • Help with first Adobe Script for AE?

    Hey,
    I'm trying to create a script that will allow me to set a certain number of layer markers at an even interval to mark out a song. Could someone help me troubleshoot this script? I've been working on it for ages now, and I'm about to snap. I've basically gone from HTML and CSS, to javascript and Adobe scripting in the past few hours, and I cannot figure this out for the life of me.
    I want to create a dialog with two fields, the number of markers to place, and the tempo of the song. Tempo is pretty simple, its just the number of beats per minute. The script is meant to start at a marker that I have already placed, and set a new marker at incrementing times. Its mainly to help me see what I'm trying to animate too, even if the beat is a little hard to pick up every once in a while.
    Also, is there a better way to do this? This script will help me in the long run because I will need to do this pretty often, but I'm wondering if there was something that I could not find online that would have saved me these hours of brain-jumbling?
    Thank you very much for any help you can offer.
        // Neo_Add_MultiMarkers.jsx
        //jasondrey13
        //2009-10-26
        //Adds multiple markers to the selected layer.
        // This script prompts for a certain number of layer markers to add to the selected audio layer,
        //and an optional "frames between" to set the number of frames that should be skipped before placing the next marker
        // It presents a UI with two text entry areas: a Markers box for the
        // number of markers to add and a Frames Between box for the number of frames to space between added markers.
        // When the user clicks the Add Markers button,
        // A button labeled "?" provides a brief explanation.
        function Neo_Add_MultiMarkers(thisObj)
            // set vars
            var scriptName = "Neoarx: Add Multiple Markers";
            var numberOfMarkers = "0";
            var tempo = "0";
            // This function is called when the Find All button is clicked.
            // It changes which layers are selected by deselecting layers that are not text layers
            // or do not contain the Find Text string. Only text layers containing the Find Text string
            // will remain selected.
            function onAddMarkers()
                // Start an undo group.  By using this with an endUndoGroup(), you
                // allow users to undo the whole script with one undo operation.
                app.beginUndoGroup("Add Multiple Markers");
                // Get the active composition.
                var activeItem = app.project.activeItem;
                if (activeItem != null && (activeItem instanceof CompItem)){
                    // Check each selected layer in the active composition.
                    var activeComp = activeItem;
                    var layers = activeComp.selectedLayers;
                    var markers = layers.property("marker");
                    //parse ints
                    numberOfMarkers = parseInt (numberOfMarkers);
                    tempo = parseInt (tempo);
                    // Show a message and return if there is no value specified in the Markers box.
                    if (numberOfMarkers < 1 || tempo < 1) {
                    alert("Each box can take only positive values over 1. The selection was not changed.", scriptName);
                    return;
                    if (markers.numKeys < 1)
                    alert('Please set a marker where you would like me to begin.');
                    return;
                    var beginTime = markers.keyTime( 1 );
                    var count = 1;
                    var currentTime = beginTime;
                    var addPer = tempo/60;
                    while(numberOfMarkers < count)
                    markers.setValueAtTime(currentTime, MarkerValue(count));
                    currentTime = currentTime + addPer;
                    if (count==numberOfMarkers) {
                        alert('finished!');
                        return;
                    else{
                        count++;
                app.endUndoGroup();
        // Called when the Markers Text string is edited
            function onMarkersStringChanged()
                numberOfMarkers = this.text;
            // Called when the Frames Text string is edited
            function onFramesStringChanged()
                tempo = this.text;
            // Called when the "?" button is clicked
            function onShowHelp()
                alert(scriptName + ":\n" +
                "This script displays a palette with controls for adding a given number of markers starting at a pre-placed marker, each separated by an amount of time determined from the inputted Beats Per Minute (Tempo).\n" +
                "It is designed to mark out the even beat of a song for easier editing.\n" +
                "\n" +
                "Type the number of Markers you would like to add to the currently selected layer. Type the tempo of your song (beats per minute).\n" +           
                "\n" +
                "Note: This version of the script requires After Effects CS3 or later. It can be used as a dockable panel by placing the script in a ScriptUI Panels subfolder of the Scripts folder, and then choosing this script from the Window menu.\n", scriptName);
            // main:
            if (parseFloat(app.version) < 8)
                alert("This script requires After Effects CS3 or later.", scriptName);
                return;
            else
                // Create and show a floating palette
                var my_palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName, undefined, {resizeable:true});
                if (my_palette != null)
                    var res =
                    "group { \
                        orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \
                        markersRow: Group { \
                            alignment:['fill','top'], \
                            markersStr: StaticText { text:'Markers:', alignment:['left','center'] }, \
                            markersEditText: EditText { text:'0', characters:10, alignment:['fill','center'] }, \
                        FramesRow: Group { \
                            alignment:['fill','top'], \
                            FramesStr: StaticText { text:'Tempo:', alignment:['left','center'] }, \
                            FramesEditText: EditText { text:'140', characters:10, alignment:['fill','center'] }, \
                        cmds: Group { \
                            alignment:['fill','top'], \
                            addMarkersButton: Button { text:'Add Markers', alignment:['fill','center'] }, \
                            helpButton: Button { text:'?', alignment:['right','center'], preferredSize:[25,20] }, \
                    my_palette.margins = [10,10,10,10];
                    my_palette.grp = my_palette.add(res);
                    // Workaround to ensure the editext text color is black, even at darker UI brightness levels
                    var winGfx = my_palette.graphics;
                    var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                    my_palette.grp.markersRow.markersEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.FramesRow.FramesEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.markersRow.markersStr.preferredSize.width = my_palette.grp.FramesRow.FramesStr.preferredSize.width;
                    my_palette.grp.markersRow.markersEditText.onChange = my_palette.grp.markersRow.markersEditText.onChanging = onMarkersStringChanged;
                    my_palette.grp.FramesRow.FramesEditText.onChange = my_palette.grp.FramesRow.FramesEditText.onChanging = onFramesStringChanged;
                    my_palette.grp.cmds.addMarkersButton.onClick    = onAddMarkers;
                    my_palette.grp.cmds.helpButton.onClick    = onShowHelp;
                    my_palette.layout.layout(true);
                    my_palette.layout.resize();
                    my_palette.onResizing = my_palette.onResize = function () {this.layout.resize();}
                    if (my_palette instanceof Window) {
                        my_palette.center();
                        my_palette.show();
                    } else {
                        my_palette.layout.layout(true);
                else {
                    alert("Could not open the user interface.", scriptName);
        Neo_Add_MultiMarkers(this);

    You should ask such questions over at AEnhancers. I had a quick look at your code but could not find anything obvious, so it may relate to where and when you execute certain functions and how they are nested, I just don't have the time to do a deeper study.
    Mylenium

  • Help with web form script. PHP, CGI, Perl???

    anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.

    Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
    <pre>
    <?php
    $emailFrom = '[email protected]';
    $emailTo = '[email protected]';
    $emailSubject = 'Subject';
    $date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
    $browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
    $hostname = $HTTPSERVER_VARS['REMOTEADDR'];
    $message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
    foreach ($_POST as $key => $value) {
    $message .= $key . ": " . $value . "\n";
    $mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
    ?>
    </pre>
    This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
    Also, this script expects your form method="post".
    Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
    <pre><?php
    if ($mailResult) {
    echo "Your comments have been received thank you.";
    } else {
    echo "There was an error. Please try again or contact us using an alternate method.";
    ?></pre>

  • Help with:   java.sql.SQLIntegrityConstraintViolationException

    Hi, guys
    I need help with the following exception: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL090403155751200' defined on 'BOOK_ORDER'.
    the things is my primary key is unique, so i checked the indexes and i found that i have two 'SQL090403155751200' indexes.
    I would like to know:
    1. can i delete the index without causing further database problems
    2. what causes this problem and how can i avoid it.
    By the way im using netbeans 6.5 and derby database

    rizza_99 wrote:
    I would like to know:
    1. can i delete the index without causing further database problems
    2. what causes this problem and how can i avoid it.
    By understanding what the application/system is supposed to be doing and the correctly creating indexes on the database that reflect the business needs.
    Once you do that then the nature of the indexes that are needed are obvious.
    You certainly don't delete indexes without that understanding however.

  • ODP bug with generated SQL script when using DateTime

    With EF5, I'm getting some really weird SQL scripts when dealing with DateTime.
    THe follow script works fine.
    var a = db.MOTOR_POOL_RESERVATION
    .Where(o => o.DEPART_DT > new DateTime(2013, 1, 1))
    .Select(o => o.RESERVATION_ID)
    .ToList();
    SELECT "Extent1"."RESERVATION_ID" AS "RESERVATION_ID"
    FROM "MOTORPOOL"."MOTOR_POOL_RESERVATION" "Extent1"
    WHERE ("Extent1"."DEPART_DT" > TO_TIMESTAMP('2013-01-01 00:00:00.000', 'YYYY-MM-DD HH24:MI:SS.FF'))
    But as soon as I create DateTime with year, month or day values forming from a variable, then generated scripts become incorrect.
    var year = 2013;
    var month = 3;
    var dt = new DateTime(year, month, 1);
    var c = db.MOTOR_POOL_RESERVATION
    .Where(o => o.DEPART_DT > dt)
    .Select(o=>o.RESERVATION_ID)
    .ToList();
    see the date is treated a string.
    SELECT "Extent1"."RESERVATION_ID" AS "RESERVATION_ID"
    FROM "MOTORPOOL"."MOTOR_POOL_RESERVATION" "Extent1"
    WHERE ("Extent1"."DEPART_DT" > '2013-03-01 00:00:00')
    var b = db.MOTOR_POOL_RESERVATION
    .Where(o => o.DEPART_DT > new DateTime(year, month, 1))
    .Select(o => o.RESERVATION_ID)
    .ToList();
    same problem with this one.
    SELECT "Extent1"."RESERVATION_ID" AS "RESERVATION_ID"
    FROM "MOTORPOOL"."MOTOR_POOL_RESERVATION" "Extent1"
    WHERE ("Extent1"."DEPART_DT" > '2013-03-01 00:00:00')

    It turns out that the sql is valid since I'm using bind parameters.

  • Help with PL/SQl .....Sysdate-1

    Hi all ..Need help with this
    to_char(last_day(add_months(sysdate,-1)),'mm/dd/yyyy')
    Its an Oracle 10g. We use two schemas out of many for Enterprise wide DW. They have 9 base tables in one of the schemas.. We have hundreds of views from that base tables . This SQL command is against one of the view . We basically need all the applications made by customers drilled by region,area,city etc. in the last month using this command.
    Here we are using sysdate - 1 to retrieve reports for the last months data. These reports are run monthly on first business day once. But due to any problem if it runs after 3rd or 4th of the month it returns data from last months 3rd to this months 3rd which is logically wrong. Is there any solution so that whenever the report may run it has to return last months data from first of last month to last day of last month. It would be of great help if anyone gives the solution.
    Thanks
    Tom

    Tom,
    Something like this
    SELECT     ADD_MONTHS (TRUNC (SYSDATE), -1)
             - TO_NUMBER (TO_CHAR (ADD_MONTHS (TRUNC (SYSDATE), -1), 'DD'))
             + 1
                first_date,
             LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE), -1)) last_date
      FROM   DUAL;Regards

  • Anybody can help with this SQL?

    The table is simple, only 2 columns:
    create table personpay(
    id integer primary key,
    pay number(8,2) not null);
    So the original talbe looks like this:
    ID PAY
    1 800
    2 400
    3 1200
    4 500
    5 600
    6 1900
    The requirement is to use one single query(no pl/sql) to show something lile the following, in other words, for each ID, the pay is the sum of all before itself and itself. So the query result looks like this:
    ID PAY
    1 800
    2 1200
    3 2400
    4 2900
    5 3500
    6 5400
    Again, just use one sql. No pl/sql. Anybody can help with this? I really appreciate that.
    thanks,

    Eh, people are so "analytically minded" that can't even notice a simple join?
    Counting Ordered Rows
    Let’s start with a basic counting problem. Suppose we are given a list of integers, for example:
    x
    2
    3
    4
    6
    9
    and want to enumerate all of them sequentially like this:
    x      #
    2      1
    3      2
    4      3
    6      4
    9      5
    Enumerating rows in the increasing order is the same as counting how many rows precede a given row.
    SQL enjoys success unparalleled by any rival query language. Not the last reason for such popularity might be credited to its proximity to English . Let examine the informal idea
    Enumerating rows in increasing order is counting how many rows precede a given row.
    carefully. Perhaps the most important is that we referred to the rows in the source table twice: first, to a given row, second, to a preceding row. Therefore, we need to join our number list with itself (fig 1.1).
    Cartesian Product
    Surprisingly, not many basic SQL tutorials, which are so abundant on the web today, mention Cartesian product. Cartesian product is a join operator with no join condition
    select A.*, B.* from A, B
    Figure 1.1: Cartesian product of the set A = {2,3,4,6,9} by itself. Counting all the elements x that are no greater than y produces the sequence number of y in the set A.
    Carrying over this idea into formal SQL query is straightforward. As it is our first query in this book, let’s do it step by step. The Cartesian product itself is
    select t.x x, tt.x y
    from T t, T tt
    Next, the triangle area below the main diagonal is
    select t.x x, tt.x y
    from T t, T tt
    where tt.x <= t.x
    Finally, we need only one column – t.x – which we group the previous result by and count
    select t.x, count(*) seqNum
    from T t, T tt
    where tt.x <= t.x
    group by t.x
    What if we modify the problem slightly and ask for a list of pairs where each number is coupled with its predecessor?
    x      predecessor
    2      
    3      2
    4      3
    6      4
    9      6
    Let me provide a typical mathematician’s answer, first -- it is remarkable in a certain way. Given that we already know how to number list elements successively, it might be tempted to reduce the current problem to the previous one:
    Enumerate all the numbers in the increasing order and match each sequence number seq# with predecessor seq#-1. Next!
    This attitude is, undoubtedly, the most economical way of thinking, although not necessarily producing the most efficient SQL. Therefore, let’s revisit our original approach, as illustrated on fig 1.2.
    Figure 1.2: Cartesian product of the set A = {2,3,4,6,9} by itself. The predecessor of y is the maximal number in a set of x that are less than y. There is no predecessor for y = 2.
    This translates into the following SQL query
    select t.x, max(tt.x) predecessor
    from T t, T tt
    where tt.x < t.x
    group by t.x
    Both solutions are expressed in standard SQL leveraging join and grouping with aggregation. Alternatively, instead of joining and grouping why don’t we calculate the count or max just in place as a correlated scalar subquery:
    select t.x,
    (select count(*) from T tt where tt.x <= t.x) seq#
    from T t
    group by t.x
    The subquery always returns a single value; this is why it is called scalar. The tt.x <= t.x predicate connects it to the outer query; this is why it is called correlated. Arguably, leveraging correlated scalar subqueries is one the most intuitive techniques to write SQL queries.
    How about counting rows that are not necessarily distinct? This is where our method breaks. It is challenging to distinguish duplicate rows by purely logical means, so that various less “pure” counting methods were devised. They all, however, require extending the SQL syntactically, which was the beginning of slipping along the ever increasing language complexity slope.
    Here is how analytic SQL extension counts rows
    select x, rank() over(order by x) seq# from T; -- first problem
    select x, lag() over(order by x) seq# from T; -- second problem
    Many people suggest that it’s not only more efficient, but more intuitive. The idea that “analytics rocks” can be challenged in many ways. The syntactic clarity has its cost: SQL programmer has to remember (or, at least, lookup) the list of analytic functions. The performance argument is not evident, since non-analytical queries are simpler construction from optimizer perspective. A shorter list of physical execution operators implies fewer query transformation rules, and less dramatic combinatorial explosion of the optimizer search space.
    It might even be argued that the syntax could be better. The partition by and order by clauses have similar functionality to the group by and order by clauses in the main query block. Yet one name was reused, and the other had been chosen to have a new name. Unlike other scalar expressions, which can be placed anywhere in SQL query where scalar values are accepted, the analytics clause lives in the scope of the select clause only. I have never been able to suppress an impression that analytic extension could be designed in more natural way.

  • HELP with lineage.sql

    I need help with the discoverer lineage.sql that allows hyper drill from V5 OWB Eul into OWB portal.
    I am still on OWB 9.0.3 and seem to have a small version problem. the portal is up, and i can jump to portal reports from within the browser ok. I have created the eul definitions in disco using the bridge. the lineage work book is working but the url being generated is the wrong format for the portal.
    Does anyone know how I can sort out the lineage url construction to parse the correct format?
    thanks.
    Richard.

    WOW! Nobody knows huh?
    Well I'll let you know how I fixed it. Basically change the Disco Eul complex folder definition. After working out why the Url being contructed was wrong I changed the complex formula imbeded within the EUL object to parse the correct formula. And it now works. (I also added the hyperdrill for Impact analysis)
    However the 9.03 repository is essentally a single table cmpallclasses and our table is huge. After getting the url parsing sorted, the actual underlying views were not returning data in a timely manner. Looking at the base table it has a single index, a quick bit 'o' tuning and having added three indexes my impact views return in under 2 mins which I am happy with. But my portal times out and spits out the no response from server which I think is an apache setting http.conf a generic time out. I am not sure why it may be a portal issue. I have set the owbportal to 1200 as a timeout, but something else is kicking in and killing the connex does anyone have a clue?
    This is a big repository, I have around 1500 mappings now. Does anyone else have a production OWB repository of any real size?
    Having sorted this out on 9.03, I am going to see how much I can apply to the 9.2 variant.
    Thanks.
    Richard.

  • Help with Oracle SQL to strip unwanted characters

    Hello,
    I have 2 columns (Weight and Height)  where I need to strip the alpha characters and convert them to numbers (I am required to derive additional columns where I need to present
    these values in inches, cm, KG, LB, etc. (and thus the need to convert them to numbers). I am too much a novice to understand the best way to convert these columns into numbers (same precision as you see here).
    See the image below for a sample of what these columns currently contain. I simply need help with the Oracle SQL code to parse/convert these vales into number. Thanks in advance for your assistance!
    Dave

    Hi,
    In addition to
    Erland Sommarskog's comment which is of course correct and this i not the forum to ask question about Oracle, I dont want to leave you without a lead :-)
    The solution both in SQL Server and Oracle should based on Regular Expressions. I highly recommended NOT to use T-SQL solutions in this case, as mentioned above, unless this is a very small table and the need is very simple and include finding one point
    in the string as in
    SaravanaC solution (when he assume thge string format is based on 2 parts (1) Number + (2) unit type).
    In Oracle there is a build in Regular Expressions option as mentioned here: http://docs.oracle.com/cd/B12037_01/appdev.101/b10795/adfns_re.htm
    In SQL Server the PATINDEX is used for simple cases and there is no built in Regular Expressions, but you can add it using CLR as shown in this link http://msdn.microsoft.com/en-us/magazine/cc163473.aspx
    [Personal Site] [Blog] [Facebook]

  • Help with a startup script for monitorix

    How can I deal with a perl script that doesn't acknowledge a query for pidof?
    $ ps aux | grep monitorix
    root 1089 0.0 1.2 16280 6556 ? Ss 09:54 0:00 /usr/bin/monitorix -c /etc/monitorix.conf
    So it's running... but I can't find it with pidof:
    $ pidof /usr/bin/monitorix
    Here is the /etc/rc.d/monitorix I've been using but that doesn't stop the program (since it has no PID).
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    PID=`pidof -o %PPID /usr/bin/monitorix`
    MARGS="-c /etc/monitorix.conf"
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [ -z "$PID" ]; then
    /usr/bin/monitorix $MARGS
    fi
    if [ ! -z "$PID" -o $? -gt 0 ]; then
    stat_fail
    else
    PID=`pidof -o %PPID /usr/bin/monitorix`
    echo $PID > /var/run/monitorix.pid
    add_daemon monitorix
    stat_done
    fi
    stop)
    stat_busy "Stopping Monitorix"
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    rm_daemon monitorix
    else
    rm_daemon monitorix
    stat_done
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac

    According to the man page, the -p flag will let you generate a PID file.
    You have a few logical errors in your rc.d script and a syntax error (double else in stop). I've been using a template similar to the below in cleaning up a few of the packages I maintain...
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    pidfile=/run/monitorix.pid
    if [[ -r $pidfile ]]; then
    read -r PID < "$pidfile"
    if [[ ! -d /proc/$PID ]]; then
    # stale pidfile
    unset PID
    rm -f "$pidfile"
    fi
    fi
    args=(-c /etc/monitorix.conf -p "$pidfile")
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [[ -z $PID ]] && /usr/bin/monitorix "${args[@]}"; then
    add_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    stop)
    stat_busy "Stopping Monitorix"
    if [[ $PID ]] && kill $PID &> /dev/null; then
    rm_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    please also fix the PKGBUILD:
    install=('readme.install')
    This is not valid, and pacman 4 will not let you declare install as an array.
    Last edited by falconindy (2011-09-25 15:05:02)

Maybe you are looking for

  • Function modules to open a CRM activity

    Hi all, What are the Function modules available to open a CRM activity ( in change or display mode) when we have the GUID of the activity. The "BAPI_ACTIVITYCRM_CHANGEWDIALOG" is working from a standalone program but it is not working when I am alrea

  • Unable to install Officejet Pro L7590 print driver in Windows 8.1

    I have lost days of time trying to get my OfficeJet Pro L7590 to print properly and otherwise operate in a stable manner.  My computer is a new Dell XPS8700 running Windows 8, upgraded to Windows 8.1 via the "Store" app after purchase.  My problems s

  • My phone got locked!

    After my partner went down my phone (to check to see if I had been cheating..and I hadn't been) I changed my password and instantly forgot what i had changed it to..after numerous attempts to remember the password I got loacked out..I was told my onl

  • CUCM 7.x - Recover Purged CDR's in CAR

    Hello All,        Is there any possible way to recover purged CDR's, like I'am trying to go back 5 months but we purged older then 2 months old.  I assume they are now lost? thanks. Jason

  • MES integration with ERP/SCM using XI

    Hi Experts, Could someone share any experiences on MES (Manufacturing Execution System) integration with SAP ERP / SCM. Are there any best practices document available on MES-SAP integration? Appreciate any help. Thanks, Shobhit