I'm trying to extract the strings and load them into a text-helpplease file

I'm trying to extract the strings and load them into a file text without space between them - see below

p_csa = ISCC M4 DP

where p_csa is a tring to load into a text file



Code:

SELECT SUBSTR (p_csa, 0, 0) INTO v_telco FROM DUAL;
SELECT SUBSTR (p_csa, 1, 4) INTO v_comp FROM DUAL;
SELECT SUBSTR (p_csa, 5.3) INTO v_csa_prefix FROM DUAL;
SELECT SUBSTR (p_csa, 8, 4) INTO v_csa_type FROM DUAL;

fileidinvoice: = UTL_FILE. FOPEN (c_data_location, filenameinvoice, 'W');
fileidlog: = UTL_FILE. FOPEN (c_data_location, filenamelog, 'W');

UTL_FILE. PUT_LINE)
fileidinvoice, v_telco | » '|| v_comp | "|" | v_csa_prefix: "| v_csa_type);


-the content of the file-

ISCC M4 DP

=====================
I want to remove the space between the chain above for the content of the file should look like this:

-the content of the file-

GCSIM4DP

Hello

976253 wrote:
I'm trying to extract the strings and load them into a file text without space between them - see below

p_csa = ISCC M4 DP

where p_csa is a tring to load into a text file

Code:

SELECT SUBSTR (p_csa, 0, 0) INTO v_telco FROM DUAL;

Is it always NULL?

SELECT SUBSTR (p_csa, 1, 4) INTO v_comp FROM DUAL;

You don't need the double table much in PL/SQL. You can simply say

v_comp := SUBSTR (p_csa, 1, 4);

Almost all integrated single-row functions work in PL/SQL. (NVL2 is the only one I know who does not work in PL/SQL).

SELECT SUBSTR (p_csa, 5.3) INTO v_csa_prefix FROM DUAL;
SELECT SUBSTR (p_csa, 8, 4) INTO v_csa_type FROM DUAL;

fileidinvoice: = UTL_FILE. FOPEN (c_data_location, filenameinvoice, 'W');
fileidlog: = UTL_FILE. FOPEN (c_data_location, filenamelog, 'W');

UTL_FILE. PUT_LINE)
fileidinvoice, v_telco | » '|| v_comp | "|" | v_csa_prefix: "| v_csa_type);

What are you trying to do here? For example, what you're trying to put between c_comp and v_csa_prefix?

-the content of the file-

ISCC M4 DP

=====================
I want to remove the space between the chain above for the content of the file should look like this:

-the content of the file-

GCSIM4DP

If you don't want space, then only concatenate all the spaces in the string before you write it and REPLACE allows you to delete all the spaces that have been copied from p_csa. For example:

UTL_FILE.PUT_LINE ( fileidinvoice
            , REPLACE ( v_telco || v_comp
                                    || v_csa_prefix
                          || v_csa_type
                   , ' '
                   )
            );

I guess you need the v_comp of separate variables, the v_csa_prefix and the v_csa_type for something.

I hope that answers your question.
If this isn't the case, after a complete script that people can run to recreate the problem and test their ideas. Display the results you want (in other words, the contents of the file created).
Always say what version of Oracle you are using (for example, 11.2.0.3.0).
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

Maybe you are looking for

  • How can I get rid of the highlight of the part of the url?

    Part of the address (mozilla.com of https://support.mozilla.com/en-US/questions/new?product=desktop & category = d4 etc.) is highlighted. Why? It feels like a bike to safety wheels. This 'device' should become optional. I want to see the full address

  • Is Microsoft-New Xbox 360-shows green and purple of screen when playing, defective?

    I just bought a new xbox360 for Christmas and since the purchase, he showed color display only green and purple. Once when playing adventures with the kinect, all entered colors automatically, but it has not changed and when to use again another day

  • "WLTRYSVC' 'event 2" '.

    Impossible to computer to boot, solved by a restore point to earlier date. Reappened after the update of the window. Previous working configuration worked. Source WLTRYSVC, ID of event 2, Desription SelfServiceStatus () failed. Problem of Recorring.

  • How can I removed all the contacts list?

    Hello, all. I want to removed the entire list of contacts from my blackBerry with blackberry API. I wrote this... --------------------------------------------------------------------- try {} List of strings [] = PIM.getInstance () .listPIMLists (PIM.

  • Cisco-remote control

    Hello Is it possible to disable the codec C60 with the remote control?