required number

Hi Masters

I have a table with 3 rows and 3 columns. Please find below the sql scripts. I want to count the number of * s in my table. (Number of stars)

SQL > create table test (a varchar2 (1), b varchar2 (1), varchar2 (1)) c;

Table created.

SQL > insert into test values (' 'and has','& b', ' & c ');
Enter the value of a: *.
Enter the b value: $
Enter the value of c null:
former 1: insert into test values (' 'and has','& b', ' & c ")
new 1: insert into test values('*','$','null')
Insert into test values('*','$','null')
*
ERROR on line 1:
ORA-12899: value too large for column 'SCOTT '. "" "' TEST'." " C' (real: 4, maximum: 1).


SQL > /.
Enter the value $ a:
Enter the value of b: *.
Enter the value of c:
former 1: insert into test values (' 'and has','& b', ' & c ")
new 1: insert into test values('$','*','')

1 line of creation.

SQL > /.
Enter the value of a: *.
Enter the value of b: *.
Enter the value of c: *.
former 1: insert into test values (' 'and has','& b', ' & c ")
new 1: insert into test values('*','*','*')

1 line of creation.

SQL > /.
Enter the value of a: *.
Enter the b value: $
Enter the value of c:
former 1: insert into test values (' 'and has','& b', ' & c ")
new 1: insert into test values('*','$','')

1 line of creation.

SQL > select * from test;

A, B AND C
- - -
$ *
* * *
* $

Please advise...!

Concerning

AR

Hi, Ar,

Maybe:

SELECT COUNT (CASE when a = ' *' THEN 1 END)

+ COUNT (CASE WHEN b = ' *' THEN 1 END)

+ COUNT (CASE WHEN c = ' *' THEN 1 END) AS total_stars

OF the test;

It is not a good idea to create your own tables in any schema provided by Oracle, as SCOTT.  Create your own schema for your own objects.

Tags: Database

Similar Questions

  • Error ORA-01422 apex: exact fetch returns more than the required number of line

    Hi people,

    Apex 4.1
    I have a page that works like a charm.

    Based on my application I need I have to perform the same operation for the different regions. As a quick and better method, I copied the page and branched, it inspires tab for this region.

    The problem is that the original page works fine.
    I haven't changed anything except the parent set to this copied page tab and works that I find with the above error.

    It allows me to make the first entry on this page, but when I try to access the page again it gives me this error.

    The error in detail is as below:

    is_internal_error: false
    ora_sqlcode:-1422
    ora_sqlerrm: ORA-01422: exact fetch returns more than number of lines
    Component.type: APEX_APPLICATION_PAGE_PROCESS
    Component.ID: 214936714355373108
    Component.Name: EMP_LEAVE_INFO line
    error_backtrace:
    ORA-06512: at line 1
    ORA-06512: at "SYS." DBMS_SYS_SQL", line 1926
    ORA-06512: at "SYS." WWV_DBMS_SQL', line 973
    ORA-06512: at "SYS." WWV_DBMS_SQL', line 999
    ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 806
    ORA-06512: at "APEX_040200.WWV_FLOW_DML", line 336
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 332

    >
    As a quick and better method, I copied the page and branched, it inspires tab for this region.
    >

    Copy paste is never advisable. It can be fast in some cases, there is an anti-pattern.

    Be aware that the automatic extraction of the APEX line is based on a component of demand.

    It is possible that your automatic rowfetch is based on the element of your previous page. If you for example to change the name of the table, but do not change the reference is the primary key value, then you can pass a value to your table that was not unique. This would result in ORA-01422.

    Find the value of the session element and run your query.

    Concerning

    Nico

  • Number of entries required

    I wrote a shader that took me about 5 minutes. I spent the last 5 hours trying to get the thing to run in flash without success. I tried up to about 20 tutorials now and it still gives the same error of cut and paste the code. Exception [fault], information = the ArgumentError: Error #2167: the Shader doesn't have the required number of inputs for this operation. I'm using FlashDevelop, got the flex SDK installed, and the shader works like a charm in the PixelBender IDE. Even a landing forced the shader and output just a constant color will always produce the same error.

    Which is wrong with this thing?

    because you did not use the entry, it was deleted as an optimization of the compiler for Flash. We should have given you a warning here, it's our bad. I'll file a bug.

  • Peuvent Contacts displays the number of contacts?

    Other address books displays the total number of contacts and the number of contacts in the current group of visualization. Is there a way for Contacts in El Capitan, to do the same.

    I just scroll to the bottom of the list. However, for small lists, it doesn't show the number of cards. I don't know the required number to show.

  • How do you control the number of cycles showed on the chart

    How do you control the number of cycles showed on the chart?  I selected a graph of scanning, and I do not see the bar vertical chart when the program runs.  This is probably because I don't see the whole cycle of the periodic signal I try to display.  I need to set the graph to display several cycles.  Any help will be greatly appreciated.

    Right-click in the list and set the required number of points in the history buffer (right-click... length of the graphic history...). Then set the x axis not autoscale and cover your historical range complete.

  • Number of licenses of view

    Hello

    We started with 10 licenses of company Horizon view, and later, we bought another pack of 10 users. We have license concurrent users.

    In the display console, I can only enter a license key. The console shows that we are allowed, but does not show for the number of users. How to view licensing works technically? All I see is the use.

    Thank you

    Edy

    The license key only unlocks functionality and does not govern the number of users.

    You don't need to enter the new license key anywhere, just to keep them safe in case you need to prove that you have the required number of licenses for your users.

    Linjo

  • I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes.

    I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes, which is a field required number on there.

    All of them are select___

    Here are all the names of FQDN (towards the bottom):

    Check the boxes:

    • selectiPhone
    • selectSwipe
    • selectMonitor
    • selectDesktop
    • selectLaptop
    • selectiPadCell
    • selectiPad
    • selectPhone

    Fields of costs:

    • CostiPhone
    • CostSwipe
    • CostMonitor
    • CostDesktop
    • CostLaptop
    • CostiPadCell
    • CostiPad
    • CostPhone

    The notes field that will calculate this is "NotesComputer Monitor in notes". -It is a body of numbers forced the inability to put anything else in it.

    Then add them all in TOTAL COST

    Sorry for my ignorance: it's my first time doing a form like this.

    Please see below for the screenshot.

    2015-10-12_1411.png

    Dropbox - conditionalSum.pdf has the answer

  • You can customize the number of forms that are based on a number that you enter?

    Hello

    I try to combine two forms: forms of recording and registration of attendance.  The record attendance would list all students, and the registration forms would be student specific.  I wonder if there is a way that I can enter in the number of students on attendance record, and that the required number of forms would generate registration based on this number.

    A lesson in models for Adobe Acrobat by Dave Wraight

  • On the box next to the serial number?  How many digits?

    Try to install Photoshop elements 12 and need serial number.  Three numbers on the back of the box, none identified as serial number.  None are valid.  Where is the required number?  The info on the help doesn't help.

    Have you tried to quickly find your serial number

  • A.I. system requirements processor - details

    Hello-

    Research to determine the characteristics for the processor to the system by interim requirements.  Posted criteria for 'Intel Pentium 4' is too broad because there are 10 versoins of this processor.

    Frequency/frequency required

    Required number of carrots

    Required memory internal L2 cache memory

    Thank you

    BT

    This is the url where you will get the details of the system requirements.

    System minimum requirement of the CC Illustrator is given on: http://www.adobe.com/products/illustrator/tech-specs.html

    Minimum requirements for all software including Illustrator CS6 cs6 is given: http://prodesigntools.com/products/adobe-cs6-system-requirements.html

  • Put my C850D Satellite

    Even if a cell phone is activated simply is a problem for me, to say, I don't know anything about computers.

    It says in the manual for my C850D Satellite press 2-3 seconds. I the time by counting the exact number of seconds. Yet the laptop sometimes turns, other times on light turns off the coast and the screen goes black, laptop is turned off. Or the start screen comes on and then the screen goes black and computer laptop is turned off again.

    This means some days that I have to press the button several times, each time by counting the required number of seconds, before the portable lights. Isn't this bad for the hard drive?
    More importantly, is it normal, the button being so sensitive? Is there something that can be done to change that, so I can just press the button and the laptop turns on, each time just sometimes?

    Don t push button power 3 seconds. Just press top gently for a second and laptop will be turned on.

  • How to change DI unbuffered mode

    My request is when a fall from digital input (camera ready) edge arrives, it will trigger a pulse counter 0, open the shutter of camer.

    The following code does this:

    camShutterOutputTask.COChannels.CreatePulseChannelTime ("Dev1/ctr0", "",)
    COPulseTimeUnits.Seconds, COPulseIdleState.Low,
    0,
    0.000001,
    (((double) exposure_time) / 1e6);

    camShutterOutputTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger ("/ PFI0/Dev1", DigitalEdgeStartTriggerEdge.Falling);
    camShutterOutputTask.Triggers.StartTrigger.Retriggerable = true;

    On my PCIe-6323, PFI0 is by default configured with P1.0, so I connected physically ready to P1.0 camera entry.

    I just want to trigger the camera several times. After the required number of triggers, I'll just ignore all the following input signals. The following code configures the input channel to do so:

    camReadyInputTask.DIChannels.CreateChannel ("Dev1/port1/$line0", "", ChannelLineGrouping.OneChannelForEachLine);
    () camReadyInputTask.Timing.ConfigureChangeDetection
    "",
    "Dev1/port1/$line0,"
    (SampleQuantityMode.FiniteSamples, num_of_frames);

    The problem is when I run the program, I get the error: "some lines do not support buffering operations. Ensure that lines are supported buffering operations are used in the task. If you use the calendar to change detection, the task should be replaced by without buffer to support these lines. »

    If I use port 0 in the code instead of port 1, he makes the mistake, and it limits the number of input signals just like what I need. However, port 0 is not connecting to any PFI, so I can't use it in the trigger to start for the shutter of the camera.

    Does anyone know how is:

    1. change a task in unbuffered mode or

    2 re - router port 0 to a PFI?

    Thanks for the reply Ashly. I'm new to DAQmx and there is still a lot to learn.

    The loop thing involves waiting timed software and concerns me.

    I have found a workaround that calls a callback function whenever the meter changes its output:

    camShutterOutputTask.SynchronizeCallbacks = true;
    camShutterOutputTask.CounterOutput += new CounterOutputEventHandler (camShutter_callback);

    ...

    ' Private Sub camShutter_callback (object sender, CounterOutputEventArgs e)
    {
    trigger_count ++;
    Console.WriteLine ("trigger count =" + trigger_count. (ToString());
    If (trigger_count > = num_of_frames * 2)
    {
    Try
    {
    camShutterOutputTask.Stop ();
    camShutterOutputTask.Dispose ();

    ...

    startCaptureButton.Enabled = true;
    }
    catch (System.Exception Exception)
    {
    MessageBox.Show (exception. (Message);
    }
    }
    }

    In camShutter_callback(), I continue to follow a global counter and if it is greater than num_of_frames * 2 (since the callback will be triggered by rising and falling pulse edge), I stop all tasks.

  • Analog output with counter Falling Edge

    Hi all

    Here's the iamge which describes what wishes to accomplish. I would like to trigger that the AO output with the edge of the fall of the meter.

    I have set the clock for my AO as the counter.

    The analogue output should be raised whenever the Digital signal meter falls

    SAMPLE_SIZE = 80
    SAMPLING_RATE = 40 #Samples are written every 25 milliseconds
    TIME = float ((SAMPLE_SIZE) / (SAMPLING_RATE))

    CREATE TASKS
    CREATE CHANNELS OF AO
    CONFIGURE THE TIMING CHANNELS
    DAQmxCfgSampClkTiming (taskHandleAO, "PFI12", SAMPLING_RATE, DAQmx_Val_Falling, DAQmx_Val_FiniteSamps, SAMPLE_SIZE)

    CREATE TASKS
    CREATE A CHAIN COUNTER
    # Time high-low + time equals 25 milliseconds and is proportional to the frequency of sampling
    DAQmxCreateCOPulseChanTime(taskHandleD,"DAQ/ctr0","",DAQmx_Val_Seconds,DAQmx_Val_Low,0.00,0.005,0.020)

    # The values of voltage DAQmx writing
    DAQmxWriteAnalogF64(taskHandleAO,SAMPLE_SIZE,0,10.0,DAQmx_Val_GroupByChannel,Voltage,None,None)

    # DAQmx AO task start
    DAQmxStartTask (taskHandleAO)

    # Counter DAQmx Start task
    DAQmxStartTask (taskHandleD)

    #TIME is equal to the total time for the writing samples
    DAQmxWaitUntilTaskDone (taskHandleD, 2 * TIMES)

    I get an error every time that I run the task:

    DAQError: Over Acquisition or generation has been stopped until the required number of samples were acquired or generated.
    function DAQmxStopTask

    That's because my AO task is stopped for some reason any.

    Is there an obvious problem with the code. Can it be structured differently?

    best regards,

    Ravi

    I do all my programming in LabVIEW, so I'm pretty limited to help with programming syntax text.  That being said, here's what I * think * I see:

    Your AO task issues a call to DAQmxCfgSampClkTiming, but is not your task of counter.  This probably leaves you with a meter spot which creates only a single impulse, which causes only a single AO D/A conversion.  In LabVIEW when I need a pulse train, I would call a similar function of the synchronization with the clock mode is defined as 'implied '.

    Hope this helps you get started, I don't know enough to give you the specific syntax in the text.

    -Kevin P

  • While loop stops unexpectedly

    Hello world

    I have a problem with while loops.

    Im trying to write a program that allows me to control the temperature of a hot plate, using as a starting point one of the examples in LabVIEW (basic series writing and reading). So basically the program sends an order asking the real temperature of the heating plate and it then reads a response with the State, then the user writes a temperature (the sub - VI creates the command that is sent to the cooking plate), then he reads a confirmation response. the while loop is to monitor the temperature and change it if necessary

    Sometimes it works for about 30 seconds and sometimes for a few minutes, and then everything stops playback, I don't get the error messages, it stops just a response.

    The hot plate is a pro H550 MS7 and im using a USB to RS232 converter

    PD, I'm pretty new using labVIEW, sorry for my bad English.

    Greetings and thanks for the help

    Bob_Schor wrote:

    Found the manual.  Here is a summary (edition - in fact, it is essentially all of the manual, just condensed and without 'images'):

    • The statement format: prefix, Instruction, data frame, Checksum
    • Command: Prefix is 0xFE
    • Answer: The prefix is 0xFD
    • Add at least 50 msec between pairs of bytes
    • Data frame, send high and low bytes
    • Checksum = sum of the instructions, the frame data, but not prefix
    • Commands and responses seem to be mainly sequences of 6 bytes

    OK, this helps a lot.

    The first issue with the OP code: turn off the stop character.  The protocol uses binary communication protocols.  The stop character is only useful for communications ASCII protocols.  Nor if he was being a 0x0A in data, VISA Read stop reading right there because it's the stop character and it is enabled by default.

    Second, always do not have need of the bytes to the Port.  You know what you send and you know what should be the answer.  Therefore, suffice to say the VISA of reading to read the required number of bytes.  If your delay is long enough, you do also not waiting for him by saying the VISA must read the number of bytes to read.

  • capture multiple and reading images

    Hi all

    I use a Guppy F031 Pro camera equipped with trigger mode in bulk.  Now I can leave the exposure of the device twice in the series after an external trigger (my previous post).  But I don't know where are the stored images and how to read the two outside pictures and store them in the hard disk.

    When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location?

    Best,

    Wen

    "When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location? »

    -To my knowledge, it is false.

    Buffer allocation:

    -There are two types of internal buffers and buffer of the user you want to set up and use.

    -internal buffer is that you can configure using IMAQdx configure acquisition and giving the required number of buffers you want to allocate.

    -the user buffer is a condigure you or create using IMAdx create and giving them different middle names, creating several buffers. (You must remove the user buffers when finished processing using IMAQdx has, otherwise it will fill the RAM memory.

    Number of buffer:

    -A number of buffer is a zero-based index that represents the cumulative number transferred image. For example, during an acquisition continues with three internal buffers, the number of buffers is updated as follows: 0, 1, 2, 3, 4, 5 and so on. Buffer 0 and 3 numbers correspond to the same internal buffer in the ring of the buffer. (From NI IMAQdx manual)

    -Which means you will need to give different buffers number each time adding 1 whenever you receive an image. and not a constant of 2.

    For your question:

    -Configure the acquisition with more than two buffers, start the acquisition.

    -Give the number of buffers to 0 and increment after successful image and send it to IMAQdx get image.

    -For each image, your user buffer is even currently, which means that it will overwrite the same. If you want them to be different, you can create several and use also.

Maybe you are looking for