Formatting of an address

Hi friends,

I would like to create a procedure that should accept 5 address fields and 4 return address fields (i.e. without empty lines). Please note the example 3, which is a special case.

Example 1 of 3:

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

Entry:

---------

In_Address 1: "Adams".

In_Address 2: 5 first street.

In_Address 3: null

In_Address 4: "Millar Bay.

In_Address 5: "Singapore".

Output (without any null line)

----------

Out_Address 1: "Adams".

Out_Address 2: 5 first street.

Out_Address 3: "Millar Bay.

Out_Address 4: "Singapore".

Example 2 of 3:

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

Entry:

---------

In_Address 1: 'brain'

In_Address 2: "6 Second Street"

In_Address 3: null

In_Address 4: null

In_Address 5: "Singapore".

Output (without any null line)

----------

Out_Address 1: 'brain'

Out_Address 2: "6 Second Street"

Out_Address 3: "Singapore".

Out_Address 4: null

Example 3 of 3:

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

Entry:

---------

In_Address 1: "Casper."

In_Address 2: 7 Third Street.

In_Address 3: "first floor".

In_Address 4: "Millar Bay.

In_Address 5: "Singapore".

Output (in this case, In_Address 4 should be ignored.)

----------

Out_Address 1: "Casper."

Out_Address 2: 7 Third Street.

Out_Address 3: "first floor".

Out_Address 4: "Singapore".

Thanks in advance.

Hello

Here's a way to do what you asked:

CREATE OR REPLACE PROCEDURE compress_address

(in1 in VARCHAR2

in2 in VARCHAR2

in3 in VARCHAR2,

in4 in VARCHAR2,

in5 in VARCHAR2

out1 OUT VARCHAR2

OUT VARCHAR2 out2

out3 OUT VARCHAR2

out4 OUT VARCHAR2

)

-compress_address sets out arguments on the same values as arguments.

- but re-arranging for all NULL values last.

-For example, in the arguments are 'A', ' B ', NULL, NULL,' d. "

-then the out arguments will be 'A', 'B ','d ', NULL

-5 if all the arguments are not NULL, then in4 is not included.

AS

String_array TYPE VARRAY IS (5) OF VARCHAR2 (100);

in_array string_array: = string_array (in1 in2 in3, in4, in5);

out_array string_array: = string_array (NULL, NULL, NULL, NULL, NULL);

out_i PLS_INTEGER: = 1;

BEGIN

FOR j IN 1... 5

LOOP

IF In_array (j) IS NOT NULL

THEN

out_array (out_i): = in_array (j);

out_i: = out_i + 1;

END IF;

END LOOP;

OUT1: = out_array (1);

OUT2: = out_array (2);

OUT3: = out_array (3);

OUT4: = NVL (out_array (5))

, out_array (4)

);

END compress_address;

As mentioned above, it would be simpler to use berries rather than separate arguments.

Also, as mentioned above, it really helps if you have a clear, accurate description and full of what you're trying to do before you start coding (or ask other people to code).

Tags: Database

Similar Questions

  • How to send an instant message, what is the format of an address of instant messaging

    How to send an instant message, what is the format of an address of instant messaging

    Hello

    Are you referring to the use of messenger?

    If so:

    they will help you with your questions/problems Messenger when repost you the link below in the Messenger forums

    http://windowslivehelp.com/product.aspx?ProductID=2

  • What is the format of email address valid in IOM

    Hello

    When I try to edit an e-mail address of the user to the IOM, I get the error message below.

    oracle.iam.platform.kernel.ValidationFailedException: IAM-3050068: the [email protected] value for the Email attribute is not valid. Enter a valid value for the attribute Email.:Email:[email protected]

    e-mail address is in valid format, but could not understand what causes this error?

    What is the valid format for email in IOM

    Thank you

    I think that its only accepts no not because of energy.

    Updated the expression of {2,4} to {2,8}, restart and check.

    ~ J

  • Formatting of the address in a single fields

    With the help of Acrobat X PRO:

    I have a document of several page, where a user is invited to address in two different formats:

    (1) with the address divided into 4 different values/fields:

    Street field, City field, field, the State Zip field

    Example: "1234 County Rd" (Next Line) "St Louis", "MO" "55555".

    2) with all together address:

    Full address on a single line to a maximum of 40 characters.

    Example: 1234 County Rd., St. Louis, MO 55555

    ---

    I would like users to be able to fill the Street, City, State and Zip, and no matter what the format of the following fields are autopopulated of data.

    This isn't a problem for example #1.  However, with #2 if I place all the fields close together, I have to guess on how remote for each field of space and have always adapt and be correctly formatted.

    Is it possible to combine the values in the 4 fields into a single value (separated by commas)?

    Make the 'auto adjustment' address field may be necessary, but it is ugly, if there is more space in the remaining fields.

    PLEASE SEE THIS document of the EXAMPLE I created for the purpose of this post

    Yes, it is all set up for it. You can add the following function to a JavaScript script at the level of the document:

    Include in a JavaScript script at the level of the document

    function concatAddress() {}

    Get field values and place it in the table

    var aa = [];

    Street of var = getField("Street").valueAsString;

    If aa.push (street) (Street);

    var city = getField("City").valueAsString;

    If aa.push (City) (City);

    var State = getField("State").valueAsString;

    If aa.push (State) (State);

    Code postal var = getField("Zip_Code").valueAsString;

    If aa.push (postal code) (postal code);

    Concatenate and set the value of this field

    Event.Value = aa.join (",");

    }

    And call it from the event calculate any field you want to fill with full address:

    Custom calculate script

    concatAddress();

    The full address fields do not need to be named the same, but they will have to call the same function in their calculation of the events. You can change the name of the function if you wish.

  • Problems to export lists of addresses to CSV format (not all addresses are exportationdonnees, getting corrupted)

    I export a list of in my address book, but the data that are incompatible. Some of the names/emails export OK, but overall list, there are some documents that seem just crazy (I mean the data just wind in the fields hurt at random, some documents do not seem to export at all, etc.). I have a list of about 1 400 contacts, but only about 1,000 of them export in the correct fields.

    I brought the CSV file in Excel and tried to clean it, but I see that there still will do a lot of missing documents. I suspect that this is because there must be some long strings (or non-compliant characters) in some of the comments fields (which have been copied to a people of a completed form when they are added to my list). I'm trying to export it so that I can pass it to a commercial e-mail as MailChimp service.

    Does anyone have experience with this?

    Then try an export of the difference, as delimited by tabs. Excel also opens easier than commas and it is unlikely that your file will be incorporated tabs. At least I hope so.

    In the future, you might want to clean up garbage on the web before you import it into Thunderbird, or any other program.

    BTW email me will get all information on the Mail Chimp. They cannot report on those who allow remote images, but light on detail, there are marketing information.

  • E-mail for answer button (formatting e-mail address)

    Here's my scenario...

    Users fill out a form and then send it via a submit button.

    Is it possible to the receptian of the response form click send to the sender?

    The email reply button (with a script) will still get the value (sender email address).

    We are using Outlook.

    Thank you very much

    Hello

    I think you are trying to get the form to get the e-mail address of the sender of the email/Outlook. I don't think that this interaction between Acrobat/Reader and Outlook is possible.

    Would it not easier to include a field in the form for the sender to include their email address? Then the reply button would simply use this address, all of in the form.

    Niall

  • I can't block an e-mail address

    I got this email from this person harassing me: * address email is removed from the privacy *

    I added to a block list, but he said: "an email address must be in the following format: * e-mail address is removed from the privacy *.» A domain must be in the following format: example.com. »
    Then how he blocked.
    Thank you
    Bilaal

    Hello

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums at www.windowslivehelp.com.

  • Function to extract a phone number of an address?

    Hello

    I need to implement a function that is capable of extracts a U.S. / Canada phone number (in a variety of formats) from an address.
    For example, I need to extract the telephone number of a string like:

    Mr. A. Johnson
    J & son Inc.
    123 front st.
    Tel.: 613-123-1234 ext.216

    The function should return * (613) - 123-1234 *.

    Any help will be greatly appreciated.

    Kind regards
    Mr. Rusu
    SQL> select  regexp_substr ( address
                  , '[(]?'    || -- 0 or 1 left brackets
                  '[0-9]{3}'    || -- 3 digits
                    '[). -]*'    || -- 0 or more separator characters
                '[0-9]{3}'    || -- 3 digits
                    '[. -]*'    || -- 0 or more separator characters
                '[0-9]{4}'       -- 4 digits
                  )  as phone_number
    from (
      select '123 456-7890 ext.216' address from dual  union all
      select '(123) 456-7890 ext.216' address from dual
    )
    /
    PHONE_NUMBER
    ----------------------
    123 456-7890
    (123) 456-7890        
    
    2 rows selected.
    
  • When I enter the name/email in web forms, the form is not 'read' or recognize my valid entered as name/email text.

    This has happened on several different sites in several different contexts. I enter information but then receive a "Please indicate your name and your email address" or "This is not a properly formatted e-mail address" message (based on whatever the form code provides some error messages for empty mandatory fields). I rechecked, of course, and the text has been entered correctly. This has happened once with AutoFill, last time I entered the text myself.

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Firefox > Preferences > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox > Preferences > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    You can try to remove saved forms (autofill) data are case which is corrupting the data.

    • Click on the (empty) input field on the web page to open the drop-down list
    • Select an entry in the drop-down list
    • Press the DELETE key (on a Mac: shift + delete) to remove it.

    Firefox will remember new form data when entered.

  • Omega TCP IP 66 error

    Good Friday afternoon!

    I used the web interface for my OMEGA with Option Ethernet iNFB counter successfully. Now, I'm rehearsing the communication in Labview. The program appears to write the data very well but then does not receive a response back, or at least Windows is not patient enough to wait one because I get error 66 to try to read. I added a while loop to re-establish the connection when an error trying to read is reported. I still get no response from the unit. The format of the command is:

    * - selected character recognition (any character from ASCII table)

    X - read measurement data in decimal format

    01. address of the first sensor (actually only)

    -carriage return

    When this command via the interface 'internet', the device reacts with (for example): X0100076.0.

    Fixed probe is a probe of RTD and playback of content in the response is correct: 76.0.

    The attached program your dissection.

    Thanks for your ideas...

    Solution:

    The attached above code works fine (less the while loop) when the i-server is properly configured to accept connections. Apparently, when you use the Web interface, this parameter is ignored and regardless of access. To configure the iserver for access set the "number of connections" greater than 0, most often 1 should suffice. Once it's done VI standard TCP/IP communication as fasteners at the top works like a charm.

    I hope I can save someone else some time...

  • Use of FindLstn in Labview

    I'm fighting with the Findlstn function in Labview.  He's back ' Labview: token Configuration not found "and" NOR-488: Table Error»  I'm guessing that the format of my address list entry is not correct - I use a table 1 d of word - but can't find an example or relevant advice on the error messages.

    The address list is simply a table of numbers that correspond to the GPIB addresses to check. , You specify a value for the 'deadline '? It is default to zero. Don't ask me, I don't know why, either.

  • Read MODBUS registers

    Hi all

    I have been more manuals/son using the Modbus Library to communicate through series. However, I'm not sure what exactly I am doing wrong. If I use a program like Modbus Poll and send 02 03 00 02 00 02 65 F8 I get a response: 02 03 04 39 20 90 D5 F9 3F. Looking at the manual for the device that I'm communicating with (a pressure transmitter), the application is in the following format:

    02 - address

    03 - function

    00 - StAdd H

    02 StAdd L

    00 - reg #:

    02 # reg L

    65 CRC16 L

    F8 - H CRC16

    The answer is in this format:

    02 - address

    03 - function

    04. # of bytes

    39 data:

    20 - data L

    3F - data:

    90 data L

    D5 - L CRC16

    F9 - H CRC16

    So, in LabVIEW, this is how I have it Setup:

    I put the 'Start' address to 1 because I have read, there must be in LabVIEW 1 less than what the actual starting address is (n - 1). I expect the same reply as above using Modbus Poll. In the diagram above, I get the following registers, starting at index 0: 256, 661, 63490 33538

    Obviously the answer is not in hexadecimal as above, but it is nowhere near what it should be.

    Thanks for the help!


  • My account is block because of spamming

    Help! I also had my account block. They said that I was spamming email. I think my account got hack. so, when I connect to my email, they ask me to verify my account using a code, they sent to my old email. However, the old email that I gave is "* address email is removed from the privacy *" If you realize, I type "hotRmail" yupp! I type wrong, and therefore, I'll never be able to receive the verification code.

    (1) I tried to use my cell phone, I type + 65 *. but I never received the code either. haven't typed it wrongly? I meant the format.

    (2) I tried security issues, but he said I tried too many times trying to recover.

    (3) I tried the recovery of real account window. But when I type in the window Live ID I am recovering, it says this:

    "Your ID Windows Live ID must start with a letter." The ID can contain only letters, numbers, periods (.), hyphens (-) and underscores (_). Please enter a different Windows Live ID in the following format: * e-mail address is removed from the privacy *. »

    I tried typing very, very carefully and even try to copy the email and pasting. nothing works, they always showed me the same error :(

    Answer me asap:(Merci!)

    the account I am recovering is * address email is removed from the privacy *. Thank you!

    Hello

    Answers is a peer group supported and unfortunately has no real influence on Hotmail.

    HotMail has its own Forums, so you can ask your questions there.

    Windows Live Solution Center - HotMail - HotMail Forums Solutions
    http://windowslivehelp.com/

    Hotmail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=1

    Hotmail - Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=1

    How to contact Windows Live Hotmail Support
    http://email.about.com/od/hotmailtips/Qt/et_hotmail_supp.htm

    Windows Live Hotmail Top issues and Support information
    http://support.Microsoft.com/kb/316659/en-us

    Compromised account - access unauthorized account - how to recover your account
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    Hotmail hacked? Take these steps
    http://blogs.msdn.com/b/securitytipstalk/archive/2010/07/07/Hotmail-hacked-take-these-steps.aspx

    I hope this helps.

  • UDP

    HIII family to labview,

    I use a single network, in this network, there are data from various ip address with the same remote port. I am interested extract data to the UDP format for the address only ip permanently without missing packets of data at the speed of 100 Mbps. can someone please help me...?


  • Unable to send message push on server

    Greetings,

    I managed get record (PIN) for my device id, but I stuck on the development server side, I hope someone could help me

    I've followed these 3 references:

    1. http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Problem-with-SEND-Push-Notificati...

    2. http://supportforums.blackberry.com/t5/Android-Runtime-Development/Not-receiving-push-notification-o...

    3. http://stackoverflow.com/questions/8472331/server-side-problemt-php-push-message-to-blackberry

    But I do not get the result as expected, instead, I always have ERROR CODE 2000 like this:

    Our PUSH-ID: 1401179949.8267
    
    An error has occured
    Error CODE: 2000
    Error DESC: 2000
    
    string(217) " "
    

    The string (217) "" contains:

    
        
    
    

    The code I am using:

            $appid = '4746-6135ee38Dm11ro8094c98i7900xxxxxxxxx';
            $password = 'xxxxxxxx';
            $boundary = "mPsbVQo0a68eIL3OAxnm";
    
            $deliverbefore = gmdate('Y-m-d\TH:i:s\Z', strtotime('+2 minutes'));
            //An array of address must be in PIN format or "push_all"
            $addresses = '';
            foreach ($registatoin_ids as $value) {
                $addresses .= '
    '; } // Open connection $ch = curl_init(); $err = false; $messageid = microtime(true); $data = '--' . $boundary . "\r\n" . 'Content-Type: application/xml; charset=UTF-8' . "\r\n\r\n" . ' http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"> ' . $addresses . ' ' . "\r\n" . '--' . $boundary . "\r\n" . // 'Content-Encoding: binary' . "\r\n" . 'Content-Type: text/plain' . "\r\n" . 'Push-Message-ID: ' . $messageid . "\r\n\r\n" . '{ "key":"value", "key2":"value2" }'. "\r\n" . '--' . $boundary . '--' . "\n\r"; $url = 'https://cp4746.pushapi.eval.blackberry.com/mss/PD_pushRequest'; // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_USERAGENT, "SAA push application"); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $appid . ':' . $password); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/related; boundary=" . $boundary . "; type=application/xml", "Accept: text/html", "Connection: keep-alive")); // grab URL and pass it to the browser $xmldata = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); //Start parsing response into XML data that we can read and output $p = xml_parser_create(); xml_parse_into_struct($p, $xmldata, $vals); $errorcode = xml_get_error_code($p); if ($errorcode > 0) { $err = true; } xml_parser_free($p); echo 'Our PUSH-ID: '.$messageid . "
    \n"; if (!$err && $vals[1]['tag'] == 'PUSH-RESPONSE') { echo 'PUSH-ID: ' . $vals[1]['attributes']['PUSH-ID'] . "
    \n"; echo 'REPLY-TIME: ' . $vals[1]['attributes']['REPLY-TIME'] . "
    \n"; echo 'Response CODE: ' . $vals[2]['attributes']['CODE'] . "
    \n"; echo 'Response DESC: ' . $vals[2]['attributes']['DESC'] . "
    \n"; } elseif ($err) { echo '

    An XML parser error has occured

    ' . "\n"; echo '
    ' . xml_error_string($errorcode) ."
    \n » ; echo '

    Response

    ' . "\n"; echo '
    ' . $xmldata . '
    ' . "\n"; } else {echo '}

    An error has occurred

    ' . "\n"; echo ' fault CODE: '. $vals [1] ['attributes'] ['CODE']. "
    \n » ; echo ' error DESC: '. $vals [1] ['attributes'] ['DESC']. "
    \n » ; echo '
    ' . $xmldata . '
    ' . "\n"; var_dump ($XMLDATA); } var_dump ($vals); Return $xmldata;

    where record id, I get is already a correct form without the prefix, which only hurts?

    I finally found the right answer for me, from here:

    http://supportforums.BlackBerry.com/T5/BlackBerry-push-development/BB-bis-push-PHP-Server-works-on-p...

    Marcboo thanks for the reply.

    And then I change the code below

    stripslashes($message)
    

    TO:

    json_encode($message)
    

    Complete code below, with the necessary adaptations:

    ';
                }
    
                // create a new cURL resource
                $err = false;
                $ch = curl_init();
                $messageid = microtime(true);
    
                $data = '--asdwewe'. "\r\n" .
                'Content-Type: application/xml; charset=UTF-8' . "\r\n\r\n" .
                '
                http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">
                
                '
                . $addresses .
                '
                
                ' . "\r\n" .
                '--asdwewe' . "\r\n" .
                'Content-Type: application/json' . "\r\n" .
                        //'Content-Encoding: binary'. "\r\n" .
                'Push-Message-ID: ' . $messageid . "\r\n\r\n" .
                json_encode($message) . "\r\n" .
                '--asdwewe--' . "\r\n";
    
                // set URL and other appropriate options
                curl_setopt($ch, CURLOPT_URL, "https://pushapi.eval.blackberry.com/mss/PD_pushRequest");
                    curl_setopt($ch, CURLOPT_PORT , 443);
                    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
                    curl_setopt($ch, CURLOPT_CAINFO, getcwd()."\cacert.pem");
                    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    
                curl_setopt($ch, CURLOPT_HEADER, false);
                curl_setopt($ch, CURLOPT_USERAGENT, "My BB Push Server\1.0");
                curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
                curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                curl_setopt($ch, CURLOPT_USERPWD, $appid . ':' . $password);
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
                $__extra_Headers = array(
                    "Content-Type: multipart/related; boundary=asdwewe; type=application/xml",
                    "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2",
                    "Connection: keep-alive",
                    "X-Rim-Push-Dest-Port: ".$appport,
                    "X-RIM-PUSH-ID: ".$messageid,
                    "X-RIM-Push-Reliability-Mode: APPLICATION"
                );
                curl_setopt($ch, CURLOPT_HTTPHEADER, $__extra_Headers);
    
                // grab URL and pass it to the browser
                $xmldata = curl_exec($ch);
                if($xmldata === false){
                    echo 'Error pada CURL : ' . curl_error($ch)."\n";
                }else{
                    echo 'Operasi push berhasil'."\n";
                }
    
                // close cURL resource, and free up system resources
                curl_close($ch);
    
                //Start parsing response into XML data that we can read and output
                $p = xml_parser_create();
                xml_parse_into_struct($p, $xmldata, $vals);
                $errorcode = xml_get_error_code($p);
                if ($errorcode > 0) {
                    echo xml_error_string($errorcode)."\n";
                    $err = true;
                }
                xml_parser_free($p);
    
                echo 'Our PUSH-ID: ' . $messageid . "
    \n"; if (!$err && $vals[1]['tag'] == 'PUSH-RESPONSE') { echo 'PUSH-ID: ' . $vals[1]['attributes']['PUSH-ID'] . "
    \n"; echo 'REPLY-TIME: ' . $vals[1]['attributes']['REPLY-TIME'] . "
    \n"; echo 'Response CODE: ' . $vals[2]['attributes']['CODE'] . "
    \n"; echo 'Response DESC: ' . $vals[2]['attributes']['DESC'] . "
    \n"; } else { echo '

    An error has occured

    ' . "\n"; echo 'Error CODE: ' . $vals[1]['attributes']['CODE'] . "
    \n"; echo 'Error DESC: ' . $vals[1]['attributes']['DESC'] . "
    \n"; } } catch (Exception $e) { var_dump($e->getMessage()); } exit(); } } ?>

    See you soon

Maybe you are looking for