Olap worksheet and sql commands

Im trying to test some sql commands or better im playing with some cursor, but it does not metter what I do the lines get executed one at the time; and the part that is supossed to be translated as program just gives errors; even got an error that define is not a command.
So I was wondering if anyone can give me a simple example of a "define sql.test program..." that contains a cursor.
Thank you in advance

You can execute some commands from the command line in OLAP worksheet (but do not check the SQL Mode option box in OLAP worksheet because that is something completely different). Commands that involve looping are obviously not allowed at the command line.
The easiest way is to create a program and use the OLAP DML help and work through the examples listed. BUT - do not try to cut & paste the code from the examples into your program. For some reason, and I have no idea why, the code gets corrupted when copied, even you if you paste it into notepad first then into your program. As a result your programs will not compile or execute even though the code looks perfect.
In fact if you cut & paste the code from the Help examples into Word and enable viewing of all hidden characters you will see a funny round circle at the start of each word. This is what causes the corruption and means nothing will compile.
Best to just write the code into your program manually.
Hope this helps
Keith Laker
Oracle EMEA Consulting
BI Blog: http://oraclebi.blogspot.com/
DM Blog: http://oracledmt.blogspot.com/
BI on Oracle: http://www.oracle.com/bi/
BI on OTN: http://www.oracle.com/technology/products/bi/
BI Samples: http://www.oracle.com/technology/products/bi/samples/

Similar Messages

  • Can we define the objects (varibales, etc) in the OLAP Worksheet and use it

    Hi,
    I am using AWM 11g ( AWM 11.2.0.3 ). I am trying to build cube for financial data. I tried to define variables, relations in the express backend (rather OLAP worksheet) for refering it into OLAP expressions 9frontend measure. However, whenever I define some object and save it (upd command). I am not finding the same object at the next loging. Is there any way I can do this?
    Thanks,
    Sam

    You can define objects using the OLAP Worksheet. Make sure that you run "commit" after the "update".

  • SAP* and DDIC locked and SQL commands not working

    Dear All,
    We work on ECC6 and SQL 2005 as database.Somehow our SAP* and DDIC user gets locked in production server client 240 and SID AEP
    I tried the following things but none worked.Every time getting error.
    1. First i tried to run the following command in SQLPLUS mode
    in th command prompt i typed sqlplus / nolog(then enter)
    I got the following error sqlplus is not recognized as an internal or external command,operable program or batch file.
    2 Then i thought may be we work on SQL database we may already be in the SQLprompt.Still when i typed conn / as sysdba,same error
    conn is not recognized as an internal or external command,operable program or batch file.
    3.Then i again go to the command prompt and typed
    delete* from sap<AEP>.usr02, where BNAME = ' sap* ' and MANDT = ' 240 '
    This time I get the system cannot find the file specified
    Anyone can please clear my following doubt.
    1. Am I requiredto go in SQLPLUS  mode even when we have SQL Database.
    2. How to unlock this SAP* and other super users.Cause yesterday somebody must have tried to login to sap*,ddic,and sapbasis and in the process locked all by entering the wrong password.
    PS: Other users are working as we have role based authorization
    Help will be highly obliged
    Regards,
    Ashutosh

    Hello, ive got a problem with the SAPDB abd SAP* and DDIC in Client 000
    in our PROD 000 client we forgot the password for SAP* , DDIC and cannot delete it.
    Now the account was locked. please help how to reset SAP * this account on SAPDB.
    Its DB Versio 7.7! I read a lot about that! Please, step by step, is that a problem of interface sqlcli, or rights?
    Please could somebody give me an feedback about sqlcli, could i delete it with this tool the user? Because SQL studio is damaged on that server. Failed installation,Will not work! could not remove!
    I have to configure the server! sorry, i am not so much familar with SAPDB
    in old releases the shema is SAPR3 the new (NW 7) is SAPSR3.
    Checked 701!
    please set login/no_automatic_user_sapstar to 0.= Done!
    At sql propmt: Thats no SAPDB sqxli command, right!!!!
    select * from sapsr3.usr02 where bname='sap*' and mandt='000';
    Thats doesnt work!
    When i logon with the superdba , the connect is fine!
    After the command execute
    D:\sapdb>sqlcli -U DEFAULT delete from sapsr3DB.usr02 where bname='sap*' and mandt ='000';
    -10757: XUSER error (the USERKEY is unknown)
    select * from sapsr3.usr02 where bname='sap*' and mandt='000'; Doesnt work!
    What the hell is the error??? Doesnt find the answer, before, i get the same error then the other colleagues
    unknown table USR02! Is this superdba? Rights of DBA??
    please give an step by step advice. Logon with..... before ... choose sqlci..............sqlcli, \? + sql execute......
    Kind regards
    Ralph

  • FLASHBACK Database : rman vs sql command differnces

    I am new to Oracle and want understand the difference and which is the correct way of flashing back the database?
    RMAN command vs SQL Command on using FLASHBACK DATABASE
    SQL> FLASHBACK DATABASE TO RESTORE POINT BEFORE_ONLINE_TEST;  {CODE} Vs rman> run{
         flashback database to restore point BEFORE_TEST_320130313;
         sql "alter database open resetlogs"; }
    Referring this article on http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmflash.htm#BGBDCAFA it says we can use both RMAN and SQL command for database flashback.
    Questions:
    1. Difference between using RMAN and SQL command on database flashback?
    2. When to use RMAN or SQL on the  database flashback?
    3. Which is the Oracle recommended or best way ?
    Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
    Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
    Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
    Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
    Edited by: Sivaprasad S on Mar 15, 2013 7:28 PM
    Edited by: Sivaprasad S on Mar 15, 2013 7:29 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    When I issue the SQL Plus command of
    SQL> flashback database to restore point BEFORE_TEST_20130313 ;
    flashback database to restore point BEFORE_TEST_20130313
    ERROR at line 1:
    ORA-38754: FLASHBACK DATABASE not started; required redo log is not available
    ORA-38762: redo logs needed for SCN 87612483975 to SCN 87612485856
    ORA-38761: redo log sequence 1 in thread 1, incarnation 3 could not be accessedHowever on running this on RMAN
    RMAN>
    list backup of archivelog scn between 87612483975 and 87612485856
    RMAN> ;
    starting full resync of recovery catalog
    full resync complete
    List of Backup Sets
    ===================
    BS Key  Size       Device Type Elapsed Time Completion Time
    5212758 19.75M     SBT_TAPE    00:00:04     13-MAR-2013 16:36:17
            BP Key: 5212765   Status: AVAILABLE  Compressed: NO  Tag: TAG20130313T163611
            Handle: <TestDB_60:809973373:1>.al   Media: 945c30b6:506c6cd2:3a14:0001
      List of Archived Logs in backup set 5212758
      Thrd Seq     Low SCN    Low Time             Next SCN   Next Time
      1    1       87612468290 13-MAR-2013 13:28:19 87612484321 13-MAR-2013 16:36:06
      1    2       87612484321 13-MAR-2013 16:36:06 87612484339 13-MAR-2013 16:36:09
    BS Key  Size       Device Type Elapsed Time Completion Time
    5212759 896.50M    SBT_TAPE    00:00:17     13-MAR-2013 16:36:30
            BP Key: 5212766   Status: AVAILABLE  Compressed: NO  Tag: TAG20130313T163611
            Handle: <TestDB_59:809973373:1>.al   Media: 945c30b6:506c6cbd:39f5:0001
      List of Archived Logs in backup set 5212759
      Thrd Seq     Low SCN    Low Time             Next SCN   Next Time
      1    5       87612363812 12-MAR-2013 14:22:26 87612659040 13-MAR-2013 03:04:08
    run {
    allocate CHANNEL dev_2  TYPE 'SBT_TAPE' format '%U' PARMS  'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
    allocate CHANNEL dev_3  TYPE 'SBT_TAPE' format '%U' PARMS  'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
    allocate CHANNEL dev_4  TYPE 'SBT_TAPE' format '%U' PARMS  'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
    flashback database to restore point BEFORE_TEST_20130313;
    sql "alter database open resetlogs";
    release channel dev_2;
    release channel dev_3;
    release channel dev_4;
    starting media recovery
    archived log for thread 1 with sequence 2 is already on disk as file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_2.3612.810054205
    archived log for thread 1 with sequence 3 is already on disk as file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_3.1588.810054205
    channel dev_2: starting archived log restore to default destination
    channel dev_2: restoring archived log
    archived log thread=1 sequence=1
    channel dev_2: reading from backup piece <TestDB_60:809973373:1>.al
    channel dev_2: piece handle=<TestDB_60:809973373:1>.al tag=TAG20130313T163611
    channel dev_2: restored backup piece 1
    channel dev_2: restore complete, elapsed time: 00:00:46
    channel dev_2: deleting archived log(s)
    archived log file name=+DG_PERF_FLASH_02/TestDB/archivelog/2013_03_15/thread_1_seq_1.2969.810106317 RECID=49 STAMP=810106318
    media recovery complete, elapsed time: 00:00:05
    Finished flashback at 10-MAR-2013 05:32:07
    database reset to incarnation 5215723
    When we issue the SQL Plus command, if there is  need of old database backup of archive log, how does that SQL Plus communicate with rman recovery catalog and retrieve?

  • Olap worksheet copy and paste fails hard parse

    Hi
    i've noticed something strange in the AWM olap worksheet that may help anyone using it.
    when you copy and paste some code to be executed it fails with strange errors however if you then type the code it runs without problem.
    bizarrely if you copy and paste the code in again it works..
    shown below is the console: 1st is pasted, 2nd typed, 3rd pasted... had me bashing my head against the screen a few times before i worked out what was going on.
    ->ROW 'SMOOTHING' FCQUERY(fc smoothing trial loopindx)
    ERROR: (ORA-33776) ROW is not a command.
    ORA-33776: ROW is not a command.
    ->ROW 'SMOOTHING' FCQUERY(fc smoothing trial loopindx)
    SMOOTHING no
    ->ROW 'SMOOTHING' FCQUERY(fc smoothing trial loopindx)
    SMOOTHING no
    ->
    I assume this is a parsing problem (i'm cutting and pasting from notepad btw).
    Once typed and parsed properly it doesn't do a hard parse again perhaps.
    In any case watch out for it, especially when copying example programs from the help text :), you have to type them a la spectrum48k. (10 print 'start' .....;)

    If you are copying and pasting from the OLAP DML Help then this is a known issue. The DML Help contains hidden characters that stop the code from executing.
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • Problem creating a SQL command object and adding it to a Crystal report

    Hi,
    I'm trying to add the following SQL command object with the following sql for MYSQL 5.1
    SELECT lic.id, lic.productionname, comp.companyname, lic.paymentreceiveddate, lic.licenseissuedate,
    IFNULL((SELECT sum(licsong.feequoted) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfeequoted,
    IFNULL((SELECT sum(licsong.feetax) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfeetax,
    IFNULL((SELECT sum(licsong.feequoted + licsong.feetax) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfee,
    IFNULL((SELECT sum(pay.fullamount) from payment pay where pay.licenseid = lic.id),0) as totalpaid
    FROM license lic
    INNER JOIN company comp on lic.licensecompanyid= comp.id;
    This sql runs fine in the Query Browser of mysql and returns what I want.
    When I try to add this SQL command to a new Crystal Report, (by right clicking in the sql editor and selecting Crystal Reports - Add to new Crystal Report), it locks up my Eclipses and it ends up not responding. If I just do a simple SELECT * FROM license it works fine.
    The Eclipse I'm using is from the CR4E download page with the crystal plugin already installed.
    Any help with this would be greatful, as I am not having much joy with this CR4E 2.0 with MySQL and may have to scrap it and go back creating reports in Apache POI.
    Any help greatly received.
    Kind regards

    Hi,
    Try to select a particular columns instead of doing SELECT * FROM license.
    Thanks,
    Saravanakumar

  • Read from sql task and send to data flow task - [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.

    I have created a execut sql task -
    In that, i have a created a 'empidvar' variable of string type and put sqlstatement = 'select distinct empid from emp'
    Resultset=resultname=0 and variablename=empidvar
    I have added data flow task of ole db type and I put this sql statement under sql command - exec emp_sp @empidvar=?
    I am getting an error.
    [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.
    [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC02092B4.

    shouldnt setting be Result
    Set=Full Resultset as your query returns a resultset? also i think variable to be mapped should be of object type.
    Then for data flow task also you need to put it inside a ForEachLoop based on ADO.NET recordset and map your earlier variable inside it so as to iterate for every value the sql task returns.
    Also if using SP in oledb source make sure you read this
    http://consultingblogs.emc.com/jamiethomson/archive/2006/12/20/SSIS_3A00_-Using-stored-procedures-inside-an-OLE-DB-Source-component.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to find out the failed sql command and its data from DEFERROR

    Hi,
    has anybody a procedure or some other possibilities to read the content of column USER_DATA of the advanced replication view DEFERROR in order to find out the failed sql command and its column values?
    Thanks in advance.

    Hi Vishwa,
                 The control would be something like this for navigation in Get_p_xxx method u mention as link and u mention a event name which gets triggered on the click of this hyperlink. So your GET_P_XXX method would have the following code:
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'EXAMPLE'.
    Now you have to create a method as EH_ONEXAMPLE at your IMPL class and within which you would give an outbound plug method. Within the outbound plug the target data would be filled in the collection and window outbound plug would be triggered.
    This is a huge topic and  i have just mentioned you basic things.
    Regards,
    Bharathy.

  • Crystal report SQL Command and using IN

    Post Author: geozuh
    CA Forum: Crystal Reports
    Does any one know how to get a multiple value prompts to work in Crystal report SQL Commands? I have an extremely large database and do not want to pull back all the records to the report. I know I can do the filtering in the report, but due to the size of the database, I am restricked from doing do.
    I would like to set the State as a multiple value parameter/prompt to be used in the SQL Command.
    Ex.
    Select CustID, FirstName, LastName
    from Customer
    where State in ('WI', 'IL', 'MN') --this would be turned into a parameter

    Post Author: yangster
    CA Forum: Crystal Reports
    you are over thinking the problemsimply create a parameter within crystal for your state and change it to allow multiple valuesthen in the select expert put in state = ?stateif you do show sql query you will see that the values are pushed down to the sql level thus no performance hit vs putting the parameter directly in the command itself

  • Creating OLAP report with Crystal Reports and SQL Server Analysis Services 2005

    Post Author: orahc_mao
    CA Forum: Data Connectivity and SQL
    Hi!
    I am currently using the trial version of the Crystal Reports XI and I wanted to do an OLAP report. The problem is I cannot select a cube using "OLAP Connection Browser" (the popup window). I already selected Microsoft OLE DB Provider and entered the server name but still can't connect.
    I don't think the problem is with SQL Server Analysis Services (2005) since Microsoft Excel - Import Data can detect the server as well as the cube I have created.
    I also tried the "Database Expert" of Crystal Reports, created an OLE DB (ADO) connection with "OLE DB Provider for OLAP Services 8.0" driver, entered the server name, checked the integrated security and then I can readily select the database created at SQL Server Analysis Services. However, I still need the OLAP grid create the report but it goes back to my original problem... selecting a cube.
    I hope somebody would help me with this issue.
    Thanks a lot!
    orahc_mao

    Hello,
    I don't recognize those variables as CR ones so it's likely something the original developer is setting in code.
    You'll have to discuss with that person.
    If your have SDK issues then post your question to one of the .NET or Java SDK forums.
    Thank you
    Don

  • Restrictions for using sql commands and operators in loader control file

    Hi ,
    It suppose that there is a lot of restrictions and limitations when using sql commands and operators in the loader control files, same as it seems I cannot use (or) when with case statement, also it seems there is certain length for the case,
    So guys, what are the common limitations and restrictions to be avoided in the loader control file ?
    Your efforts are highly appreciated
    Ash

    Hi Ash,
    if you need to do more complicated logic its better to define the file to be loaded as an external table. You can then use any sql function you like against the external table rather than messing around with what you can and can;t do in a sqlldr control file.
    You can use the external_table option of sqldr to generate the definition.
    Regards,
    Harry
    http://dbaharrison.blogspot.com/

  • SQL Command and JOIN Types

    I'm using CR 10 and I am trying to write a SQL command.  Sadly I'm only able to pull one table.  When I try to link in a second table I get a FAILED TO OPEN ROWSET Error.  It also mentions an extra token: OUTER
    So It sounds like it doesn't like my JOIN statement
    I can't seem to figure out the correct syntax to use for the join type.  I tried using this format
    SELECT "Customers"."FirstName", Customers"."LastName", ."SalesOrder"."Sales"
    FROM "Customers" RIGHT OUTER JOIN "Sales"
    ON "Customers"."CustomerID" = "Sales"."CustomerID"
    I am going this route because I tried linking the tables by using the wizard and the report is unbelievably slow.
    Any ideas would be greatly appreciated!
    Thanks!

    The database it is querying is a ProvideX database. 
    I was able to get the SQL statement to work, however it didn't do any good at all.  The report still pulls the data just as slow.  The database table it is pulling from has a large amount of data.  When I do an INNER JOIN to the two tables, it queries it very quickly.  However when I perform the LEFT OUTER JOIN, it decreases the performance dramatically.  WO1 has all the work orders that have been entered, WO2 has all the materials for the work orders.  If there are no materials in the work order, I will not get all of my work orders entered, only work orders with materials on them.
    If I go to the LEFT OUTER JOIN I then get the results I need, it's just slow and most of the time the report will crash.
    Here is the actual syntax I am working with.  I was hoping a SQL statement would speed it up but that is not the case. 
    SELECT "WO1_WorkOrderMaster"."WorkOrder","WO1_WorkOrderMaster"."QtyComplete", "WO1_WorkOrderMaster"."ActualProdStartDate", "WO1_WorkOrderMaster"."QtyOrdered", "WO2_WorkOrderMaterialDetail"."ComponentItemNumber"
    FROM   {oj "WO1_WorkOrderMaster" "WO1_WorkOrderMaster" LEFT OUTER JOIN "WO2_WorkOrderMaterialDetail" "WO2_WorkOrderMaterialDetail" ON "WO2_WorkOrderMaterialDetail"."WorkOrder"="WO1_WorkOrderMaster"."WorkOrder"}

  • SQL Command and Datetime Parameters

    <p>Hi, </p><p>I am having problems  adding datetime parameters to a SQL command.</p><p>The code is AND table.startdatetime >= &#39;{?start}&#39; </p><p>I enter the time and date in the parameter and get the following error.<br /><br /><strong>Incorrect syntax near 2006</strong></p><p>Any clues</p><p>Thanks</p>

    Hi,
    What database you are using?
    Regards
    Sarobinyal

  • SQL Command to Check ABAP Support Patches and JSPM Patch

    Dear all,
    We have setup an DiasterRecovery System of the BI Production System .
    os: aix 6.1
    Database: Oracle 11.2
    BUT , Our DR System is in Physical Standby mode.
    Generally, we see the ABAP Patch version in SAP GUI ( System -- System status).
    Likewise, Is there any SQL Command available to check the version ABAP Patches (
    SAP_BASIS, SAP_ABAP, PI_Cont add on, PI_BASIS AND BW Patch - SAP_BW)
    Is there any sql command to check the version of JSPM or JAVA Patch
    regards,
    gayathri.K

    Hi Gayathri,
    BUT , Our DR System is in Physical Standby mode.
    Generally, we see the ABAP Patch version in SAP GUI ( System -- System status).
    Likewise, Is there any SQL Command available to check the version ABAP Patches (
    SAP_BASIS, SAP_ABAP, PI_Cont add on, PI_BASIS AND BW Patch - SAP_BW)
    You can perform sql query on CVERS table.
    For eg: Select * from <schema>.CVERS ;
    This will list all the entries with all the columns from CVERS table.
    Hope this helps.
    Regards,
    Deepak Kori

  • Filler and Skip command in SQL Loader

    Hai Gurus !
    Can Any help me to send code for filler and skip command in SQL Loader. and please explain about filler, for what purpose it is used.

    Have you checked on the documentation? Filler is explained for example in the chapter Field List Reference.
    C.

Maybe you are looking for

  • TV shows purchased through iTunes on PC delayed in showing up on Apple TV.

    I've been searching for a couple of days trying to find someone with a similiar problem (and, hopefully, an explanation). Unfortunately, I must not be using the right keywords because I can't believe that my problem is really unique. This is a proble

  • How do I play all tracks on an album sequentially on iPod nano 6th generation ?

    I have an ipod nano 6th generation. I want to play all tracks on an album sequentially (as if I was playing a CD) without having to select each one in turn. On my ipod nano it repeats the same song and wont move to the next one automatically. can any

  • Uninstall Acrobat 9.0.0 Pro from Mac OS

    I have just upgraded my OS to Mavericks, which doesn't work with Acrobat 9 Pro, so I've purchased Acrobat XI and installed it. Now I can't get rid of Acrobat 9 Pro. The uninstaller in that folder doesn't work. When I try to open it, the uninstaller t

  • Urgent: Portletizing an struts JSP application

    Hello all, I have a struts JSP application. I want to portletize this whole application, so that navigation is always within the portal framework. Using URL Services all I can see is that the first page will be a portlet. Can anyone suggest the best

  • Arguments in function passed through shell script

    HI all, I have a shell script test.sh it contains the following A=$1 B=$2 C=$3 D=$4 sqlplus usr/pwd<<eof a varchar2(10); b varchar2(10); c date; d date; a:='$A'; b:='$B'; c:='$C'; d:='$D'; func(a,b,c,d(; eof func() defbn func(name varchar2,trc varcha