The dynamic function of question regarding

Hello

Please find the attachment for the required scripts.

Please help me how to run a package function dynamically in anonymous block. I tried to use EXECUTE IMMEDIATE but did not work.

My requirement is I have a lot of emp_demo in which it contains 3 functions and I've created a lookup table which are inserted the names of functions. then I tried to read a function name after another using the loop and execution, but it shows PLS-00382: expression is of type incorrect error.

Please suggest.

Kind regards

Phani.

Hey Brad,

Try this

set serveroutput on
declare
  plsql_block varchar2(200);
  c1 sys_refcursor;
  v_empno number;
  v_ename varchar2(20);
  v_job varchar2(20);
begin
  for r in(select name as function_name from lt_emp_demo)
  loop
    plsql_block := replace('begin :rc := emp_demo.@FUNCTION; end;', '@FUNCTION', r.function_name);
    dbms_output.put_line(plsql_block);
    --
    EXECUTE IMMEDIATE plsql_block USING OUT c1;
    --
    fetch c1 into v_empno,v_ename,v_job;
    dbms_output.put_line(v_empno || ', ' || v_ename || ', ' || v_job);
  end loop;
end;
/

anonymous block completed
begin :rc := emp_demo.rpt_emp1; end;
7369, SMITH, CLERK
begin :rc := emp_demo.rpt_emp2; end;
7654, MARTIN, SALESMAN
begin :rc := emp_demo.rpt_emp3; end;
7844, TURNER, SALESMAN

See http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/dynamic.htm#LNPLS011

"Dynamic SQL is a programming methodology to build and run SQL statements at run time. This is useful when the time writing programs versatile and flexible as ad hoc query systems, when you write programs that must run the database (DDL) instructions definition language, or when you don't know at compile time the full type of statement, the number or data SQL of its input and output variables. »

Tags: Database

Similar Questions

  • How to share the same function in different frames

    I create a quiz of multiple choice with several questions.

    I have every clickable selection using "answer1", "answer2"... as the instance name.

    I created a standard button to show the different States and make selection (like what is below):

    ANSWER1.buttonMode = true; / / to display the hand icon

    ANSWER1.addEventListener (MouseEvent.CLICK, answer1Click);

    ANSWER1.addEventListener (MouseEvent.ROLL_OVER, answer1Rollover);

    ANSWER1.addEventListener (MouseEvent.ROLL_OUT, answer1Rollout);

    function answer1Click(ev:MouseEvent):void

    {

    ANSWER1.gotoanswerndStop (2);

    ANSWER2.gotoanswerndStop (1);

    answer3.gotoanswerndStop (1);

    answer4.gotoanswerndStop (1);

    salt = 1;

    }

    function answer1Rollover(ev:MouseEvent):void

    {

    ANSWER1.gotoanswerndStop (2);

    }

    function answer1Rollout(ev:MouseEvent):void

    {

    If (salt! = 1).

    {

    ANSWER1.gotoanswerndStop (1);

    }

    }

    Duplicate the setting for different questions, but I can't reuse the same functions for the first question. It would give error 'Duplicate' function definition... I don't want to rename the names of instances for each new question. How can I reuse the same function for questions?

    Thank you

    This layer only for functions do not use to add event listeners. Add headphones when the answer buttons appear:

  • Yes, another question regarding the freezing of Safari - EtreCheck report included

    Yes, another question regarding the freezing of Safari.

    From a little over a month (I think), Safari started freezing regularly whenever I want to open new tabs or switch between tabs. I found myself to leave the program several times per day / hour. I can't identify any specific common cause (other than my MacBook being old) or any new software or updates that might have initiated the question. At first I thought he might have many tabs, I tried to open, but recently it happens even with only a few tabs open.

    I worked through the steps I found in this forum and others: empty the cache, start in safe mode, etc nothing works.

    Based on the previous suggestions, I have downloaded and run EntreReport which I included below. The note and maybe just a distraction, but EntreReport has crashed three times tonight, before he was able to produce the sub report. I ran the report after restarting my system with no other programs running.

    Suggestions are welcome at this stage because I want to start using Chrome or Firefox because I like the transfer procedure between my devices.

    Thank you in advance.

    Ben

    -----------

    EtreCheck version: 2.9.11 (264)

    Report generated 2016-04-28 22:48:58

    Download EtreCheck from https://etrecheck.com

    Time 05:45

    Performance: Below average

    Click the [Support] links to help with non-Apple products.

    Click [details] for more information on this line.

    Click on the link [check files] help with unknown files.

    Problem: Apps are broken

    Description:

    Safari freeze when opening new tabs / switching between the tabs.

    Hardware Information:

    MacBook Pro (15-inch, mid 2009)

    [Data sheet] - [User Guide] - [warranty & Service]

    MacBook Pro - model: MacBookPro5, 3

    1 2.66 GHz Intel Core 2 Duo CPU: 2 strands

    4 GB of RAM expandable - [Instructions]

    BANK 0/DIMM0

    OK 2 GB DDR3 1067 MHz

    BANK 1/DIMM0

    OK 2 GB DDR3 1067 MHz

    Bluetooth: Old - transfer/Airdrop2 not supported

    Wireless: en1: 802.11 a/b/g/n

    Battery: Health = battery check - Cycle count = 389

    Video information:

    NVIDIA GeForce 9400M - VRAM: 256 MB

    Color LCD 1440 x 900

    NVIDIA GeForce 9600M GT - VRAM: 256 MB

    Software:

    OS X El Capitan 10.11.4 (15E65) - since startup time: less than an hour

    Disc information:

    FUJITSU MJA2320BH FFS G1 disk0: (320,07 GB) (rotation)

    EFI (disk0s1) < not mounted >: 210 MB

    Macintosh HD (disk0s2) /: 319,21 go-go (54,93 free)

    Recovery HD (disk0s3) < not mounted > [recovery]: 650 MB

    HL-DT-ST DVD - RW GS23N)

    USB information:

    Built-in ISight from Apple Inc..

    Card reader Apple

    Apple Inc. BRCM2046 hub.

    Apple Inc. Bluetooth USB host controller.

    Apple Inc. Apple keyboard / Trackpad

    Computer, Inc. Apple IR receiver.

    Guardian:

    Mac App Store and identified developers

    Unknown files:

    ~/Library/LaunchAgents/com. GoodShop.updater.plist

    ~/Library/application support/GoodShop/updater

    A unknown file found. [Check files]

    Kernel extensions:

    / Library/Application Support/Symantec/virus

    [no charge] com.symantec.kext.SymAPComm (11.1.2f17 - 2015-05-23) [Support]

    / Library/Extensions

    [no charge] expressvpn.tap (20150118 - 2016-04-12) [Support]

    [loading] expressvpn.tun (20150118 - 2016-04-12) [Support]

    / System/Library/Extensions

    [no charge] com.DYMO.usbprinterclassdriver.kext (1.1 - SDK 10.9-2016-04-12) [Support]

    com.Silex.driver.sxuptp [no charge] (1.5.1 - 2016-04-12) [Support]

    com.symantec.kext.internetSecurity [no charge] (1.3.2 - 2016-04-12) [Support]

    com.Symantec.kext.IPS [no charge] (3.2 - 2016-04-12) [Support]

    Startup items:

    CMA: path: / Library/StartupItems/cma

    RosettaStoneLtdDaemon: Path: / Library/StartupItems/RosettaStoneLtdDaemon

    Startup items are obsolete in OS X Yosemite

    Launch system officers:

    [loaded] 8 tasks Apple

    [loading] 165 tasks Apple

    [operation] 65 tasks Apple

    Launch system demons:

    [loaded] 45 tasks Apple

    [loading] 161 tasks Apple

    [operation] 83 tasks Apple

    Launch officers:

    [no charge] com.adobe.AAM.Updater - 1.0.plist (2016-04-28) [Support]

    [failure] com.adobe.ARMDCHelper.cc24aef4a1b90ed56a... plist (2015-10-31) [Support]

    [operation] com.epson.Epson_Low_Ink_Reminder.launcher.plist (2015-01-19) [Support]

    [loading] com.epson.esua.launcher.plist (2015-06-29) [Support]

    [operation] com.epson.eventmanager.agent.plist (2014-09-21) [Support]

    [loading] com.google.keystone.agent.plist (2016-03-01) [Support]

    [operation] com.mcafee.menulet.plist (2016-03-23) [Support]

    [operation] com.mcafee.reporter.plist (2016-03-23) [Support]

    [loading] com.oracle.java.Java - Updater.plist (2013-11-14) [Support]

    [operation] com.symantec.uiagent.application.plist (2010-11-16) [Support]

    [operation] com.trusteer.rapport.rapportd.plist (2016-03-19) [Support]

    Launch demons:

    [loading] com.adobe.ARMDC.Communicator.plist (2015-10-31) [Support]

    [loading] com.adobe.ARMDC.SMJobBlessHelper.plist (2015-10-31) [Support]

    [loading] com.adobe.fpsaud.plist (2016-04-15) [Support]

    com.DYMO.pnpd.plist [no charge] (2014-10-16) [Support]

    [loading] com.expressvpn.tap.plist (2016-01-27) [Support]

    [loading] com.expressvpn.tun.plist (2016-01-27) [Support]

    [loading] com.google.keystone.daemon.plist (2016-03-01) [Support]

    [loading] com.macpaw.CleanMyMac3.Agent.plist (2016-04-18) [Support]

    [operation] com.mcafee.cspd.plist (2015-05-08) [Support]

    com.mcafee.ssm.ScanFactory.plist [no charge] (2016-03-16) [Support]

    com.mcafee.ssm.ScanManager.plist [no charge] (2016-03-16) [Support]

    [operation] com.mcafee.virusscan.fmpd.plist (2016-03-22) [Support]

    [loading] com.microsoft.office.licensing.helper.plist (2010-08-25) [Support]

    [loading] com.oracle.java.Helper - Tool.plist (2013-11-14) [Support]

    [loading] com.symantec.MissedTasks.plist (2009-11-10) [Support]

    [loading] com.symantec.Sched501 - 1.plist (2014-08-27) [Support]

    [loading] com.symantec.Sched501 - 4.plist (2015-01-08) [Support]

    [loading] com.symantec.Sched501 - 5.plist (2015-01-08) [Support]

    [loading] com.symantec.avscandaemon.plist (2009-10-10) [Support]

    [operation] com.symantec.diskMountNotify.plist (2009-09-14) [Support]

    [loading] com.symantec.navapd.plist (2009-09-14) [Support]

    [loading] com.symantec.navapdaemonsl.plist (2009-11-14) [Support]

    [operation] com.symantec.sharedsettings.plist (2009-07-22) [Support]

    [operation] com.symantec.symSchedDaemon.plist (2009-11-10) [Support]

    [operation] com.symantec.symdaemon.plist (2009-03-27) [Support]

    [operation] com.trusteer.rooks.rooksd.plist (2016-03-19) [Support]

    User launch officers:

    com [running]. GoodShop.updater.plist (2013-09-24) [Support]

    [loading] com.adobe.AAM.Updater - 1.0.plist (2015-10-25) [Support]

    [failure] com.facebook.videochat. [entrenched passage] .plist (2014-08-09) [Support]

    [loading] com.macpaw.CleanMyMac3.Scheduler.plist (2016-04-25) [Support]

    Items in user login:

    iTunesHelper Application (/ Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)

    Application of Google Reader (Google Drive.app/Applications /)

    Dropbox application (/ Applications/Dropbox.app)

    ExpressVPN application (/ Applications/ExpressVPN.app)

    CleanMyMac 3 Menu Application (/ Applications/CleanMyMac 4.app/Contents/MacOS/CleanMyMac 3 Menu.app)

    Other applications:

    [ongoing] com.DYMO.pnpd

    [ongoing] com.getdropbox.dropbox.83552

    [ongoing] com.google.GoogleDrive.81632

    [ongoing] com.macpaw.CleanMyMac3.Menu.80672

    [ongoing] com.mcafee.ssm.ScanManager

    [ongoing] com.mcafee.virusscan.ssm.ScanFactory

    [loading] 420 tasks Apple

    [operation] 193 tasks Apple

    Plug-ins Internet:

    o1dbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-16) [Support]

    Default browser: 601 - SDK 10.11 (2016-04-18)

    Flip4Mac WMV Plugin: 2.4.4.2 (2012-12-25) [Support]

    DYMO Safari Addin: Unknown - SDK 10.9 (2014-10-26) [Support]

    AdobePDFViewerNPAPI: 15.010.20060 - SDK 10.8 (2016-03-11) [Support]

    FlashPlayer - 10.6: 21.0.0.226 - SDK 10.6 (2016-04-25) [Support]

    Silverlight: 5.1.30514.0 - SDK 10.6 (2015-09-16) [Support]

    QuickTime Plugin: 7.7.3 (2016-04-12)

    Flash Player: 21.0.0.226 - SDK 10.6 (2016-04-25) [Support]

    googletalkbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-11) [Support]

    iPhotoPhotocast: 7.0 (2010-11-15)

    AdobePDFViewer: 15.010.20060 - SDK 10.8 (2016-03-11) [Support]

    SharePointBrowserPlugin: 14.3.0 - SDK 10.6 (2013-02-09) [Support]

    SiteAdvisor: 2.0 - 10.1 SDK (2015-03-30) [Support]

    JavaAppletPlugin: Java 8 updated 77 03 (2016-04-18) check the version of build

    Safari extensions:

    AdBlock - BetaFish, Inc. - https://getadblock.com (2016-03-30)

    Add to wishlist Amazon - Amazon.com - http://www.amazon.com/wishlist?ref=cm_wl_saf_ext (2011-07-09)

    GoodShop - GOODSEARCH LLC - http://www.GoodSearch.com (2013-09-24)

    SiteAdvisor - McAfee - http://www.siteadvisor.com (2015-09-28)

    PIN button - Pinterest, Inc. - http://www.pinterest.com/ (2015-07-03)

    3rd party preference panes:

    Flash Player (2016-04-15) [Support]

    Flip4Mac WMV (2012-05-15) [Support]

    Growl (2015-09-16) [Support]

    Java (2016-04-18) [Support]

    Norton\nQuickMenu (2010-11-16) [Support]

    Trusteer Endpoint Protection (2016-04-18) [Support]

    Time Machine:

    Time Machine not configured!

    Top of page process CPU:

    5% WindowServer

    1% kernel_task

    0% fontd

    0% SymDaemon

    Top of page process of memory:

    445 MB kernel_task

    Mdworker (18) 430 MB

    164 MB Google Reader

    Dropbox 123 MB

    VShieldScanner (4) 66 MB

    Virtual memory information:

    106 MB free RAM

    4.15 GB used RAM (770 MB cache)

    6 MB used Swap

    Diagnostic information:

    April 28, 2016, 22:42:12 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-224212_[redacted].crash

    com.etresoft.EtreCheck - /Applications/EtreCheck.app/Contents/MacOS/EtreCheck

    28 April 2016, 22:21:42 self-test - spent

    April 28, 2016, 19:49:12 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-194912_[redacted].crash

    April 28, 2016, 19:47:10 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-194710_[redacted].crash

    April 28, 2016, 19:38:58 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-193858_[redacted].crash

    April 28, 2016, 19:04:58 ~/Library/Logs/DiagnosticReports/rapportd_2016-04-28-190458_[redacted].crash

    /Library/rapport/*/rapportd.app/Contents/MacOS/rapportd

    April 28, 2016, 06:06:59 /Library/Logs/DiagnosticReports/Safari_2016-04-28-060659_[redacted].hang

    /Applications/Safari.app/Contents/MacOS/Safari

    April 28, 2016, 12:48:04 AM /Library/Logs/DiagnosticReports/SubmitDiagInfo_2016-04-28-004804_[redacted].cpu _resource.diag [details]

    / System/Library/CoreServices/SubmitDiagInfo

    April 27, 2016, 22:01:10 /Library/Logs/DiagnosticReports/Safari_2016-04-27-220110_[redacted].hang

    April 27, 2016, 21:57:37 /Library/Logs/DiagnosticReports/Safari_2016-04-27-215737_[redacted].hang

    April 27, 2016, 19:05:50 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-27-190550_[redacted].crash

    April 27, 2016, 06:57:28 ~/Library/Logs/DiagnosticReports/Airmail 2_2016-04-27-065728_ .crash [deleted]

    / Applications/Airmail 2.app/Contents/MacOS/Airmail 2

    26 April 2016, 19:48:11 /Library/Logs/DiagnosticReports/Safari_2016-04-26-194811_[redacted].hang

    Remove all apps viruses you have

    Symantec, McAfee, Norton...

    CleanMyMac3

  • How to pass the dynamic parameter to a function of database in OBIEE

    Hello

    I have a requirement like this. I need to create a report in OBIEE which stood in the discoverer. Now in the Scout report there is a calculated item in the worksheet based on the pkg.functions database. The user setting which gives the runtime parameters are then passed to the discoverer calculated elements dynamically. But I am not able to do this in OBIEE answers.

    Can someone tell me step by step how I can able to transmit the values of user setting selected in the level of response OBIEE.

    The example:

    GET_COMM_VALUE_PTD ('cost AFE & commitment'. ID of the AFE,: ' name at that time (AFE) ', 'cost of the AFE & commitment '. Salt of data, 'cost of the AFE & commitment '. The org ID)

    GET_COMM_VALUE_PTD - database function
    ('Cost AFE & commitment'. ID of the AFE,: ' name at that time (AFE) ', 'cost of the AFE & commitment '. Salt of data, 'cost of the AFE & commitment '. org Id - settings...: "period Name (AFE)" is the dynamic setting of the execution by the user.


    Help, please.

    Thank you

    Titas

    Hello

    Please see this link.

    http://satyaobieesolutions.blogspot.in/2012/08/database-evaluate-function-database.html

    This can be help you.

    Thank you
    Satya

  • Strange question before the header function call

    Hello

    I use Oracle APEX 3.2.1.00.10 with a database of Oracle 10.2.0.4. It seems that when I call some functions in an anonymous plsql block a page header before I get

    ORA-01858: a non-digit character was found here where was waiting for a digital

    errors. The functions in question accept 2 types of NUMBER and RETURNS a type NUMBER. The code works correctly PLSQL. Is there a limit on the size of a function I can call
    directly from APEX or maybe theres some type conversion happening?

    All the ideas that it is rather strange that the other functions seem to work well

    Thanks in advance!

    As Paul said, there are probably some date related code in the body of the function. The reason why it performs very well outside the APEX is perhaps because the default NLS_DATE_FORMAT value is different to what uses the APEX. Try to play with it, hope that helps.

  • A few questions regarding the audit

    Hi all



    Greetings. I have a few questions regarding the audit.


    1. how to enable auditing for create table and truncate table by a user?

    SQL> audit table by schema_name;
    
    Audit succeeded.
    Fact the knowledge of the above: http://psoug.org/reference/auditing.html

    This succeeded. But when I actually created a table, it does not reflect in the dba_audit_trail;


    Do I have to use the number of action by and then combine it with another table to populate the create table/truncate table?


    2. How can I check what all auditing has been activated so far?


    Please suggest me. I am unable to follow the audit to create and truncate.


    Concerning
    KK

    In the above article that I mentioned earlier it said check the dba_audit_trail table.

    COLUMN username FORMAT A10
    COLUMN owner    FORMAT A10
    COLUMN obj_name FORMAT A10
    COLUMN extended_timestamp FORMAT A35
    
    SELECT username,
           extended_timestamp,
           owner,
           obj_name,
           action_name
    FROM   dba_audit_trail
    WHERE  owner = 'AUDIT_TEST'
    ORDER BY timestamp;
    
    USERNAME   EXTENDED_TIMESTAMP                  OWNER      OBJ_NAME   ACTION_NAME
    ---------- ----------------------------------- ---------- ---------- ----------------------------
    AUDIT_TEST 16-FEB-2006 14:16:55.435000 +00:00  AUDIT_TEST TEST_TAB   CREATE TABLE
    AUDIT_TEST 16-FEB-2006 14:16:55.514000 +00:00  AUDIT_TEST TEST_TAB   INSERT
    AUDIT_TEST 16-FEB-2006 14:16:55.545000 +00:00  AUDIT_TEST TEST_TAB   UPDATE
    AUDIT_TEST 16-FEB-2006 14:16:55.592000 +00:00  AUDIT_TEST TEST_TAB   SELECT
    AUDIT_TEST 16-FEB-2006 14:16:55.670000 +00:00  AUDIT_TEST TEST_TAB   DELETE
    AUDIT_TEST 16-FEB-2006 14:17:00.045000 +00:00  AUDIT_TEST TEST_TAB   DROP TABLE
    
    6 rows selected.
    
    SQL>
    

    Have you reviewed this table?

    Alternatively, you can consult the table of dba_stmt_audit_opts.
    DBA_STMT_AUDIT_OPTS

    Published by: Kerri_Robberts on July 15, 2011 15:11

  • link to the function in the dynamic text field

    so I have a dynamic text field that needs to display something like...

    You have been identified as Syd Barrett. If it is incorrect, click here

    the dynamic part is the name of Syd Barrett in this example, which is introduced by a variable. now how the word 'here' to become a link to an ActionScript function and a different color?

    I was wondering how to do this also. There is a global function called asfunction, described in language AS as Reference: a special protocol for URLS in HTML text fields that allows an HREF link call an ActionScript function.
    The code below is what you're after. Your use does not need the setting but I included it for info. The parameter must be a single string, so if you want to pass multiple values, you need to analyze the in your function.

  • A question about the analytical function used with the GROUP BY clause in SHORT

    Hi all

    I created the following table named myenterprise
    CITY       STOREID    MONTH_NAME TOTAL_SALES            
    ---------- ---------- ---------- ---------------------- 
    paris      id1        January    1000                   
    paris      id1        March      7000                   
    paris      id1        April      2000                   
    paris      id2        November   2000                   
    paris      id3        January    5000                   
    london     id4        Janaury    3000                   
    london     id4        August     6000                   
    london     id5        September  500                    
    london     id5        November   1000
    If I want to find which is the total sales by city? I'll run the following query
    SELECT city, SUM(total_sales) AS TOTAL_SALES_PER_CITY
    FROM myenterprise
    GROUP BY city
    ORDER BY city, TOTAL_SALES_PER_CITY;
    that works very well and produces the expected result, i.e.
    CITY       TOTAL_SALES_PER_CITY   
    ---------- ---------------------- 
    london     10500                  
    paris      17000            
    Now in one of my books SQL (Mastering Oracle SQL) I found another method by using the SUM, but this time as an analytic function. Here's what the method of the book suggests as an alternative to the problem:
    SELECT city, 
           SUM(SUM(total_sales)) OVER (PARTITION BY city) AS TOTAL_SALES_PER_CITY
    FROM myenterprise
    GROUP BY city
    ORDER BY city, TOTAL_SALES_PER_CITY;
    I know that the analytic functions are executed after the GROUP BY clause has been transformed completely and Unlike regular aggregate functions, they return their result for each line belonging to the partitions specified in the partition clause (if there is a defined partition clause).

    Now my problem is that I do not understand what we have to use two functions SUM? If we only use one only, i.e.
    SELECT city, 
           SUM(total_sales) OVER (PARTITION BY city) AS TOTAL_SALES_PER_CITY
    FROM myenterprise
    GROUP BY city
    ORDER BY city, TOTAL_SALES_PER_CITY;
    This generates the following error:
    Error starting at line 2 in command:
    SELECT city, 
           SUM(total_sales) OVER (PARTITION BY city) AS TOTAL_SALES_PER_CITY
    FROM myenterprise
    GROUP BY city
    ORDER BY city, TOTAL_SALES_PER_CITY
    Error at Command Line:2 Column:11
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 -  "not a GROUP BY expression"
    *Cause:    
    *Action:
    The error is generated for the line 2 column 11 which is, for the expression SUM (total_sales), well it's true that total_sales does not appear in the GROUP BY clause, but this should not be a problem, it has been used in an analytical function, so it is evaluated after the GROUP BY clause.

    So here's my question:

    Why use SUM (SUM (total_sales)) instead of SUM (total_sales)?


    Thanks in advance!
    :)





    In case you are interested, that's my definition of the table:
    DROP TABLE myenterprise;
    CREATE TABLE myenterprise(
    city VARCHAR2(10), 
    storeid VARCHAR2(10),
    month_name VARCHAR2(10),
    total_sales NUMBER);
    
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('paris', 'id1', 'January', 1000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('paris', 'id1', 'March', 7000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('paris', 'id1', 'April', 2000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('paris', 'id2', 'November', 2000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('paris', 'id3', 'January', 5000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('london', 'id4', 'Janaury', 3000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('london', 'id4', 'August', 6000);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('london', 'id5', 'September', 500);
    INSERT INTO myenterprise(city, storeid, month_name, total_sales)
      VALUES ('london', 'id5', 'November', 1000);
    Edited by: dariyoosh on April 9, 2009 04:51

    It is clear that thet Analytics is reduntant here...
    You can even use AVG or any analytic function...

    SQL> SELECT city,
      2         avg(SUM(total_sales)) OVER (PARTITION BY city) AS TOTAL_SALES_PER_CITY
      3  FROM myenterprise
      4  GROUP BY city
      5  ORDER BY city, TOTAL_SALES_PER_CITY;
    
    CITY       TOTAL_SALES_PER_CITY
    ---------- --------------------
    london                    10500
    paris                     17000
    
  • Question regarding the purchase of laptop wireless

    Everything I've ever owned have been HP desktop computers. I need (well Yes, not desire) to buy a new laptop wireless. My intention to buy staples as I experience such great service in the past. Here are my questions:

    1 at the present time, I have high speed internet, but not wireless. Can I have both wireless and material "no wireless" goes on the same connection?

    2 will I be able to print on my existing (from my wireless laptop) printer if my desktop computer and printer are 'wired '?

    3. when I get out of the store, what do I need in my hands? I live 50 miles away and don't want to go home and find out that I'm missing something.

    I teach online classes will therefore could go 'on-line' no matter where I'm travelling. I guess my wireless connection works in the House of my daughter in Arizona as far as I know their password? As I have not worked with wireless, I am a little confused how it will work.

    I'd appreciate recommendations on routers and laptop computers, if you have a preference. I'll use camtasia in my class so will need microphone and camera possible.

    In advance thanks.

    Padraig

    1. Yes. This is called a hybrid network. With a wireless router that comes with LAN ports (4) which is easy to do. I use a Netgear WNR834B 802.11n router that has a LAN port. Easy to set up.

    (2) you will need to set up a simple home network and share the printer on the network from thePC to which it is connected. You can also install a print server connected to your network and it will have its own network address and be available for all the PCs on your network.

    (3) you need a wireless router (my preference is Netgear 802.11n because of the reliability, range and throughput of 300 kbs).

    I have exxplained the answers to your questions only in simple terms. I have no idea what your level of knowledge is in terms of networking (i.e. the subnets)

    My home network is a cable modem which is connected to netgear powerline devices (2)

    (via a CAT5 cable) which uses the wiring domestic (115 v) to provide an internet connection to my wireless router that offers a wireless for my laptop and a second office. My server at home and the box of FreeNAS are connected to the network via the router's LAN ports using a CAT5 cable

    .

  • BB10 simulator: questions about the clock function

    I don't know, but I have the notion that under the Simulator for BB10 the clock() function returns a value of timer resolution of the host and not the right pair

    And since

    #define CLOCKS_PER_SEC 1000000

    during the conversion of the clock in seconds it will be least bad results under windows. Because Windows there

    #define CLOCKS_PER_SEC 1000

    I want to keep constant 60 FPS and I have a code like:

    const int FRAMES_PER_SECOND = 60;
    const int SKIP_TICKS = 1000 / FRAMES_PER_SECOND;

    int GetTickCount (void)
    {
    Return MathUtils::dti ((double) clock () / CLOCKS_PER_SEC);
    }

    and the game loop is:

    int t_prev = GetTickCount();

    mbGameRunning = true;
    While (mbGameRunning)
    {
    int t = GetTickCount();

    If ((t-t_prev) > SKIP_TICKS)
    Tick();

    Draw();

    EventLoop();

    t_prev = t;
    }

    Am I missing something?

    The clock() function only increments while your program is managed by the operating system. When the operating system switches to another task, "clock" your program stops running.

    You must use:

    clock_gettime(), which is the system clock that is still running.

  • Question related to the REGEX functions

    Hello

    I'm working on Oracle 10 g 2.

    I'm working on a column that stores the user name. Let's say that one of the values in this column is "John". I want to extract all records where username is a concatenated string of 'Ankur' followed by some numbers, such as 'Ankur1', 'Ankur2', 'Ankur345' and so on. I don't want to get the records that have values such as "Ankurab1" - i.e. everything that is the concatenation of some characters to my input string.

    I tried to use the REGEX functions to achieve the desired result, but am not able to.

    Can someone help me out here?

    Best,
    Ankur

    It is a means.

    SQL> with sample_data as (
      2    select 'Ankur1' str from dual union all
      3    select 'Ankur2'  from dual union all
      4    select 'Ankur345' from dual union all
      5    select 'Ankurab1' from dual)
      6  select str from sample_data
      7  where regexp_replace(str, '[0-9]+$') = 'Ankur';
    
    STR
    --------
    Ankur1
    Ankur2
    Ankur345
    

    John

  • Question regarding tablespace TEMP and the o/s file associated with.

    Hello

    I want to write a simple query that returns the existing storage space and files that are part of each tablespace.

    I tried the script / query:
    col tablespace_name format a15
    col datafile_name   format a35
    col MB              format 999999
    col "CreateSize MB" format 999999
    
    --
    -- following two queries present only to show the problem I'm running into
    --
    
    select ts#
         , name
      from v$tablespace;
    
    select ts#
         , name
      from v$datafile;
    
    --
    -- this ALMOST works
    --
    
    select t.name tablespace_name
         , t.bigfile
         , d.name datafile_name
         , d.bytes/(1024*1024) MB
         , d.create_bytes/(1024 * 1024) "Create Size MB"
      from v$tablespace t
      join v$datafile   d
     using (ts#)
    ;
    The last query fails to display the files associated with it and the TEMP tablespace.

    Question: what tables should I ask to get a complete picture (one that is not lack of TEMP and its files)?

    Thank you for your help,

    John.

    V$ tempfile

    dba_temp_files

    Here you get a temporary tablespace.

    Concerning
    Asif kabir

  • 8610 all-in-one printer: I can't download the firmware update to remove the dynamic security

    "For not original hp ink users an update of the firmware option to remove the dynamic security is now available for select Officejet, Officejet Pro printers Officejet ProX."

    I have bee patiently for the "fix".   Following the posted signs: http://support.hp.com/us-en/document/c05308850?openCLC=true

    Step 2) "click your HP printer model in the table below and run the file to update the firmware downloaded from your Internet browser."

    Seems to have no option to run the download of my Internet browser.

    I use Safari (and that's all I intend to help).  When I click on the download, I get an error message that says: there is no application to open the file. I tried to right click 'open with' - any of these options are internet browsers.

    Can you offer any help?

    Hello

    Option updte to remove the functionality of dynamic security listed in the document is only intended for a Windows PC.

    Download and install the update by using the following link for Mac OS:

    http://FTP.HP.com/pub/softlib/software13/printers/OJP8610_R1640B.dmg

    Kind regards

    Shlomi

  • Cannot use the Val function in a script use

    I'm trying to convert a text string (binary number) in a number by using the Val function in a script of use but the colors of tiara the term Val in red and the script produces an error indicating "Variable is undefined:"Val"

    Why is that happen? Some functions are not allowed in use scripts?

    In addition, it seems impossible to use debugging in my use - if I try to add a variable to the Watch window, there never have any value even if I put a breakpoint on this line of code. Would it not possible to debug scripts use?

    David,

    regarding your question on "Val" I would like to direct you to the "File.Formatter.ParseString" function which is part of the API available at DataPlugins.

    CDbl and CLng do a good job in general, but they are dependent on the local configuration of the PC. 'ParseString' is so much more reliable.

    Andreas

  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

Maybe you are looking for

  • Satellite Pro U500-10N drivers and utilities Toshiba Windows 7

    Windows 7 has been on the market for at least a year. And I can't believe it, there are only * 4 * drivers to download to a Windows System 7 x 32 bit (for 64-bit system there is * 145 *). When you install this system on U500 some drivers and almost a

  • Saturation of the profile storage space.

    Having recently restored from a backup, I get a dialog box that I have exceeded my maximum profile storage space and must move data to storage in order to connect my computer. How can I safely do this, and why all of a sudden is happening? It's the s

  • When can we expect Windows 8, at least his version of beta and release candidate.

    original title: Windows Vista and its support When can we expect Windows 8, at least his version of beta and release candidate. Its really unfair if Windows Vista Home Basic/Home Premum / Ultimate will be no supported from April 10, 2012 and Windows

  • Logon Windows 7 error

    I just installed a windows 2008 R2 server and I have connected to the domian from another computer and it worked very well. But now, I tried another computer and it gives me the error message "there is currently no server access to the process, you o

  • Cs6 ID on startup crash: Management.InDesignPlugin failed to load color

    Yes, I always use CS6. I went through all the typical steps found on the forum and the general Internet search to find a way to fix my ID crash. Now, at the start, I get this message: cannot load the Management.UI.InDesignPlugin color. It depends on