HOW TO READ DATA SELECT TO_CHAR (TGL, 'DAY') AS TEMP_SELLOUT_MP_HY TGL;

This is my code

SET SERVEROUTPUT ON

DECLARE

CURSOR CUR_SELLOUT_MP IS

SELECT / * + INDEX_JOIN (SO) * / TK.ID,.
TMP_SELLOUT_MP. TGL,
TMP_SELLOUT_MP. TOTAL_PENJUALAN,
TMP_SELLOUT_MP. LIVING ROOM WITH CORNER
TMP_SELLOUT_MP. NOKIA,
TMP_SELLOUT_MP.SE,
TMP_SELLOUT_MP. SS,
TMP_SELLOUT_MP. LAINNYA,
TMP_SELLOUT_MP. NAMA_TOKO,
TMP_SELLOUT_MP. KOTA,
TMP_SELLOUT_MP. NAMA_MP,


To_char (TGL, 'Day')
OF TK REF_TOKO,
TEMP_SELLOUT_MP_HY TMP_SELLOUT_MP,
REF_SALES_OFFICER SO
WHERE SUPERIOR (TK. NAMA) = UPPER (TMP_SELLOUT_MP. NAMA_TOKO)
AND THE TOP (TMP_SELLOUT_MP. NAMA_MP) = UPPER (SO. NAMA)
AND SO. SOF_TYPE = "MOBILEPROMOTOR";


CURSOR CUR_TGL IS

SELECT DISTINCT (TO_CHAR (TGL, 'Day')) AS TEMP_SELLOUT_MP_HY TANGGAL;

V_A VARCHAR2 (20);

BEGIN

FOR I IN CUR_TGL LOOP

V_A: = I.TANGGAL;

IF V_A = THEN 'Friday'
DBMS_OUTPUT. PUT_LINE (V_A);
END IF;



END LOOP;


END;


Why dbms_output.put_line does not show?




These cursor CUR_TGL data:
Thursday
Friday
Wednesday
Saturday

Published by: xoops on March 11, 2010 09:21

What happens when you use:

SELECT DISTINCT(TO_CHAR(TGL, 'fmDay')) AS TANGGAL FROM TEMP_SELLOUT_MP_HY;

Add 'fm' TSE format, your match does not account the trailing space:

SQL> select '#'||to_char(sysdate, 'Day')||'#'
  2  from   dual;

'#'||TO_CHA
-----------
#Thursday #

SQL> select '#'||to_char(sysdate, 'fmDay')||'#'
  2  from   dual;

'#'||TO_CHA
-----------
#Thursday#

Published by: hoek on March 11, 2010 18:43

Tags: Database

Similar Questions

  • How to read data in Adobe Flash and align it to look like it's column?

    I am doing an application that already exists, but I add a few improvements. I'll explain what this app is. There is a server and client side. The client side adds data to the Access database (the columns are time, name and surname). On the other computer is an application that displays this data (I don't know if he reads a database or another type of file, but I did a database). I know that server-side plays an .swf Flash file. This screen stays for about 30 seconds and then the application plays videos in the video player installed (ads, this model is connected to a TV) for some time and then the screen goes back to the display of the data.

    I'm 18 and I have very limited knowledge of Adobe Flash (I learned something at school). I've done completely client-side app. I now how to create server-side. My main problems are: how to connect to Adobe Flash to the database (is it possible to transfer this data to any other file that can be connected to the Flash?), how to read data from database for Flash and how to display it. I don't want to display the data in the grid. In the application that already exists, each word is like a new text (tool in Flash) and it is aligned. Is it possible to add a loop that creates new texts and plays database cell? How to refresh the Flash screen?

    I know it's a very complex issue, but your help would be very appreciated. I did on the client side in Delphi. If you need more information or if you do not understand something of my explanation, don't bother to ask. Thank you!

    You can transfer data back and forth between Flash and database on a server with PHP as the intermediary.  If you are looking for Gioogle use terms like 'AS # PHP MySQL tutorial' (fillin 2 or 3 for the ' # '), you should be able to find something to help you along there.

    What about adding new textfields and harmonizing, it depends on what version of as you use.  In AS3, you use just...

    var tField = new TextField();

    tField.x = a value to match.

    addChild (tField)

    As far as refreshing goes, this would require removing all Textfields you added and re-create new ones like you did the first time.  Yet once, it depends AS version that you use.  In AS3, you can use removeChild()

  • How to read data from the drop-down list

    Hi all

    I use this to display a drop-down list.

    inputScreen.add (new NumericChoiceField ("number of objects:", iStartAt, iEndAt, iIncrement, iSetTo));

    How to read the data selected by the user? say if my list contains from Monday to Saturday, how will I know what day selected by the user? and how that store in the variable? Thank you.

    You have your data in a table and this stone he is used to populate the ObjectChoiceField. The FieldChanged listener you can obtain what the iteme selected to help index:

    int index = yourObjectChoiceField.getSelectedIndex ();

    and for the use of the object:

    Bean of MyObject = myObjectArray [index]

  • How to read data from OM - 62 temperature/humidity data logger in LabVIEW?

    Hello

    I have an Omega OM-62 temperature/humidity data logger I want to communicate (initialize recording, reading/writing data, stop recording) through LabVIEW 8.6. The OM-62 is connected to the PC via a type B USB-miniUSB connector, and I have provided "Omega Recorder program Interface" on my Windows operating system. I called online DAQ support Omega but I was told that data recorders low level like this have not provided capabilities of LabVIEW, which I fully understand.

    My question is why I have to use their program to communicate to this device? If I knew the syntax program them used to connect to the device, why can't I use through VISA? Do I need to build my own LabVIEW driver from their supplied driver?

    Python is easier to apply to this scenario solution?

    How can I see the code "Omega Interface Progam recorder" on my Windows operating system is using to communicate with the OM - 62 sensor?

    I just want to know how this could or could not work because I think I'm missing some concept in my understanding of programming LabVIEW/novice. It would be easier to run my LabVIEW program and their program at the same time, but I just want to understand it at a deeper level.

    Curosity killed the engineer occupation,

    Zach

    P.S. I have attached a few driver configuration information, but I have no idea if this is useful.

    Unless the manufacturer provides a kind of programming interface or API to communicate with the device that you have trouble with your own software interface to it whether LabVIEW or Python or something else. This could be in the form of a driver dll, Protocol series modbus (etc. etc. etc.).

    If it is not condition / available and you really need to communicate with the device, you will need to look at using something like a sniffer USB/driver (software? hardware?) to try to intercept communications between their software and the device. You can then use this information to try to understand what the commands it sends and the responses received and how to convert data.

    Once you have that until now... I don't know what options are willing LabVIEW for control of USB device, but a proposal, I would say that you would need either a driver USB low level or you have to write your own driver in another language and that call from LabVIEW.

  • How to read data from an excel and HTML file

    Hello

    I write a 2D-array of string in Excel/HTML file using the generation of reports.

    Can someone tell me how to get back in return, the written data, same files again and display in table format.

    Thank you & best regards

    Visuman

    You can use activex to read data from the excel fileback to the table format... through this vi... may b this will help you...

  • How to generate date thru sysdate and day of the week

    Hello world!

    Please give me a hand with this:

    I need calculate a date thru sysdate and day of the week.

    For example:

    SYSDATE: 22/08/2013

    DAY: TUESDAY

    Result: 27/08/2013 (the date for Tuesday next from today ' hui).

    Another example:

    SYSDATE: 22/08/2013

    DAY: FRIDAY

    Result: 23/08/2013 (the date for Friday next today).

    My version of oracle's 8i (I work with a legacy database).

    Thanks in advance! ... and sorry for my English

    Search the NEXT_DAY function it does exactly what you want

  • How to read a selected part of a large ascii file (~ 200 MB)?

    I have several large ascii files I need to read in.  These files are part of a standard test for an application that I wrote. How well my application parses files determines how the program accomplishes its main task. For a real test, the application captures live data in the form of a 2D double table and analyzes the data of this form.  This table is long of 3 million items (1 ms/s @ 3s).  I usually never treat any form of ascii file because all data is stored as TDMS using this method (though I need to update this link with a few critical changes). (Thank you again Ben)

    Ascii files I have to read all have two rows of data from the header, followed a ~ 8 million lines of data representing the data I capture in general.  Each line contains point data and a value of accumulated time.  I need to load each file separately, analyze the data within, and communicate the results.  The part that I need help for loading of the file.  So far, I was able to load a file without memory problems.  A stay is similar to a real test, I need actually only 3 million lines for analysis.  But I have to be able to select the 3 million lines by time values in the file.  Technically, I only need the single column of data and the frequency of sampling, represented by time values.

    How can I select a specific section of an ascii file and read them in LabVIEW as a double 2D array?  Which is possible for 3 million points of data without crippling the system using all the memory just to accomplish this task?  An alternative version of 'last resort' would be to run a separate program to create a file DDHN that I could then read and go from there.  But I prefer to read the file directly to my request.

    I'm running on an HP EliteBook 8540w with Win 7 Enterprise (64-bit), i7 CPU bicoeur (2.67 GHz) with 8 GB of RAM and 32-bit LV2011.

    Thank you

    Scott


  • How to read data from a QVariant

    I have a multi select list, and I need to get a list of the people selected.

    QML

    ----------------------------------------------------

    {To ListView
    ID: lv_ingredients
    horizontalAlignment: HorizontalAlignment.Fill

    dataModel: _app.ingredientDataModel

    multiSelectAction: {MultiSelectActionItem}
    }

    {multiSelectHandler}
    actions:]
    Add the actions that must appear in the context menu
    When the multiple selection mode
    {ActionItem}
    Title: "search people".
    onTriggered: {}
    _APP.search (lv_people.selectionList ());
    }
    },

    ....

    ----------------------------------------------------

    ----------------------------------------------------

    Search in _app method:

    void classname::search (const QVariantList & list)

    {

    QVariant nlist = personDataModel-> data (list.at (0) .toList ()); //
    qDebug()< "list:="" "=""><>
    }

    ----------------------------------------------------
    Results in

    List: QVariant (QObject *, Person (0x857c310))

    That means I can see this list of Person objects, but I have no way to read! How can I get this picture out of the QVariant?

    Hello

    The code looks OK, but the variables are named confusedly.

    QVariant tlist = personDataModel->data(list.at(0).toList());
    

    This line actually returns a first person in the selection list. Where none have been selected,. at() function throws an exception and the application will crash.

    Row is a list of section number, line, etc. Data() method returns a single object for a given row.

    QVariant is a type that can wrap any primitive type, a map, a list or a QObject. It can also wrap pointers to custom classes derived from QObject declared using Q_DECLARE_METATYPE. More details on this here (Qt 5 docs it's should apply as well to Qt 4.8):

    http://Qt-project.org/doc/Qt-5.0/QtCore/qmetatype.html#Q_DECLARE_METATYPE

    Line that you use for the conversion to the person seems correct. To retrieve all people (untested code, but it work, I divide it into several lines for simplicity):

    foreach (QVariant indexPathV, list)
    {
      QVariantList indexPath = indexPathV.toList();
      QVariant personV = personDataModel->data(indexPath);
      Person *person = personV.value();
    }
    

    In the .h file where the person is found make sure you declare metatype its pointer, otherwise that it cannot be used in QVariant except flows manually to / of QObject, which isn't practical:

    class Person: public QObject
    {
      .............
    }
    
    Q_DECLARE_METATYPE(Person *);
    

    Also, I suspect that there could be something wrong with dataModel. If the above does not work, please copy - paste the header file where it is declared.

    If there are compilation errors, please paste entirely including context around them, it could also give us some tips.

    UPD. qobject_cast can be used to cast QObject * to another type (returns NULL if impossible), but is not going to extract a value from QVariant. Use of QVariant .value<>() function instead.

    QObject *x;
    ...
    MyType *y = qobject_cast(x);
    if (y)
    {
       y->...
    }
    

    ...

    QVariant v;
    ...
    MyType *t = v.value();
    
  • How to read data from several files and add columns in a single file

    Hi guys,.

    I have a problem in adding data from files in different columns. I have the attachment a file A and B which I am reading and not able to get the data in the Result.txt file. Please give your opinion on how can I do this

    You must add the data of all files before proceeding with a single entry.

  • HOW TO READ DATA SERIES WITH SYNCHRONIZATION

    I have a question about my application for the acquisition of data in series. In my application, I use visa read to acquire data series sent by an inertial measurement unit. When I first put the sensor, it sends data in the following one time format:

    1:0 x 8011 header followed 1 data word for Adler, 1 data word (each 16-bit word data).

    and the sensor then starts sending the data in the following format:

    2:0x7FFF header followed 1 data word for checksum, 9 data word (each 16-bit word data).

    (Note: checksum is defined as a 2s - complement of the sum of 16 bits of the rest of the entire message)

    In my application, to simplify the problem, I use a wait function to ensure that the initial data header 1 tag is sent. Then I start reading using VISA Read 20 bytes (header 2 more words of associated data are 20 bytes), as I'm mainly interested in the data header 2 tag words.

    However, when I do this, the data that I get do not begin by 7FFF character and, accordingly, my 20-byte data cannot be parsed correctly. My question is how can I do the "VISA read" block read the serial port when data are preceded by '7FFF '.  Once I have solve this part, my strategy will be assembled data read 20 bytes (including the header of 4 bytes) and analyzed accordingly.

    Another question, I wonder if you can tell me how to use the given checksum it is defined as "a s 2 - complement of the sum of 16 bits of the rest of the entire message". Note the data that contains the header 1 tag is 1 post.

    I would appreciate if you have responded to my request.

    Thank you!

    Serdar


  • How to read data from the unit to acquire data with LabVIEW

    Hello everyone, I'm new with LabVIEW and I need help. How to build LabVIEW program to read and store the data acquisition unit temperature data. the data can be any store such as Excel or a text file? Thank you.

    Start passing by examples of LabVIEW.  Go to help-> find examples.  There are several examples here just for the analog input and then even more for logging data to a file.  After that, show us what you have and we can guide you a little better that way.

  • How to read data from a worksheet to a chart in the form of wave at intervals to simulate real-time data

    Hi I have measured data using a SELF-DIAGNOSIS device and that you have downloaded the log files as a .csv I have attatched below.  I'm trying to read the 7th column of data (RPM) and display it on a waveform graph, read line-by-line to simulate driving real-time data. The interval between readings, I'm trying to achieve is 500 Ms because it is the time interval of readings on the worksheet. I'm finishing the two loops when rpm is equal to zero, as happens when the car is off. I have attatched the relevant section of my program below. Any suggestions would be greatly appreciated.

    Thank you

    Michael

    There are two errors in your block diagram.  First of all, as you read the entire table 2D in all at once (which is fine), you make a clumsy (pardon my language) job to make a line of programming.  Once you take the first line of headers, you have the ideal substrate for a loop, which is made of elements of an array (lines) process, one at a time, using its tunnel of indexation.

    The second mistake is to forget data flow.  The loop, I mentioned, or the While loop you use, produced one at a time and points it at 2 Hz thanks to your expectation of 500msec.  You want to give each point to your chart, but the picture is out of the loop, which means that there is No point until the loop ends.

    Here's an easy Question - where you put the indicators in table of waveform?  [Council - I said that "outside the loop is bad"].

    Bob Schor

  • How to read data from 16-bit unsigned IMAQdx?

    I was using my firewire camera to take pictures in unsigned 16-bit grayscale and processing of these data in matlab. However, the data becomes incorrect when the integration time of the camera is great. I discovered that the reasons are: 1, IMAQdx decoded data monochrome 16-bit signed 16-bit, which returns a negative value if the amplitude of each pixel is greater than 32768.  2, IMAQdx automatically adds a constant, which is equal to the amplitude of the largest negative value pixel, to all the pixel values, to change the smallest value to zero, but this process ruin the rest of my data and makes them almost irreversible.  I think the only method could solve this problem is to try to do in labview read image form of unsigned data, but I don't know if it's possible, because it is not optional in IMAQdx manual.

    Any suggestion will be appreciated.

    Hi Hosni,

    FireWire (especially earlier on) had some ambiguities on the endianness, signed-ness and depth of the pixel data that is returned. IMAQdx tries to take the best prognosis for 16-bit data using specific registers defined by the IIDC and other information she can deduct on the camera. However, sometimes these assumptions are incorrect. If you go to the acquiring of your camera attributes tab in MAX, you should be able to replace all these parameters correspond to what the camera expects its data should be interpreted.

    Eric

  • How to read data from the memory on the computer that was written by another program host

    Hi all

    This is my first post.

    I am very new to LabView and I just finished 1 Core and Core 2 with no experience of LabView.

    I have a card SilconSoftware acquisition with an FPGA card on it to capture and image of a CamerLink sensor processing. The FPGA is programmed to produce a 64-bit using DMA to the host PC image, and I know the address of the Image. The image consists of two pixels, I would read the pixels in LabView, so I can decode the information.

    How can I do this?

    Thank you _KAL

    I'm not familiar with this specific material, but the easiest is if the camera is compatible with IMAQ. Furthermore, the seller provides a DLL to access the images?

    Mike...

  • How to read data from the cell of the table hint?

    In my application, I filled the table hint with database data. Now I want, when I click on any particular line, I should be able to read the data in this row.

    Thank you best regards &,.

    Shrinivas

    Strange, I can see it with different accounts.

    OK, the VI attached.

    Christian

Maybe you are looking for