The points on LScript and SQL

Hello experts,
We have some customers requests that would require the use of L Scripts, such as Projected Inventory, Stock Coverage and Projected Wasted Stock calculation.
I tried gathering information on L code, but only found very few useful hints.
I heard that L Script was not intended to SAP externals. Is this true? I am still skeptical since the code is open for editing in the Web UI... 
And what about SQL scripts used for planning operators? This blog mentions that SAP consultants are not given the ability to work on them...
So, I'm just wondering what's the SAP guideline on L code and SQL scripts for external consultants?
Regards

Hi,
I am having same requirement where I want to show data from 2 DB tables in same form results table and want to update one of the columns of 1 table.
E.g.
ResultsTable
Line No Table1Col1 Table1Col2 Table1Col3 Table2Col1 TableCol2
Row1 ..........
Row2 ..........
Lets say i want to update "Table2Col2" for each Row.
I have 2 EO's for each table and created 1 VO based on those EOs.
Please suggest...
Thanks in advance
Mukesh

Similar Messages

  • Master data datasource for the point of delivery and installation.

    Hi,
    Can any one help me with the Master data datasource for the point of delivery and installation.
    Currently i am using ouc_instfacts for installation facts.
    With Thanks& Regards,
    Shakthi.

    Hi Shakti,
    I guess you are asking for assignment of installation to POD (table euiinstln)?
    Then you should check 0UC_PODINST_ATTR.
    Best regards
    Harald

  • What is the point of Precision and Scale in Number Type?

    Version :11.2
    What is the point in having PRECISION and SCALE in number type? If you create the column with just NUMBER ie.without
    specifying precision or scale , you can enter numbers with any precision and scale.
    SQL> select * From v$version where rownum < 2;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    SQL> create table t1 (col1 number);
    Table created.
    SQL> insert into t1 values (223.9939394);
    1 row created.
    SQL> insert into t1 values (88.228384);
    1 row created.
    SQL> insert into t1 values (9.34);
    1 row created.
    SQL> insert into t1 values (000.00);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
          COL1
    223.993939
    88.228384
          9.34
             0Did you ever have a business scenario where a Numerical column should store values only with a fixed precision and scale ?

    Omega3 wrote:
    Version :11.2
    What is the point in having PRECISION and SCALE in number type? If you create the column with just NUMBER ie.without
    specifying precision or scale , you can enter numbers with any precision and scale.
    SQL> select * From v$version where rownum < 2;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    SQL> create table t1 (col1 number);
    Table created.
    SQL> insert into t1 values (223.9939394);
    1 row created.
    SQL> insert into t1 values (88.228384);
    1 row created.
    SQL> insert into t1 values (9.34);
    1 row created.
    SQL> insert into t1 values (000.00);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    COL1
    223.993939
    88.228384
    9.34
    0Did you ever have a business scenario where a Numerical column should store values only with a fixed precision and scale ?Lots of business requirements for specific precisions and scales.
    A persons Age may required to be stored as whole numbers of no more than 3 digits.
    A sum of money may required to be stored with no more than 2 decimal places of accuracy e.g. GB Pounds and Pence or US Dollars and Cents
    A unit of length may required to be stored in metres with 2 decimal places for centimetres
    A shoe size may be required to be stored with one decimal place for half sizes
    etc.
    etc.
    Yes, you may just create all of them as generic NUMBER datatype, but creating them with precision and scale can provide additional information about the limitations expected for the values stored, especially for things like reporting tools that may use the specified precision and scale to determine how to display the values automatically (by default).
    If you start questioning "what's the point?" then you may as well say what's the point in having a NUMBER datatype when we can store numbers in a VARCHAR2 datatype? or what's the point in having a DATE datatype when we can stored dates as VARCHAR2 datatype? etc.
    No point in asking such a question because there's almost always a point to these things (and if there isn't they get deprecated in later versions).

  • Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql

    Hello All,
    I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
    and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
    Table Name  OracleRowsCount   SqlRowCount  Diff
    Customer                150                 150            
    0
    Sales                      2000                1998          
    2
    Devisions                 5                       5             
    0
    (I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
    What the simplest way to do it ?
    Thank you
    Best Regards
    Daniel

    Hi Daniel,
    According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
    Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
    Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
    package by querying this table.  
    Regards,
    Mike Yin
    TechNet Community Support

  • So I was trying to enhance my firewall to the point of inoperability and...

    Situation:
    Like what all really cool people do on a Saturday night, I was perusing the bowels of my unix stuff on my Mac last night, and did a sudo ipfw list. I noticed that ports 67, 68, 69, 137, 138, and 139 were open from any to any. I know that 13x ports are used for Windoze sharing, and that /etc/services shows those ports are for something to do with netbios and tftp. Windows Sharing did not show up as being enabled in SysPrefs Sharing Services, and no other services using any of these six ports showed up as being enabled in SysPrefs Sharing Firewall.
    I have no idea how or why those ports would be enabled. At work, I have Macs. My sons and daughter have Macs. Nobody would be connecting to my home network, either internally or from the internet at large and doing anything windoze-like. And I never recall having ever seen this ports opened before when doing a ipfw list.
    So, I got scared. I figured that I would do a sudo ipfw flush, which I did, and then just use SysPrefs Sharing Firewall to click checkboxes to reenable the services that I want. Well, that was the start of my enhancing my firewall to the point of inoperability. When I go into the SysPrefs Sharing Firewall panel, I get a splash screen that says something to the tune of "another firewall is active on this computer, so if you want to do anything here on this Firewall panel, turn off the other firewall software."
    Fortunately, I had done a sudo ipfw list > portList.txt so I could at least manually sudo ipfw add back the ports that I thought I wanted (and the ports I thought I wanted denied). So that's where I'm at now. But now it's a real annoyance that I don't have "checkbox control" of services and ports through the SysPrefs Sharing Firewall panel anymore, and instead have to do the "sudo ipfw add/subtract/multiply/divide {rule#} {whatever}" thing now. I don't know how to regain control of my Apple firewall and the SysPrefs Sharing Firewall panel.
    Of course this doesn't address the issue of what opened those ports, and if it happens again, an "archive and reinstall" of the OS, along with an install of fink/macports tripwire, may be in order. But that's an inconvenience to have to do, and hopefully I can avoid having to do that. In the meantime, regaining control of my Apple firewall and the SysPrefs Sharing Firewall panel, would realy be nice, and that is my question. What do I do, and how do I do it?
    Thanks in advance.

    First, take a deep breath...
    For one, the System Preferences knows nothing about the command line ipfw changes that you made. It expects to be the interface for setting and changing firewall rules, so when you've changed them manually (ipfw flush) it sees that the current rules doesn't match what it expects and hence the error message.
    Secondly, the presence, or otherwise, of those ports does not mean they are active. Just that ipfw isn't blocking them. There still has to be some process on the machine listing to the port in order for anything to actually happen. It's akin to leaving a door open - it's fine when all that's behind that door is a brick wall.
    A better test is to see what's actually being used on your machine, and ipfw cannot tell you that (at least, not easily). Better tools include netstat and lsof.
    netstat -a will give you a list of every network connection in use. Just don't be shocked if there are more there that you expect - the OS uses a lot of them internally. What you're most interested in is the ports in LISTEN state (piping the output through 'grep LISTEN' is a simple solution).
    Now you can focus on which ports your machine will actually respond to (assuming the firewall also allows traffic through).
    If you have a port number that you don't recognize then you can invoke lsof which has the ability to list all open files, network ports, etc. To track a port number, use the form:
    <pre class=command>sudo lsof -i :port</pre>
    This will tell you any process that is using the specified port number. From there you should be able to determine whether or not there's an issue.

  • What is the point of tags, and how does one use them?

    I am completely mystified by tags. This is a new feature that is supposed to be wonderful and helpful, and some people have hailed them as a major improvement. However, I can't see what they are good for.
    If you put a tag on a file, it is added to the beginning of the filename in Finder, thus shortening the portion that is visible, which potentially makes it harder to identify the file. If you are thinking of telling me to abandon icon view in the Finder, forget it.
    Tags have to be added manually. How does that work if you have more than 24 files? I have about 3,000.
    It seems that you'd have to come up iwth a categorization scheme for alll the files on your disk. Ccmbine that with tagging them manually, won't that take a huge amount of t ime?
    What added benefit do tags give the user?
    We used to be able to add metadata to files with CMD+I. Now we can only add tags. Is this progress or regress and why?
    Incidentally, I am over 12 years of age.

    Thanks for the explanations. What this means in my situation is that tags are an unnecessary way of spending a lot of time making my file system more complicated, without adding any value whatsoever. Without tags, I can find any of my 3,000 files with a few clicks. (On my computer, Spotlight has cobwebs. I very rarely need it, but it's wonderful when I do.) Now that I know how tags work, I can ignore it.
    A human being can only perceive a quantity of seven without counting or grouping; hence we arrange things in structures to keep the number of entitites low on each level. You don't need to count three objects to know that they are all there, but you do need to count twelve objects. Which is why Home Alone was believable. We sort screws and nails in jars and toolboxes have compartments. Even the grocery store has a hierarchical arrangement. You don't find steaks in the bakery section, or breakfast cereal in the produce department.
    Some people aren't organized, and that's not a bad thing, but no folder, no tag, and no group is going to change a fundamental personality characteristic.
    Thanks everyone for showing me that in my case, there's no point to tags. That saves me a lot of time.

  • Question regarding the execution of cursors and SQL statements

    Hi,
    I have cursor which fetches results from a table A.
    Now, simultaneously, in other session, I ran an update on the table A and commited it.
    1) My question is will the cursor keep fetching the old results or the cursor start fetching the new values when the data is committed?
    2) I have a similar question in SQL too. We generally write SQL queries which take considerable amount of time- around half an hour. During this time, I ran an update on the table and committed it. Will the result set contain the old values ?
    As per my knowledge, both should fetch the old values.
    But, I would like to get my beliefs reinforced.
    Thanks for your help.
    Don

    donisback wrote:
    Thanks John..
    Your post drives me to ask another question. We've been getting the error "Snapshot Too Old" quite frequently.
    So, we minimized the SQL and used cursor committing every 10000 records. This prevented the above error.
    Is there any other possible reason why we get the error "Snapshot too Old"?
    Thanks,
    DonDon:
    Typically, commiting more frequently increases the likelyhood of 1555, not decreases it. The 1555 error comes when the undo (or rollback in old terms) records that need to be read to support read consistency are no longer available. Simplistically, once a change has been committed, the undo records are marked as available for re-use and could be re-used thereby destroying the information that you need.
    Even though ithe initial question is really old, read the Ask Tom thread posted by RPuttagunta. Tom explains it far better than I could, and the basic concepts have not changed.
    John
    John

  • Sci-15c purchased app survived the upgrade to ios 6.1.2 on ipad3 and iphone 4s, but missing on ipad mini.  App store doesn't show app and it doesn't appear on my purchases.  Whats the point of icloud and the app store?  Help please.

    Why is the excellent hp-15c emulator, sci-15c, which I purchased years ago, missing from my ios upgraded ipad and not shown in my purchased apps nor in the store?
    The app did get properly reatored to my other ipad 2 and 3 and iphone 4s
    Thanks in advance for any suggestions

    Check iTunes on the computer you normally sync with. The app might still be there and you could sync it back onto your iPad mini. Then see if it still works on the most recent iPads.

  • Distance calculation with the help of mappoint and sql server integration services

    How to use mappoint 2011 with SSIS 2012 to calculate the distance between two zip codes? is there any process to calculate the distancein ssis?

    SSIS being an ETL tool (moving and transforming data) does not have native integration with mapPoint, nor it exposes any 'Geo' functions to operate on geometry or geoshape data.
    I imagine to achieve what you need SSIS should not be used solely, if you can read the ZIP codes then you can calculate the distance in C# (say) code which in turn can be used in SSIS Script Task if needed: http://www.wiredprairie.us/blog/index.php/archives/688
    Arthur
    MyBlog
    Twitter

  • My apple mouse is not working.  The pointer will not move on the screen and it keeps turning off.

    My apple mouse is not working.  I can get it to connect but it will not move the pointer.  Left and right click is working, scrolling, just cannot move the pointer.  Also, I have replaced the batteries (numerous times) but the green power light turns off after a few minutes.  Any suggestions?

    How about clean up LED hole of mouse?

  • Where can I find more OBE like the one for Database xE and SQL Developer?

    Hi,
    I tried to post on the OBE forum but it is expired.
    I found the downloadable OBE, or tutorial, very good resources for me to learn Oracle, like the one for XE and SQL developer, which you can download, not just read online, and see as many times as you can, with flash stuffs inside,
    Will you make more this kind of OBE?
    Where can I find them?
    Peter

    Hi Hans,
    I know the above address you offered but those are
    not downloadble.So do what I do .... CTRL-S (save page)
    As an Oracle trainer, I consider the OBEs to be very important. I doubt that Oracle will get rid of them.
    However, it takes time to make them. I suspect that they are created when a new feature needs to be demonstrated and the product management has the resources available.
    I just wish they would make the original set from Oracle8i available. They provided some very important basics which have long since hit the archive pile.
    I'm sure that some of the ACEs would be happy to upgrade them to Oracle10g/11g level. I know I would be willing to contribute to that effort.

  • PL/SQL 101 : Cursors and SQL Projection

    PL/SQL 101 : Cursors and SQL Projection
    This is not a question, it's a forum article, in reponse to the number of questions we get regarding a "dynamic number of columns" or "rows to columns"
    There are two integral parts to an SQL Select statement that relate to what data is selected. One is Projection and the other is Selection:-
    Selection is the one that we always recognise and use as it forms the WHERE clause of the select statement, and hence selects which rows of data are queried.
    The other, SQL Projection is the one that is less understood, and the one that this article will help to explain.
    In short, SQL Projection is the collective name for the columns that are Selected and returned from a query.
    So what? Big deal eh? Why do we need to know this?
    The reason for knowing this is that many people are not aware of when SQL projection comes into play when you issue a select statement. So let's take a basic query...
    First create some test data...
    create table proj_test as
      select 1 as id, 1 as rn, 'Fred' as nm from dual union all
      select 1,2,'Bloggs' from dual union all
      select 2,1,'Scott' from dual union all
      select 2,2,'Smith' from dual union all
      select 3,1,'Jim' from dual union all
      select 3,2,'Jones' from dual
    ... and now query that data...
    SQL> select * from proj_test;
             ID         RN NM
             1          1 Fred
             1          2 Bloggs
             2          1 Scott
             2          2 Smith
             3          1 Jim
             3          2 Jones
    6 rows selected.
    OK, so what is that query actually doing?
    To know that we need to consider that all queries are cursors and all cursors are processed in a set manner, roughly speaking...
    1. The cursor is opened
    2. The query is parsed
    3. The query is described to know the projection (what columns are going to be returned, names, datatypes etc.)
    4. Bind variables are bound in
    5. The query is executed to apply the selection and identify the data to be retrieved
    6. A row of data is fetched
    7. The data values from the columns within that row are extracted into the known projection
    8. Step 6 and 7 are repeated until there is no more data or another condition ceases the fetching
    9. The cursor is closed
    The purpose of the projection being determined is so that the internal processing of the cursor can allocate memory etc. ready to fetch the data into. We won't get to see that memory allocation happening easily, but we can see the same query being executed in these steps if we do it programatically using the dbms_sql package...
    CREATE OR REPLACE PROCEDURE process_cursor (p_query in varchar2) IS
      v_sql       varchar2(32767) := p_query;
      v_cursor    number;            -- A cursor is a handle (numeric identifier) to the query
      col_cnt     integer;
      v_n_val     number;            -- numeric type to fetch data into
      v_v_val     varchar2(20);      -- varchar type to fetch data into
      v_d_val     date;              -- date type to fetch data into
      rec_tab     dbms_sql.desc_tab; -- table structure to hold sql projection info
      dummy       number;
      v_ret       number;            -- number of rows returned
      v_finaltxt  varchar2(100);
      col_num     number;
    BEGIN
      -- 1. Open the cursor
      dbms_output.put_line('1 - Opening Cursor');
      v_cursor := dbms_sql.open_cursor;
      -- 2. Parse the cursor
      dbms_output.put_line('2 - Parsing the query');
      dbms_sql.parse(v_cursor, v_sql, dbms_sql.NATIVE);
      -- 3. Describe the query
      -- Note: The query has been described internally when it was parsed, but we can look at
      --       that description...
      -- Fetch the description into a structure we can read, returning the count of columns that has been projected
      dbms_output.put_line('3 - Describing the query');
      dbms_sql.describe_columns(v_cursor, col_cnt, rec_tab);
      -- Use that description to define local datatypes into which we want to fetch our values
      -- Note: This only defines the types, it doesn't fetch any data and whilst we can also
      --       determine the size of the columns we'll just use some fixed sizes for this example
      dbms_output.put_line(chr(10)||'3a - SQL Projection:-');
      for j in 1..col_cnt
      loop
        v_finaltxt := 'Column Name: '||rpad(upper(rec_tab(j).col_name),30,' ');
        case rec_tab(j).col_type
          -- if the type of column is varchar2, bind that to our varchar2 variable
          when 1 then
            dbms_sql.define_column(v_cursor,j,v_v_val,20);
            v_finaltxt := v_finaltxt||' Datatype: Varchar2';
          -- if the type of the column is number, bind that to our number variable
          when 2 then
            dbms_sql.define_column(v_cursor,j,v_n_val);
            v_finaltxt := v_finaltxt||' Datatype: Number';
          -- if the type of the column is date, bind that to our date variable
          when 12 then
            dbms_sql.define_column(v_cursor,j,v_d_val);
            v_finaltxt := v_finaltxt||' Datatype: Date';
          -- ...Other types can be added as necessary...
        else
          -- All other types we'll assume are varchar2 compatible (implicitly converted)
          dbms_sql.DEFINE_COLUMN(v_cursor,j,v_v_val,2000);
          v_finaltxt := v_finaltxt||' Datatype: Varchar2 (implicit)';
        end case;
        dbms_output.put_line(v_finaltxt);
      end loop;
      -- 4. Bind variables
      dbms_output.put_line(chr(10)||'4 - Binding in values');
      null; -- we have no values to bind in for our test
      -- 5. Execute the query to make it identify the data on the database (Selection)
      -- Note: This doesn't fetch any data, it just identifies what data is required.
      dbms_output.put_line('5 - Executing the query');
      dummy := dbms_sql.execute(v_cursor);
      -- 6.,7.,8. Fetch the rows of data...
      dbms_output.put_line(chr(10)||'6,7 and 8 Fetching Data:-');
      loop
        -- 6. Fetch next row of data
        v_ret := dbms_sql.fetch_rows(v_cursor);
        -- If the fetch returned no row then exit the loop
        exit when v_ret = 0;
        -- 7. Extract the values from the row
        v_finaltxt := null;
        -- loop through each of the Projected columns
        for j in 1..col_cnt
        loop
          case rec_tab(j).col_type
            -- if it's a varchar2 column
            when 1 then
              -- read the value into our varchar2 variable
              dbms_sql.column_value(v_cursor,j,v_v_val);
              v_finaltxt := ltrim(v_finaltxt||','||rpad(v_v_val,20,' '),',');
            -- if it's a number column
            when 2 then
              -- read the value into our number variable
              dbms_sql.column_value(v_cursor,j,v_n_val);
              v_finaltxt := ltrim(v_finaltxt||','||to_char(v_n_val,'fm999999'),',');
            -- if it's a date column
            when 12 then
              -- read the value into our date variable
              dbms_sql.column_value(v_cursor,j,v_d_val);
              v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          else
            -- read the value into our varchar2 variable (assumes it can be implicitly converted)
            dbms_sql.column_value(v_cursor,j,v_v_val);
            v_finaltxt := ltrim(v_finaltxt||',"'||rpad(v_v_val,20,' ')||'"',',');
          end case;
        end loop;
        dbms_output.put_line(v_finaltxt);
        -- 8. Loop to fetch next row
      end loop;
      -- 9. Close the cursor
      dbms_output.put_line(chr(10)||'9 - Closing the cursor');
      dbms_sql.close_cursor(v_cursor);
    END;
    SQL> exec process_cursor('select * from proj_test');
    1 - Opening Cursor
    2 - Parsing the query
    3 - Describing the query
    3a - SQL Projection:-
    Column Name: ID                             Datatype: Number
    Column Name: RN                             Datatype: Number
    Column Name: NM                             Datatype: Varchar2
    4 - Binding in values
    5 - Executing the query
    6,7 and 8 Fetching Data:-
    1     ,1     ,Fred
    1     ,2     ,Bloggs
    2     ,1     ,Scott
    2     ,2     ,Smith
    3     ,1     ,Jim
    3     ,2     ,Jones
    1     ,3     ,Freddy
    1     ,4     ,Fud
    9 - Closing the cursor
    PL/SQL procedure successfully completed.
    So, what's really the point in knowing when SQL Projection occurs in a query?
    Well, we get many questions asking "How do I convert rows to columns?" (otherwise known as a pivot) or questions like "How can I get the data back from a dynamic query with different columns?"
    Let's look at a regular pivot. We would normally do something like...
    SQL> select id
      2        ,max(decode(rn,1,nm)) as nm_1
      3        ,max(decode(rn,2,nm)) as nm_2
      4  from proj_test
      5  group by id
      6  /
            ID NM_1   NM_2
             1 Fred   Bloggs
             2 Scott  Smith
             3 Jim    Jones
    (or, in 11g, use the new PIVOT statement)
    but many of these questioners don't understand it when they say their issue is that, they have an unknown number of rows and don't know how many columns it will have, and they are told that you can't do that in a single SQL statement. e.g.
    SQL> insert into proj_test (id, rn, nm) values (1,3,'Freddy');
    1 row created.
    SQL> select id
      2        ,max(decode(rn,1,nm)) as nm_1
      3        ,max(decode(rn,2,nm)) as nm_2
      4  from proj_test
      5  group by id
      6  /
            ID NM_1   NM_2
             1 Fred   Bloggs
             2 Scott  Smith
             3 Jim    Jones
    ... it's not giving us this 3rd entry as a new column and we can only get that by writing the expected columns into the query, but then what if more columns are added after that etc.
    If we look back at the steps of a cursor we see again that the description and projection of what columns are returned by a query happens before any data is fetched back.
    Because of this, it's not possible to have the query return back a number of columns that are based on the data itself, as no data has been fetched at the point the projection is required.
    So, what is the answer to getting an unknown number of columns in the output?
    1) The most obvious answer is, don't use SQL to try and pivot your data. Pivoting of data is more of a reporting requirement and most reporting tools include the ability to pivot data either as part of the initial report generation or on-the-fly at the users request. The main point about using the reporting tools is that they query the data first and then the pivoting is simply a case of manipulating the display of those results, which can be dynamically determined by the reporting tool based on what data there is.
    2) The other answer is to write dynamic SQL. Because you're not going to know the number of columns, this isn't just a simple case of building up a SQL query as a string and passing it to the EXECUTE IMMEDIATE command within PL/SQL, because you won't have a suitable structure to read the results back into as those structures must have a known number of variables for each of the columns at design time, before the data is know. As such, inside PL/SQL code, you would have to use the DBMS_SQL package, just like in the code above that showed the workings of a cursor, as the columns there are referenced by position rather than name, and you have to deal with each column seperately. What you do with each column is up to you... store them in an array/collection, process them as you get them, or whatever. They key thing though with doing this is that, just like the reporting tools, you would need to process the data first to determine what your SQL projection is, before you execute the query to fetch the data in the format you want e.g.
    create or replace procedure dyn_pivot is
      v_sql varchar2(32767);
      -- cursor to find out the maximum number of projected columns required
      -- by looking at the data
      cursor cur_proj_test is
        select distinct rn
        from   proj_test
        order by rn;
    begin
      v_sql := 'select id';
      for i in cur_proj_test
      loop
        -- dynamically add to the projection for the query
        v_sql := v_sql||',max(decode(rn,'||i.rn||',nm)) as nm_'||i.rn;
      end loop;
      v_sql := v_sql||' from proj_test group by id order by id';
      dbms_output.put_line('Dynamic SQL Statement:-'||chr(10)||v_sql||chr(10)||chr(10));
      -- call our DBMS_SQL procedure to process the query with it's dynamic projection
      process_cursor(v_sql);
    end;
    SQL> exec dyn_pivot;
    Dynamic SQL Statement:-
    select id,max(decode(rn,1,nm)) as nm_1,max(decode(rn,2,nm)) as nm_2,max(decode(rn,3,nm)) as nm_3 from proj_test group by id order by id
    1 - Opening Cursor
    2 - Parsing the query
    3 - Describing the query
    3a - SQL Projection:-
    Column Name: ID                             Datatype: Number
    Column Name: NM_1                           Datatype: Varchar2
    Column Name: NM_2                           Datatype: Varchar2
    Column Name: NM_3                           Datatype: Varchar2
    4 - Binding in values
    5 - Executing the query
    6,7 and 8 Fetching Data:-
    1     ,Fred                ,Bloggs              ,Freddy
    2     ,Scott               ,Smith               ,
    3     ,Jim                 ,Jones               ,
    9 - Closing the cursor
    PL/SQL procedure successfully completed.
    ... and if more data is added ...
    SQL> insert into proj_test (id, rn, nm) values (1,4,'Fud');
    1 row created.
    SQL> exec dyn_pivot;
    Dynamic SQL Statement:-
    select id,max(decode(rn,1,nm)) as nm_1,max(decode(rn,2,nm)) as nm_2,max(decode(rn,3,nm)) as nm_3,max(decode(rn,4,nm)) as nm_4 from proj_test group by id order by id
    1 - Opening Cursor
    2 - Parsing the query
    3 - Describing the query
    3a - SQL Projection:-
    Column Name: ID                             Datatype: Number
    Column Name: NM_1                           Datatype: Varchar2
    Column Name: NM_2                           Datatype: Varchar2
    Column Name: NM_3                           Datatype: Varchar2
    Column Name: NM_4                           Datatype: Varchar2
    4 - Binding in values
    5 - Executing the query
    6,7 and 8 Fetching Data:-
    1     ,Fred                ,Bloggs              ,Freddy              ,Fud
    2     ,Scott               ,Smith               ,                    ,
    3     ,Jim                 ,Jones               ,                    ,
    9 - Closing the cursor
    PL/SQL procedure successfully completed.
    Of course there are other methods, using dynamically generated scripts etc. (see Re: 4. How do I convert rows to columns?), but the above simply demonstrates that:-
    a) having a dynamic projection requires two passes of the data; one to dynamically generate the query and another to actually query the data,
    b) it is not a good idea in most cases as it requires code to handle the results dynamically rather than being able to simply query directly into a known structure or variables, and
    c) a simple SQL statement cannot have a dynamic projection.
    Most importantly, dynamic queries prevent validation of your queries at the time your code is compiled, so the compiler can't check that the column names are correct or the tables names, or that the actual syntax of the generated query is correct. This only happens at run-time, and depending upon the complexity of your dynamic query, some problems may only be experienced under certain conditions. In effect you are writing queries that are harder to validate and could potentially have bugs in them that would are not apparent until they get to a run time environment. Dynamic queries can also introduce the possibility of SQL injection (a potential security risk), especially if a user is supplying a string value into the query from an interface.
    To summarise:-
    The projection of an SQL statement must be known by the SQL engine before any data is fetched, so don't expect SQL to magically create columns on-the-fly based on the data it's retrieving back; and, if you find yourself thinking of using dynamic SQL to get around it, just take a step back and see if what you are trying to achieve may be better done elsewhere, such as in a reporting tool or the user interface.
    Other articles in the PL/SQL 101 series:-
    PL/SQL 101 : Understanding Ref Cursors
    PL/SQL 101 : Exception Handling

    excellent article. However there is one thing which is slightly erroneous. You don't need a type to be declared in the database to fetch the data, but you do need to declare a type;
    here is one of my unit test scripts that does just that.
    DECLARE
    PN_CARDAPPL_ID NUMBER;
    v_Return Cci_Standard.ref_cursor;
    type getcardapplattrval_recordtype
    Is record
    (cardappl_id ci_cardapplattrvalue.cardappl_ID%TYPE,
    tag ci_cardapplattrvalue.tag%TYPE,
    value ci_cardapplattrvalue.value%TYPE
    getcardapplattrvalue_record getcardapplattrval_recordtype;
    BEGIN
    PN_CARDAPPL_ID := 1; --value must be supplied
    v_Return := CCI_GETCUSTCARD.GETCARDAPPLATTRVALUE(
    PN_CARDAPPL_ID => PN_CARDAPPL_ID
    loop
    fetch v_return
    into getcardapplattrvalue_record;
    dbms_output.put_line('Cardappl_id=>'||getcardapplattrvalue_record.cardappl_id);
    dbms_output.put_line('Tag =>'||getcardapplattrvalue_record.tag);
    dbms_output.put_line('Value =>'||getcardapplattrvalue_record.value);
    exit when v_Return%NOTFOUND;
    end loop;
    END;

  • SMS_SRS_REPORTING_POINT - Error retrieving folders with SCCM 2012 and SQL Server 2008 R2 SP2

    Hi:
    According to all the Reporting Services logs my Reporting Point was setup correctly.  When I try and run any report I see the entries below in the srsrp.log on the SQL Server.  The report names show up in the Console but when I right any of the
    listed reports I get errors and no report runs.
    I am running SQL Server 2008 R2 SP2 on a remote server.  SQL is installed on its own server.  There is no firewall between the Configuration Manager server and SQL Server.
    Thanks.
    Mark
    (!) Error retrieving folders - [A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance
    name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because
    connected host has failed to respond.)].   SMS_SRS_REPORTING_POINT
    1/25/2013 9:15:07 AM    4532 (0x11B4)
    No folder configuration information found.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:07 AM   
    4532 (0x11B4)
    Next security configuration at [1/25/2013 9:22:42 AM]
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:07 AM   
    4532 (0x11B4)
    Root Folder exists     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:07 AM   
    4532 (0x11B4)
    Successfully checked that the SRS web service is healthy on server DBSCCM.LOCAL    
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:07 AM 
    4532 (0x11B4)
    Waiting for changes for 1 minutes  
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:07 AM   
    4532 (0x11B4)
    SRSRP registry key change notification triggered.    
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:16 AM   
    4532 (0x11B4)
    Waiting for changes for 1 minutes  
    SMS_SRS_REPORTING_POINT 1/25/2013 9:15:16 AM   
    4532 (0x11B4)
    Timed Out...     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM   
    4532 (0x11B4)
    Reporting Services URL from Registry [http://dbsccm/ReportServer/ReportService2005.asmx] 
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM 
    4532 (0x11B4)
    Reporting Services is running
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM   
    4532 (0x11B4)
    Retrieved datasource definition from the server.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM   
    4532 (0x11B4)
    Retrieved datasource definition from the server.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM   
    4532 (0x11B4)
    Updating data source {5C6358F2-4BB6-4a1b-A16E-8D96795D8602} at ManagedDesktops_MD1 
    SMS_SRS_REPORTING_POINT 1/25/2013 9:16:16 AM 
    4532 (0x11B4)
    (!) Error retrieving folders - [A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance
    name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because
    connected host has failed to respond.)].   SMS_SRS_REPORTING_POINT
    1/25/2013 9:17:40 AM    4532 (0x11B4)
    No folder configuration information found.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:17:40 AM   
    4532 (0x11B4)
    Next security configuration at [1/25/2013 9:22:42 AM]
    SMS_SRS_REPORTING_POINT 1/25/2013 9:17:40 AM   
    4532 (0x11B4)
    Root Folder exists     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:17:40 AM   
    4532 (0x11B4)
    Successfully checked that the SRS web service is healthy on server DBSCCM.LOCAL    
    SMS_SRS_REPORTING_POINT 1/25/2013 9:17:40 AM 
    4532 (0x11B4)
    Waiting for changes for 1 minutes  
    SMS_SRS_REPORTING_POINT 1/25/2013 9:17:40 AM   
    4532 (0x11B4)
    Timed Out...     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM   
    4532 (0x11B4)
    Reporting Services URL from Registry [http://dbsccm/ReportServer/ReportService2005.asmx] 
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM 
    4532 (0x11B4)
    Reporting Services is running
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM   
    4532 (0x11B4)
    Retrieved datasource definition from the server.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM   
    4532 (0x11B4)
    Retrieved datasource definition from the server.     
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM   
    4532 (0x11B4)
    Updating data source {5C6358F2-4BB6-4a1b-A16E-8D96795D8602} at ManagedDesktops_MD1 
    SMS_SRS_REPORTING_POINT 1/25/2013 9:18:40 AM 
    4532 (0x11B4)

    Hi:
    Windows Firewall is off on both systems.
    I can ping the Configuration Manager server from the SQL Server by netbios name, ip address and fully qualified domain name.   I can ping the SQL Server from the Configuration Manager server by netbios name, ip address and fully qualified domain
    name.
    I have uninstalled and installed the Reporting Point Service a couple of times and everything looks fine according to the logs after the install finishes but these errors only appear each time I try and Run a report.
    Mark

  • What is the difference between ProRes422 and ProRes422HQ?

    I'm curious about the difference - I'm working with HDV "24 fps" and using Compressor to remove the pulldown to allow editing in 23.98 fps using Apple ProRes422.  Everything I've looked at is silent or fuzzy on which circumstances would lead you to use one or the other of these codecs.  The most helpful is the following from the FCS 7 manual:
    Apple ProRes 422 (HQ) 
    The Apple ProRes 422 (HQ) codec offers the utmost possible quality for 4:2:2 or 4:2:0 sources (without an alpha channel) and provides the following:
    Target data rate of approximately 220 Mbps (1920 x 1080 at 60i)
    Higher quality than Apple ProRes 422
    Apple ProRes 422The Apple ProRes 422 codec provides the following:
    Target data rate of approximately 145 Mbps (1920 x 1080 at 60i)
    Higher quality than Apple ProRes 422 (LT)
    Does anyone have an experience-based perspective on whether it's worth the larger file size - ie do you really get "higher quality" with the HQ?  Obviously I want the best quality I can get, but not if it's undetectable or de minimis.
    Thanks!

    Call it what you want. The way I see it - the greater good is understanding.
    The point of language and symbols is to communicate. If the language and/or symbols are loosing that ability, people have two choices - they can hold to a strict interpretation that is the source of miscommunication (while crying "barbarians at the gates") or they can adapt/adjust so to that the meaning is clearer and the idea is received and understood.
    This is why language is a constantly evolving thing.
    Cheers,
    x

  • After updating to iOS 8.2 on the iPhone 4S, iMessage and FaceTime no longer work properly.

    After updating to iOS 8.2 on the iPhone 4S, iMessage and FaceTime no longer work properly. constant hovering and disconnect from the service.
    Also, I noticed that going to the settings section is disabled service "Find iPhone".
    To get to the point tinctures "Messages" and "FaceTime" takes a few minutes.

    Hello Greg,
    Welcome to Apple Support Communities.
    This article should explain why the Volume slider isn't always visible on your iPhone 4s, and it also provideds tips that can help you resolve the issue.
    If you don't see the iPhone Volume slider - Apple Support
    Take care,
    -Jason

Maybe you are looking for

  • P7n diamond - no bios - 2 of them - fun troubleshooter

    Hello, I write fun troubleshooter because I went so far as to try my friends "working for years" Asus P5B-Plus mobo and CPU and RAM and had same results... Specs:  P7n Diamond - OCZ GameXstream 700W PSU - E8400 Wolfdale - G.Skill 4gb RAM (2x2) - MSI

  • Drag and Drop Image onto Native Application

    I am interested in dragging and dropping an image from a java app to a native app (such as MS-WORD, etc), i have been able to DnD text but have been unsuccessful with images. any tips, resources? Thanks

  • Efax is a disaster on photosmart 7510

    Efax is a disaster on HP photosmart 7510. I have tried many ways to make it works but have been impossible. 

  • Unable to set my Wifi network!

    I just got my my first airport extreme router last evening. I have been struggling to set it up as an extender with my existing Netgear Wi-Fi router, for which I have have had to attach it to my net gear router through ethernet cable. However, after

  • How to join HD and non HD movie clips?

    I have tried several ways to insert this non HD clip into an HD clip. I have also tried converting  both into the same type of file. It always looks like it worked but when I play the completed movie it always freezes up before it reaches the part th