can I store the output of boolean values in a table?

the codification output here is '1' and '0'...
I want to store only '1' and '0' in a table...

but I can't do it please help me...

How to store?...

DECLARE
EID VARCHAR2 (20);
BOOLEAN BL: = TRUE;
BEGIN
SELECT EMP_NO
IN EID
OF LEAVE_FORM
WHERE EMP_NO = 1;
BL: = TRUE;
DBMS_OUTPUT. Put_line (sys. DIUTIL.bool_to_int (BL));
insert into t1 (BL) values; - error
EXCEPTION
When no_data_found then
BL: = FALSE;
DBMS_OUTPUT. Put_line (sys. DIUTIL.bool_to_int (BL));
END;

Published by: 794244 on February 9, 2011 03:11

No, you can't. BOOLEAN is no SQL, PL/SQL data type. You did not post structure of table t1. Assumimg t1 column has the number value, use:

DECLARE
    BL BOOLEAN := TRUE;
    N  NUMBER;
BEGIN
    N:= sys.DIUTIL.bool_to_int(BL);
    DBMS_OUTPUT.PUT_LINE(N);
    insert into t1 values(N);
    BL := FALSE;
    N:= sys.DIUTIL.bool_to_int(BL);
    DBMS_OUTPUT.PUT_LINE(N);
    insert into t1 values(N);
END;
/
select * from t1
/

        BL
----------
         1
         0

SQL>  

SY.

Tags: Database

Similar Questions

  • How to store the output of a statement select * statement in a file?

    How to store the output of a statement select * / statement of dsc in a file?

    As user sys:

    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    /
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /
    

    As myuser:

    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      --
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    

    This allows the header line and the data to write into files separate if necessary.

    for example

    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    
    PL/SQL procedure successfully completed.
    

    Output.txt file contains:

    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    

    The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.

  • How can I measure the output of a sensor pwm ultrasound using the module or 9403

    How can I measure the output of a sensor pwm ultrasound using the module or 9403

    Khalil,

    When you say 'measure' the PWM signal, exactly what to tell you?

    You're looking to measure the frequency or cycle of the signal function? You count the edges of the PWM output increase? Looking to control the waveform?

    With reconfigurable FPGA hardware, it is up to the user to define the function of the physical i/o on the FPGA chip. By connecting the signals as Adam suggests your digital pulse will be brought to the cRIO. In your FPGA program, you define the function. You can set a base counter or transfer digital data from single point to welcome you cRIO for floating-point more complex treatment. Example FPGA programs are located in the http://www.ni.com/IPnet.

    Hope this helps, please post any additional questions.

  • How can I change the output of the old number in our HP officejet 5500series phone?

    I have a new phone number.  How can I change the output of the old number in our HP officejet 5500series phone?

    Hi Edward,.

    Please contact HP technical support at the: http://www8.hp.com/us/en/support-drivers.html for assistance.

    Good luck!

  • CS6 Illustrator - How can I change the output settings?

    Hi, its really annoying that I can not change the output settings when I save for the web, something. I just mean Illustrator I want to create a new folder images whenever I have save something, and I don't want to add a _N at the end of the file name...

    Is there a way to change this?, I couldn't find it.

    Thank you.

    This feature has been removed from CS6:

    Quoted from this employee Adobe blog post on the new CS6 save for Web feature:

    The output, used parameters dialog box for formatting HTML file control, naming slice and manipulation of background image, has been removed.

    I didn't chance to find a workaround, but I'll keep poking around.

  • How can I check the output size of the Image of an image with a variable

    I have problems with a filter, I write because I can not enter the output image size (x and y) in a filter without doing it manually with a parameter

    Yes, it's currently the only way, but we do not realize that this is a problem and are working on solutions.

    Thank you!

  • Best way to express Boolean values in a table?

    Hello

    I'm looking for the best way to express Boolean values in a table. Is there a better way than this one?

    Men Women Children
    YesYesNO.
    NO.YesNO.

    Or I guess I could draw that checked sign for Yes and X sign for no.? Or is there anywhere I can download those?

    Thank you!

    That would you say a solid bullet for YES, hollow for no-much easier to see the difference at a glance.

  • How can I disable the pop-up blocker may I see table I play at?

    How can I disable the pop-up blocker may I see table I play at?

    IE > tools > pop-up Blocker > turn off pop-up Blocker?

  • Store the output XML editor in the database blob column

    Hello

    We have a requirement to store the pdf files generated by several applications simultaneous xml editor in a database blob column, so that they can be recovered later, whenever required by the user. As far as we know, publisher concurrent request XML output files are stored on the node of simultaneous treatment and the location of the file does not exist in the FND_CONCURRENT_REQUESTS table. But these files to purge from time to time. We are therefore looking for a solution to store these files in the database to the display if necessary.

    If someone knows a solution or can point me to the right direction, it would be much appreciated.

    Thank you very much
    Mary

    Hi Mary,

    You must load the PDF files in the database. Write a regular competitor program which monitors fnd_concurrent_requests and load a custom table or fnd_lobs with any editor of BI exit function application concurrent reading files. BI Publisher output files according to naming convention, so easy to find. http://garethroberts.blogspot.com/2008/07/where-do-i-get-XML-file-or-request.html

    Kind regards
    Gareth

  • synchronization: How can I store the mails for different accounts remotely and manually copy the most important e-mails in local folders on both devices?

    Hello. I have two machines and two accounts, so what I want is this:
    I want only to store mail from two accounts in a remote place and copy more important mails to local folders.

             (I will be grateful for any ideas as to where/how this "cloud" can be - specially free places)
             * Can I have a copy of these local folders in both devices and the remote storage?
             * Could i synchronize devices so that: when i move a mail to a local folder in any device, its copied to the same folders in
                the other device and the remote storage place?
             * The remote storage place will have many other folders. When I open Thunderbird, I also want to see these and the mail
                inside, and also be able to move mail from the inbox to these folders.
              * One of the accounts is gmail. In Account Setting tool, there is an option for synchronization. If there is no easier way, I can have mail for other account copied to gmail, and just syncronize gmail mail. For this, how will I copy my present folder structure to gmail. And how can I syncronize the local folders on the two devices?
    

    Thanks in advance.

    The first awkwardness that I see is that there is no clear format in which to store the messages remotely such that you can work with them in an email client. It may be possible to set the option "Local Directory" of the account in Thunderbird to point to a remote folder (DropBox comes to mind) but I've never tried, and I'd be nervous about what happens if the connection cannot be established, or if you happened to access it simultaneously from two different locations. The other concern is that mail stores are fast becoming big, and you would be forever download and download large files (several gigabytes). Thunderbird stores what looks like a folder that contains many messages separated as one big file, so there is no simple possibility of incremental changes to load up/down.

    The idea of local folders in Thunderbird is to detach messages from servers, therefore they do not follow what is happening on the servers. I say this to emphasize the distinction between files stored locally and permanently ("Local Folders"), against copies cached files online ("synchronized"). It is not sure to consider your folders synchronized as permanent.

    So folders synchronized on an IMAP server are "mirrored" in Thunderbird you do not have a local (although temporary and transitional) copy of messages. This is done primarily to avoid download repeatedly the messages if you re-read, and it makes the fastest search more effective. But these "synchronized" track of message that are deployed on the server, and so if they are deleted from anywhere, all devices that are synchronized at one point also see messages deleted endangered. (Except if you have saved a local copy on the local folders account).

    I use a gmail account quite as much as you described; Copy or move messages to this account, so that they are visible in my phone, my tablet, my own laptop and my computer works. It's free, and it is "in the cloud"; the only reservation I have is her private life. There are other suppliers (e.g. 1 & 1/gmx) who do not seem to have the fetish of collecting data that google thrives.

    It's pretty simple to create filters in Thunderbird to automatically copy messages to your account "cloud." even better is to implement the translation of rules on the servers of other accounts, to ensure that your messages are automatically sent and waiting for you when you log in next time, already in the cloud account.

  • How can I store the passwords that have been deleted

    I had the usernames and passwords stored for multiple accounts of e-mail on the same site. These have been accidentally deleted from the list of saved passwords, and now I can't get Firefox (23.0) to remember once again. I have no password check enabled (behind a master password), and this site does not appear on the list of "exceptions." In the password management utility, there is no facility to add new passwords, not to remove them. It seems, once removed, Firefox assumes one will never want to save this site again.

    I'm in and out of these accounts literally dozens of times a day and now connect in the manual every time. How can I get Firefox saves these combinations of name of user and password for me again?

    Yes. AutoComplete = off is a direction that web sites can give a browser to instruct them not to store the data that you enter in an input field. This can be search terms that you enter on a Web site like Google, but also the privacy and security of sensitive data such as a credit card number.

    If you use the bookmarklet so you know what you are doing and give it a second thought.

    If you use the extension that you don't notice that a Web site prefers that you do not to save this data.

    With recording a password, you will need to confirm a prompt, but the other form data can be recalled if imperceptible autocomplete = off is removed.

  • can I connect the outputs analog of a DAQ configuration in series to have the highest voltage source?

    Hello guys,.

    My question is provided in the topic, you have an idea about that? your help is appreciated.

    ELA

    Hi Ela,

    For almost all devices supported by DAQmx, you can't. When all AO channels have the same motive, connecting them in series would be short the output channel on the ground, which is bad.

    However, there is one exception: the SCXI-1124 module has channel-to-channel isolation, which allows channels to be cascaded to output voltages: I can cascading the output voltage of an SCXI-1124 module?

    With channel-to-Earth isolated peripheral (such as NI 926 x or NI 623 x), you can cascade multiple devices together, but not multiple channels on the same device.

    Brad

  • Coordinate the functions of Boolean values by their name

    Hi all

    I have somewhat a challenge I appreciate some help with. I am trying to create a program that synchronizes the function of a group of Boolean values by their names. If the Boolean values are names bool 1_i, I want that they be synchronized such that when for example a bool 1(1)(a) is turned on, then all the other 1_i bool are replaced by the same State.  The value group Boolean bool 1_i will initially be in the same State, but I'm trying to get a program that allows them to work in parallel like this.  I was able to make a table of 16 by 128 to work like this, where every row has represented the bool j_i group where I = j = 128 and 16. Now, I want to have the same function as a stand-alone Boolean values that are not placed in a table the table function palette.  Indeed, I am trying to get an array of Boolean values without creating a Boolean matrix in the traditional sense of the term. It is because I want the position to each boolean standalone to change while maintaining is synchrony with other Boolean values bound to her by name.  Any help on this would be highly appreciated.

    Here are the screenshots of the code that I used the 16 y 128 table

    Sincerely,

    Tax


  • Cannot install some programs-can't create the output file in the AppData\Local\Temp user account

    When I try to install a program (.exe) it works winzip Self-extractor, which attempts to create a file in the directory Users\ (myusername) \AppData\Local\Temp\setup.exe

    I just installed windows 7 and had to happen one or two times before that, I think, but I re-uploaded the file and I tried again and it ended up working. Now when I try to install this program (Hava), he says that it is unable to create the output file.

    When I try to go to this place it doesn't even have the AppData folder I have to first create this path or is it a problem with the program? Any help is appreciated. Touch Pro

    Well, that's possible. As WinZip SFX has a small option to overwrite without confirmation box.

    You can move forward with delete the file setup.exe from the Temp folder in the sound is no longer used by any program (where its in the Temp folder)

    You can also try now is, since its opening a WinZIP Self Extracting Archive, you can try manually, and manually specify where to extract the files before you click ok.

    Once you do this, just run setup.exe from the specified location.

  • Can I automate the output in Acrobat XI preview window?

    Hello

    I would like to implement a solution simple click for proofing in acrobat XI, which allows my users do the following:

    Overview of open output 1.).

    2.) settings (select a specific profile, check simulate overprinting is enabled, enable simulate paper color).

    3.) enter full screen mode.

    4.), or hide the output re-color-the preview window so that it is darker, as the color of the interface is lighter than the white point of one of the profiles that I want to simulate...

    Is it possible to achieve through java script in the Acrobat console or I have to develop a plugin c ++?

    advice, advice or useful links you would know I developed not anything for acrobat before.

    Concerning

    Matt

    I don't think you can automate it all by both methods.

Maybe you are looking for