Insert or get php data

Users fill out my form that is embedded in a php page in which they are logged in.
Is there a way to automatically insert a "php data" (e.g. email) in the 'email' field of the form?
Otherwise, the "php data" can be in some way included in the reponse, in order to avoid the user to fill again the email field?
Thanks, Davide

This is functionality that is not supported.

Similar Messages

  • Insert problems with Php Data Services

    Hi All,
    I am using Flex Data wizards to create a simple CRUD application and i am having problems adding data. It works the first time i start my application but subsequent calls to the insert fail.
    I am using FB2 Beta with MAMP. The php classes are being generated using the data wizard. i have tried commenting out mysqli_close but still it doesn't work.
    public function createDive_events($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename ( divedate, divesite, divecost, description, totalDays) VALUES ( ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_bind_param($stmt, 'ssdsi', $item->divedate, $item->divesite, $item->divecost, $item->description, $item->totalDays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = mysqli_stmt_insert_id($stmt);
    mysqli_stmt_free_result($stmt);
    //mysqli_close($this->connection);
    return $autoid;
    Any ideas, what i am doing wrong. I have tried using the update and it works only once as well, it seems that the connection to the function is lost after the first call.
    thank you,
    Nayan

    Ok, this is what I got.
    create a mysql table (`people`) with columns id (auto increment), first_name, last_name, age
    in the data/service panel connect to a php service, generate a php service from the database and the people table
    generate a form from the createPeople service call
    observe that in source view we have something like this: <fx:Script>
      <![CDATA[
           protected function button_clickHandler(event:MouseEvent):void {
              createPeopleResult.token = peopleService.createPeople(people);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <valueObjects:People id="people"
                           people_id="{parseInt(people_idTextInput.text)}"
                           age="{parseInt(ageTextInput.text)}"/>
      <peopleservice:PeopleService id="peopleService"/>
      <s:CallResponder id="createPeopleResult"/>
    </fx:Declarations>
    If you now try to execute the code, you will find that you can only insert one person, where each successive addition silently fails.
    There is nothing really wrong with the php code (well actually since it's auto incrementing on id you should pull all id reference out of the insert statements...) rather there is a problem with the flex people object.
    If you make the following changes the code will work
    protected function button_clickHandler(event:MouseEvent):void {
      var myPerson:People = new People();
      myPerson.first_name = people.first_name;
      myPerson.last_name = people.last_name;
      myPerson.age = people.age;
      createPeopleResult.token = peopleService.createPeople(myPerson);
    - e

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • Using BufferedReader to get Unicode data from a .php site

    Hi,
    Probably a rather mundane question. I'm working on an applet which uses a .php site as a proxy to get at data found in a mySQL database. It's working adequately for text consisting of standard English characters only - the only problem is that every time I read in a file, it starts with the characters ""
    It's not working at all for text using other characters - I get an incomprehensible string of characters in Java when I try that.
    So my assumption is that Java does not understand that my php document is in Unicode, and is trying to read it using a different encoding system. I use unicode charaters elsewhere in this applet and have no problems with them, so I am assumign it must be an I/O error.
    What do I have to do to make Java realize that this is unicode?
    Here's the relevant code as it is now:
    String goTo = "http://[...]/info.php?search=" + toLink(search);
    URL test = new URL(goTo);
    URLConnection testConnection = test.openConnection();
    BufferedReader dis = new BufferedReader(new InputStreamReader(testConnection.getInputStream()));
    String inputLine;
    while ((inputLine = dis.readLine()) != null) {
                    giveout += inputLine;
    dis.close();The String giveout should have all the data from the document in it after this.
    Or do I need to change something about my php, which, as it is now, just displays the data from my database, with no HTML tags whatsoever?

    You probably have a 'byte order marker' ( BOM ) at the beginning of the file. You can use my BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 or you can just discard the BOM bytes from the InputStream before wrapping it in the BufferedReader.
    Hi Sabre im facin the same probem.
    bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
    bufferedReader.readLine() returns a junk character ? at the beginning of the line.
    you have instructed to use your BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 but i dotn know how to use it with bufferedReader because i want my method to return only a BufferedReader object.
    can you suggest me how to go about it.
    my code is as below need help.
    public BufferedReader check(){
                     bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
            return bufferedReader; // need to return bufferedReader object only...since some other code needs bufferedReader ...suggest me.
    i will be highly obliged if you paste the refined code.. please need your urgent help on this...
    Regards
    Deepak

  • Empty lines getting inserted while copying File data as chunks

    When I try to copy data from one file to other, Extra lines are getting inserted into the copied data.
    I am actually reading chunks of data from the first file and writing it to the other by using 'Byte' count to read.
    Whenever the no. of bytes read ends with the EOL, one extra line is getting inserted in the second file. 
    Consider the code snippet given below :
    If the first file content is like this :
    Then the copied file looks :
    The two files are also attached with this post.
    Please shre your suggestions to solve this issue
    Attachments:
    File to be copied.txt ‏1 KB
    Copied File.txt ‏1 KB

    Right click on your Read and Write text file functions and uncheck the Convert EOL option.
    You should also set the browse options for the 2nd file path to allow for new or existing files, and the file open to be for Open or Create.  Without those changes, you can't pick a new file and if you could, you'd get error when it tried to open the file that didn't exist.

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • How to insert dummy record as KF =0 when i dont get trx data from customer

    Hi
    In BI DSO, i wanted to insert a dummy record with its Key Fields values = 0 in case i don't get any data for a particular day from customer. Could you pls suggest me what to do.
    Thanks...
    Edited by: Harpal Singh on Aug 18, 2010 3:19 PM

    hello,
        Well my first suggestion is it would be great if you could give us example with data for better understanding. Here is what i understood, at a given date and customer number you want key figure value zero if there is no transaction data for this customer on that date.
    You can write this code at endroutine:
    Step1: You need to select all the customer records from customer infoobject and store that in internal table
    Step2: Now you will compare the internal table with all customer number with the result package ( this result package is nothing but a kind of internal table at end routine ).
    Step3: On comparison with the result package append the result package with reocords of customer which is not found during comaprison..
    If you can give the data i can write sample code.....
    Hope this helps
    thanks
    syed

  • When copying one of my old cassettes to a CD how do I get the data - album name, artist, etc. to show up when the CD is inserted into a player?

    When copying one of my old cassettes to a CD how do I get the data - album name, artist, etc. to show up when the CD is inserted into a player?

    To what format file are you saving from Audacity?  Although technically AIFF format can save data tags within the file itself I have not found this to always work with all applications.  Likely the information you enter into Audacity is just being saved in the file name.  When you add this file to iTunes, if iTunes cannot find tags it recognizes it will simply add the track with the file name as the track name.  You need to add the tracks to iTunes, then enter the information using File > Get Info for a track or series of tracks,
    Some of the above information may vary slightly depending upon the file format being used.
    It helps when asking questions here to provide as much information at the onset as possible.  We didn't know until this stage that all these menus were in fact part of Audacity and not iTunes.

  • I have a macbook air bought in 2010 wit liquid damage that might has affected the SSD card. I need to get my data but apple won't help. Authorized dealers never seem to have the same model to try whether the SSD card works. How can I get my data quickly?

    Hi
    I have a macbook air bought in 2010. It has liquid damage that might or might not affected the SSD card. I need the data on my SSD card for work and I need it urgently. Apparently Apple won't get the data out, even if I have apple care... Licensed apple dealers need to have the same macbook air model so they can insert the SSD card and check whether the data is there, and they never seem to have one...
    I'm really disappointed with apple. It's been two weeks and I haven't been able to find out whether the SSD card is holding my data. It can't take that long to do it in store... How can they sell a product and then wash their hands on the matter?
    Anyway, enough with the apple rant. I need to get this data urgently so I need to find out how I can get it out of the card. The SSD card and data might be fine so I don't want to take it to a data recovery centre and get charged loads.
    Thanks for your help.
    Olatz

    See this link for a 4870 card, best instructs for flashing for a noob like me. (last lowest price was $150 for a 1GB vRAM 4870 from TigerDirect).
    http://web.me.com/jacobcroft/4870Flash/4870Flash.html
    However, not every 4870 card will work with the ROM currently floating around out there. BEWARE!
    Link to recovering a bricked card:
    http://forums.techpowerup.com/showthread.php?t=64328

  • Flex & PHP - Insert Query in Php Service

    I have a MySql DB with 2 tables:
    1. category - categoryID / category / description
    2. photos - photoID / categoryID / photodescription / photo
    And i have a service (CategoryService.php) automatically created by Flash Builder, but i cannot get the second table!!
    <?php
    class CategoryService {
    var $username = "root";
    var $password = "";
    var $server = "localhost";
    var $port = "3306";
    var $databasename = "teste";
    var $tablename = "category";
    var $connection;
    * The constructor initializes the connection to database. Everytime a request is
    * received by Zend AMF, an instance of the service class is created and then the
    * requested method is invoked.
    public function __construct() {
        $this->connection = mysqli_connect(
                                $this->server, 
                                $this->username, 
                                $this->password,
                                $this->databasename,
                                $this->port
        $this->throwExceptionOnError($this->connection);
    * Returns all the rows from the table.
    * Add authroization or any logical checks for secure access to your data
    * @return array
    public function getAllCategory() {
        $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");       
        $this->throwExceptionOnError();
        mysqli_stmt_execute($stmt);
        $this->throwExceptionOnError();
        $rows = array();
        mysqli_stmt_bind_result($stmt, $row->categoryId, $row->category, $row->description);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->categoryId, $row->category, $row->description);
        mysqli_stmt_free_result($stmt);
        mysqli_close($this->connection);
        return $rows;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function getCategoryByID($itemID) {
        $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where categoryId=?");
        $this->throwExceptionOnError();
        mysqli_stmt_bind_param($stmt, 'i', $itemID);       
        $this->throwExceptionOnError();
        mysqli_stmt_execute($stmt);
        $this->throwExceptionOnError();
        mysqli_stmt_bind_result($stmt, $row->categoryId, $row->category, $row->description);
        if(mysqli_stmt_fetch($stmt)) {
          return $row;
        } else {
          return null;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function createCategory($item) {
        $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (category, description) VALUES (?, ?)");
        $this->throwExceptionOnError();
        mysqli_stmt_bind_param($stmt, 'ss', $item->category, $item->description);
        $this->throwExceptionOnError();
        mysqli_stmt_execute($stmt);    
        $this->throwExceptionOnError();
        $autoid = mysqli_stmt_insert_id($stmt);
        mysqli_stmt_free_result($stmt);    
        mysqli_close($this->connection);
        return $autoid;
    * Updates the passed item in the table.
    * Add authorization or any logical checks for secure access to your data
    * @param stdClass $item
    * @return void
    public function updateCategory($item) {
        $stmt = mysqli_prepare($this->connection, "UPDATE $this->tablename SET category=?, description=? WHERE categoryId=?");     
        $this->throwExceptionOnError();
        mysqli_stmt_bind_param($stmt, 'ssi', $item->category, $item->description, $item->categoryId);      
        $this->throwExceptionOnError();
        mysqli_stmt_execute($stmt);    
        $this->throwExceptionOnError();
        mysqli_stmt_free_result($stmt);    
        mysqli_close($this->connection);
    * Deletes the item corresponding to the passed primary key value from
    * the table.
    * Add authorization or any logical checks for secure access to your data
    * @return void
    public function deleteCategory($itemID) {
        $stmt = mysqli_prepare($this->connection, "DELETE FROM $this->tablename WHERE categoryId = ?");
        $this->throwExceptionOnError();
        mysqli_stmt_bind_param($stmt, 'i', $itemID);
        mysqli_stmt_execute($stmt);
        $this->throwExceptionOnError();
        mysqli_stmt_free_result($stmt);    
        mysqli_close($this->connection);
    * Returns the number of rows in the table.
    * Add authorization or any logical checks for secure access to your data
    public function count() {
        $stmt = mysqli_prepare($this->connection, "SELECT COUNT(*) AS COUNT FROM $this->tablename");
        $this->throwExceptionOnError();
        mysqli_stmt_execute($stmt);
        $this->throwExceptionOnError();
        mysqli_stmt_bind_result($stmt, $rec_count);
        $this->throwExceptionOnError();
        mysqli_stmt_fetch($stmt);
        $this->throwExceptionOnError();
        mysqli_stmt_free_result($stmt);
        mysqli_close($this->connection);
        return $rec_count;
    * Returns $numItems rows starting from the $startIndex row from the
    * table.
    * Add authorization or any logical checks for secure access to your data
    * @return array
    public function getCategory_paged($startIndex, $numItems) {
        $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename LIMIT ?, ?");
        $this->throwExceptionOnError();
        mysqli_stmt_bind_param($stmt, 'ii', $startIndex, $numItems);
        mysqli_stmt_execute($stmt);
        $this->throwExceptionOnError();
        $rows = array();
        mysqli_stmt_bind_result($stmt, $row->categoryId, $row->category, $row->description);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->categoryId, $row->category, $row->description);
        mysqli_stmt_free_result($stmt);    
        mysqli_close($this->connection);
        return $rows;
    * Utility function to throw an exception if an error occurs
    * while running a mysql command.
    private function throwExceptionOnError($link = null) {
        if($link == null) {
            $link = $this->connection;
        if(mysqli_error($link)) {
            $msg = mysqli_errno($link) . ": " . mysqli_error($link);
            throw new Exception('MySQL Error - '. $msg);
    ?>
    In Flash Builder i have 2 spark List, the first one have all categorys and i want when "selectedItem" it populates the other one with the correspondent photos!! I have a query that works with the database but i cannot insert it into php. This is the query:
    SELECT TC.*, TP.photodescription , TP.photo FROM category TC inner join photos TP on TC.categoryId = TP.categoryId
    How can i do this!?
    Hope it's understandable, thanks for "listening"..

    This is great, that's it!! Many thanks ;-)
    Now i can get info from this function but i'm not sure how to manage it.
    I have 2 spark List, the first one have all categorys and i want when "selectedItem", it populates the other one with the correspondent photos!!
    This is my .mxml:
    <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import mx.events.FlexEvent;
                import spark.events.IndexChangeEvent;
                protected function list_creationCompleteHandler(event:FlexEvent):void
                    getAllCategoryResult.token = categoryService.getAllCategory();
                protected function list_changeHandler(event:IndexChangeEvent):void
                    category = list.selectedItem;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <s:CallResponder id="getAllCategoryResult"/>
            <categoryservice:CategoryService id="categoryService"
                                             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                             showBusyCursor="true"/>
            <valueObjects:Category id="category"/>
        </fx:Declarations>
        <s:List id="list" x="94" y="143" creationComplete="list_creationCompleteHandler(event)" change="list_changeHandler(event)"
                labelField="category">
            <s:AsyncListView list="{getAllCategoryResult.lastResult}"/>
        </s:List>
        <s:List x="672" y="143"></s:List>
    What do i have to do now!?
    Thanks again..

  • Problem Using HTTP Dispatcher -- Could Not able to get the data in JSP

    Hi, I am using HTTP Dispatcher to send my events to particular URL which is a JSP page. I am trying to populate the received event through URL and populate to a oracle data base. But could not able to get the data in Oracle database.
    Code is :
    <h1>JSP Page</h1>
    <%
    long type = 0;
    String tagId = null;
    String timeStr = "0";
    String deviceName = "";
    // Get Event Parameters
    // Available Parameters: id, siteName, deviceName, data, time, type, subtype, sourceName, correlationId
    try
    type = Long.parseLong(request.getParameter("type")); // Get type
    tagId = request.getParameter("id"); // Get tagId
    timeStr = request.getParameter("time"); // Get time
              deviceName = request.getParameter("deviceName");
    catch (Exception e)
    out.println( "Error: "+e.getMessage() );
              // Write into DB.
              try {
              if ((tagId == null) || (type != 200) ){
                   // Do Nothing
                   //return;
              } else {
                   OracleDataSource ods = new OracleDataSource();
                   String URL = "jdbc:oracle:thin:@//3.235.173.16:1525/vislocal";     
                   ods.setURL(URL);
                   ods.setUser("cus");
                   ods.setPassword("cus");
                   Connection myConn = ods.getConnection();     
                   Statement stmt = myConn.createStatement();
                   String selectQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads ";
                   ResultSet rs = stmt.executeQuery(selectQuery);
                   String maxId = "1";
                   if (rs.next()) {
                        maxId = rs.getString(1);               
                   String selectMaxTagIDQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads WHERE tag_id = '" + tagId + "'" ;
                   stmt = myConn.createStatement();
                   rs = stmt.executeQuery(selectMaxTagIDQuery);
                   String maxTagId = "1";
                   if (rs.next()) {
                        maxTagId = rs.getString(1);               
                   long primaryKey = 1;
                   long tagKey = 1;
                   try {
                        primaryKey = Long.parseLong(maxId) + 1;
                        tagKey = Long.parseLong(maxTagId) + 1;
                   } catch (Exception e) {
                   long currentTime = System.currentTimeMillis();
                   long updateKey = (tagKey - 1);
                   String updateQuery = " UPDATE cus.rfid_raw_reads SET read_end_time = " + currentTime + " WHERE rfid_raw_reads_id = " + updateKey;
                   Statement updateStmt = myConn.createStatement();
                   updateStmt.execute(updateQuery);     
                   String query =
                        "INSERT INTO cus.rfid_raw_reads (rfid_raw_reads_id, tag_id,device_name,read_start_time) VALUES ("+ primaryKey + ",'" + tagId + "'," + deviceName + "'," + System.currentTimeMillis() + " )" ;
                   Statement insertStmt = myConn.createStatement();
                   insertStmt.execute(query);     
                   myConn.commit();
                   myConn.close();
              } catch (Exception e) {
    %>
    <p>For browser debug:
    <%
    out.println( "Type="+type+" ID="+tagId +" time="+timeStr );
    %>
    Kindly suggest where is the problem...
    Thanks and regards
    Mohammad Nasim Akhtar

    HI Prabhat,
    Thanx for your reply, I worked out and able to receive the data in oracle database, Actually there was some problem in insert Query. Now I have tested the same... and able to edit the same in the Database.....
    But I am facing a new problem, Http Dispatcher in SES console is displaying all the Events generated as well as event in Que but there is no events in the Event Send. I guess it is not able to send the events.....?????
    Event statical is showing like this
    Events Received: 0 (0.00/sec)
    Events Generated: 311 (0.19/sec)
    Events Sent: 2 (0.19/sec)
    Queued Events: 309 (0.19/sec)
    Kindly suggest where is the problem, Is it a JSP problem or OSES end problem.....
    Thanks and regards
    Nasim

  • Unable to get the data from the stored procedure

    Hello Folks,
    I have this stored procedure and am trying to get the data from the table stage_bill but for some reason i am not sure its not pulling the data.Am a beginner in pl/sql Can any one please help to find out. I can give the code below.
    create or replace procedure Load_FADM_Staging_Area_TEST(p_data_load_date date) is
    -- local variables
    v_start_date                date;
    v_end_date                  date;
    -- cursor starting
      CURSOR c_get_data
      IS
      SELECT
       a.batch_id 
    ,a.beginning_service_date 
    ,a.bill_id 
    ,a.bill_method 
    ,a.bill_number 
    ,a.bill_received_date 
    ,a.bill_status 
    ,a.bill_type 
    ,a.change_oltp_by 
    ,a.change_oltp_date 
    ,a.client_datafeed_code 
    ,a.client_id 
    ,a.created_date 
    ,a.date_of_incident 
    ,a.date_paid 
    ,a.deleted_oltp_by 
    ,a.deleted_oltp_date 
    ,a.duplicate_bill 
    ,a.ending_service_date 
    ,a.event_case_id 
    ,a.event_id 
    ,a.from_oltp_by 
    ,a.oltp_bill_status 
    ,a.review_status 
    ,'HRI' schema_name
    , sysdate Load_date
    ,'ETLPROCESS001' Load_user
    ,v_start_date as Row_Effective_Date
    ,null Row_End_date
    from stage_bill a
    where
    --created_date >= to_date('20101031 235959', 'YYYYMMDD HH24MISS')
    created_date >= v_start_date
    and
    --created_date <= to_date('20101111 235959', 'YYYYMMDD HH24MISS')
      created_date <= v_end_date
    and not exists
    (select
    b.batch_id 
    ,b.beginning_service_date 
    ,b.bill_id 
    ,b.bill_method 
    ,b.bill_number 
    ,b.bill_received_date 
    ,b.bill_status 
    ,b.bill_type 
    ,b.change_oltp_by 
    ,b.change_oltp_date 
    ,b.client_datafeed_code 
    ,b.client_id 
    ,b.created_date 
    ,b.date_of_incident 
    ,b.date_paid 
    ,b.deleted_oltp_by 
    ,b.deleted_oltp_date 
    ,b.duplicate_bill 
    ,b.ending_service_date 
    ,b.event_case_id 
    ,b.event_id 
    ,b.from_oltp_by 
    ,b.oltp_bill_status 
    ,b.review_status,
    b.schema_name,
    b.Load_date,
    b.Load_user,
    b.Row_Effective_Date,
    b.Row_End_Date
    from STG_FADM_HRI_STAGE_BILL_TEST b)
      -- cursor o/p variables
    v_batch_id                  stage_bill.batch_id%TYPE;
    v_beginning_service_date    stage_bill.beginning_service_date%TYPE;
    v_bill_id                   stage_bill.bill_id%TYPE;
    v_bill_method               stage_bill.bill_method%TYPE;
    v_bill_number               stage_bill.bill_number%TYPE;
    v_bill_received_date        stage_bill.bill_received_date%TYPE;
    v_bill_status               stage_bill.bill_status%TYPE;
    v_bill_type                 stage_bill.bill_type%TYPE;
      v_change_oltp_by            stage_bill.change_oltp_by%TYPE;
      v_change_oltp_date          stage_bill.change_oltp_date%TYPE;
      v_client_datafeed_code      stage_bill.client_datafeed_code%TYPE;
      v_client_id               stage_bill.client_id%TYPE;
      v_created_date          stage_bill.created_date%TYPE;
      v_date_of_incident    stage_bill.date_of_incident%TYPE;
      v_date_paid         stage_bill.date_paid%TYPE;
      v_deleted_oltp_by     stage_bill.deleted_oltp_by%TYPE;
      v_deleted_oltp_date    stage_bill.deleted_oltp_date%TYPE;
      v_duplicate_bill     stage_bill.duplicate_bill%TYPE;
      v_ending_service_date   stage_bill.ending_service_date%TYPE;
      v_event_case_id        stage_bill.event_case_id%TYPE;
      v_event_id            stage_bill.event_id%TYPE;
      v_from_oltp_by         stage_bill.from_oltp_by%TYPE;
      v_oltp_bill_status   stage_bill.oltp_bill_status%TYPE;
      v_review_status     stage_bill.review_status%TYPE;   
      v_schema_name        varchar(50);
      v_Load_date          date;
      v_Load_user            varchar(50);
      v_Row_Effective_Date   date;
      v_Row_End_Date         date;     
    Begin
    if  p_data_load_date is null then
        select (sysdate - 7), (sysdate - 1) into v_start_date, v_end_date from dual;
      elsif p_data_load_date is not null then
       select (p_data_load_date - 7), (p_data_load_date - 1) into v_start_date, v_end_date from dual;
      else
        raise_application_error('-20042', 'Data control - GetDataControlAuditData : Date parameter must be a date of this or a previous week.');
      end if;
    -- cursor c_get_data loop begin
    OPEN c_get_data;
        LOOP                                                       -- cursor c_get_data loop begin
          FETCH c_get_data
           INTO
            v_batch_id,
      v_beginning_service_date,
      v_bill_id ,
      v_bill_method ,
      v_bill_number,
      v_bill_received_date,
      v_bill_status,
      v_bill_type,
      v_change_oltp_by,
      v_change_oltp_date,
      v_client_datafeed_code,
      v_client_id,
      v_created_date,
      v_date_of_incident,
      v_date_paid,
      v_deleted_oltp_by,
      v_deleted_oltp_date,
      v_duplicate_bill,
      v_ending_service_date ,
      v_event_case_id ,
      v_event_id,
      v_from_oltp_by,
      v_oltp_bill_status,
      v_review_status,   
      v_schema_name,
       v_Load_date,
       v_Load_user,
       V_Row_Effective_Date,   
       v_Row_End_Date;
        EXIT WHEN c_get_data%NOTFOUND;
    insert into STG_FADM_HRI_STAGE_BILL_TEST
    batch_id 
    ,beginning_service_date 
    ,bill_id 
    ,bill_method 
    ,bill_number 
    ,bill_received_date 
    ,bill_status 
    ,bill_type 
    ,change_oltp_by 
    ,change_oltp_date 
    ,client_datafeed_code 
    ,client_id 
    ,created_date 
    ,date_of_incident 
    ,date_paid 
    ,deleted_oltp_by 
    ,deleted_oltp_date 
    ,duplicate_bill 
    ,ending_service_date 
    ,event_case_id 
    ,event_id 
    ,from_oltp_by 
    ,oltp_bill_status 
    ,review_status 
    ,schema_name
    ,Load_date
    ,Load_user
    ,Row_Effective_Date
    ,Row_End_Date
    values(
           v_batch_id,
    v_beginning_service_date,
    v_bill_id ,
    v_bill_method ,
    v_bill_number,
    v_bill_received_date,
    v_bill_status,
    v_bill_type,
    v_change_oltp_by,
    v_change_oltp_date,
    v_client_datafeed_code,
    v_client_id,
    v_created_date,
    v_date_of_incident,
    v_date_paid,
    v_deleted_oltp_by,
    v_deleted_oltp_date,
    v_duplicate_bill,
    v_ending_service_date ,
    v_event_case_id ,
    v_event_id,
    v_from_oltp_by,
    v_oltp_bill_status,
    v_review_status,   
    v_schema_name,
    v_Load_date,
    v_Load_user,
    v_Row_Effective_Date,   
    v_Row_End_Date ) ;
      COMMIT;
        END LOOP;                                                 
        CLOSE c_get_data; 

    Maybe you need something else, like
    CREATE OR REPLACE PROCEDURE load_fadm_staging_area_test (
      p_data_load_date DATE
    ) IS
      v_start_date   DATE;
      v_end_date     DATE;
    BEGIN
      SELECT NVL (p_data_load_date, SYSDATE) - 7,
             NVL (p_data_load_date, SYSDATE) - 1
      INTO   v_start_date,
             v_end_date
      FROM   DUAL;
      MERGE INTO stg_fadm_hri_stage_bill_test b
      USING      (SELECT *
                  FROM   stage_bill
                  WHERE  created_date BETWEEN v_start_date AND v_end_date) a
      ON         (b.bill_id = a.billl_id)
      WHEN NOT MATCHED THEN
        INSERT     (batch_id,
                    beginning_service_date,
                    bill_id,
                    bill_method,
                    bill_number,
                    bill_received_date,
                    bill_status,
                    bill_type,
                    change_oltp_by,
                    change_oltp_date,
                    client_datafeed_code,
                    client_id,
                    created_date,
                    date_of_incident,
                    date_paid,
                    deleted_oltp_by,
                    deleted_oltp_date,
                    duplicate_bill,
                    ending_service_date,
                    event_case_id,
                    event_id,
                    from_oltp_by,
                    oltp_bill_status,
                    review_status,
                    schema_name,
                    load_date,
                    load_user,
                    row_effective_date,
                    row_end_date
        VALUES     (a.batch_id,
                    a.beginning_service_date,
                    a.bill_id,
                    a.bill_method,
                    a.bill_number,
                    a.bill_received_date,
                    a.bill_status,
                    a.bill_type,
                    a.change_oltp_by,
                    a.change_oltp_date,
                    a.client_datafeed_code,
                    a.client_id,
                    a.created_date,
                    a.date_of_incident,
                    a.date_paid,
                    a.deleted_oltp_by,
                    a.deleted_oltp_date,
                    a.duplicate_bill,
                    a.ending_service_date,
                    a.event_case_id,
                    a.event_id,
                    a.from_oltp_by,
                    a.oltp_bill_status,
                    a.review_status,
                    'HRI',
                    SYSDATE,
                    'ETLPROCESS001',
                    v_start_date,
                    NULL
    END load_fadm_staging_area_test;Whenever you code a cursor and a loop, ask yourself. Do I need that?
    Regards
    Peter

  • How can I get updated data in sub VI in real time?

    Hello.
    I'm making application using Labview 7.0.
    What I want to do is the data acquisition changing some parameters. I get the data each time
    I changed variable parameters. I can do it in sub VI by inserting array component into 'for' loop.
    As loop iterates, the parameter sets are changed, and new data is inserted into array by 'replace subset array'.
    New data fills the array by each iteration.
    However, I can't bring this result array to my main.vi. Sub VI gives me the result array only when
    its processes are done. I want to display the data while parameters changing is still on
    the way.
    Are there any solution to get the output of sub VI while the it is not finished yet?

    Hi Joewun:
    Yes, you can update that data in real time.
    It's done using references and property nodes.
    You can Create Reference of an array in your main VI
    In your SubVI, create a new Input to an array reference, and insert a Property Node function into the For where you update the value, and select Value property.
    This way when your array updates in the SubVI you will see the changes in your main VI.
    Attatched Image:
    Left: Main VI
    Right SubVI.
    Aitortxo.
    Attachments:
    Update Array Data from SubVI.png ‏54 KB

  • Get current date in mm/dd/yyyy format

    Need to get todays date in the format mm/dd/yyyy and store it in a database by using JDBC API ..how to convert Date given by Date() to the format mmdd/yyyy .The column type of the table whr date has to be inserted is of Type Date/Time (Microsoft Access)..
    Plz help me out ..plzzz..

    public static byte TIME_ONLY = 1;
    public static byte DATE_ONLY = 2;
    public static byte DATE_ALL = 3;
    public static String getCurrentDateTime(byte format, String dateFormatPattern) {
         String[] stringArray;
            String sDate;
         Date today;
         SimpleDateFormat formatter;
         formatter = new SimpleDateFormat(dateFormatPattern);
         today = new Date();
         sDate = formatter.format(today);
         if (format != DATE_ALL) {
              stringArray = sDate.split(" ");
              if (format == DATE_ONLY) {
                   sDate = stringArray[0].trim();
              } else {
                   sDate = stringArray[1].trim();
            return sDate;
    }

  • How to Get Missing Dates for Each Support Ticket In My Query?

    Hello -
    I'm really baffled as to how to get missing dates for each support ticket in my query.  I did a search for this and found several CTE's however they only provide ways to find missing dates in a date table rather than missing dates for another column
    in a table.  Let me explain a bit further here -
    I have a query which has a list of support tickets for the month of January.  Each support ticket is supposed to be updated daily by a support rep, however that isn't happening so the business wants to know for each ticket which dates have NOT been
    updated.  So, for example, I might have support ticket 44BS which was updated on 2014-01-01, 2014-01-05, 2014-01-07.  Each time the ticket is updated a new row is inserted into the table.  I need a query which will return the missing dates per
    each support ticket.
    I should also add that I DO NOT have any sort of admin nor write permissions to the database...none at all.  My team has tried and they won't give 'em.   So proposing a function or storable solution will not work.  I'm stuck with doing everything
    in a query.
    I'll try and provide some sample data as an example -
    CREATE TABLE #Tickets
    TicketNo VARCHAR(4)
    ,DateUpdated DATE
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-01')
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-05')
    INSERT INTO #Tickets VALUES ('44BS', '2014-01-07')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-03')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-09')
    INSERT INTO #Tickets VALUES ('32VT', '2014-01-11')
    So for ticket 44BS, I need to return the missing dates between January 1st and January 5th, again between January 5th and January 7th.  A set-based solution would be best.
    I'm sure this is easier than i'm making it.  However, after playing around for a couple of hours my head hurts and I need sleep.  If anyone can help, you'd be a job-saver :)
    Thanks!!

    CREATE TABLE #Tickets (
    TicketNo VARCHAR(4)
    ,DateUpdated DATETIME
    GO
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-01'
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-05'
    INSERT INTO #Tickets
    VALUES (
    '44BS'
    ,'2014-01-07'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-03'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-09'
    INSERT INTO #Tickets
    VALUES (
    '32VT'
    ,'2014-01-11'
    GO
    GO
    SELECT *
    FROM #Tickets
    GO
    GO
    CREATE TABLE #tempDist (
    NRow INT
    ,TicketNo VARCHAR(4)
    ,MinDate DATETIME
    ,MaxDate DATETIME
    GO
    CREATE TABLE #tempUnUserdDate (
    TicketNo VARCHAR(4)
    ,MissDate DATETIME
    GO
    INSERT INTO #tempDist
    SELECT Row_Number() OVER (
    ORDER BY TicketNo
    ) AS NROw
    ,TicketNo
    ,Min(DateUpdated) AS MinDate
    ,MAx(DateUpdated) AS MaxDate
    FROM #Tickets
    GROUP BY TicketNo
    SELECT *
    FROM #tempDist
    GO
    -- Get the number of rows in the looping table
    DECLARE @RowCount INT
    SET @RowCount = (
    SELECT COUNT(TicketNo)
    FROM #tempDist
    -- Declare an iterator
    DECLARE @I INT
    -- Initialize the iterator
    SET @I = 1
    -- Loop through the rows of a table @myTable
    WHILE (@I <= @RowCount)
    BEGIN
    --  Declare variables to hold the data which we get after looping each record
    DECLARE @MyDate DATETIME
    DECLARE @TicketNo VARCHAR(50)
    ,@MinDate DATETIME
    ,@MaxDate DATETIME
    -- Get the data from table and set to variables
    SELECT @TicketNo = TicketNo
    ,@MinDate = MinDate
    ,@MaxDate = MaxDate
    FROM #tempDist
    WHERE NRow = @I
    SET @MyDate = @MinDate
    WHILE @MaxDate > @MyDate
    BEGIN
    IF NOT EXISTS (
    SELECT *
    FROM #Tickets
    WHERE TicketNo = @TicketNo
    AND DateUpdated = @MyDate
    BEGIN
    INSERT INTO #tempUnUserdDate
    VALUES (
    @TicketNo
    ,@MyDate
    END
    SET @MyDate = dateadd(d, 1, @MyDate)
    END
    SET @I = @I + 1
    END
    GO
    SELECT *
    FROM #tempUnUserdDate
    GO
    GO
    DROP TABLE #tickets
    GO
    DROP TABLE #tempDist
    GO
    DROP TABLE #tempUnUserdDate
    Thanks, 
    Shridhar J Joshi 
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

Maybe you are looking for

  • Application not working with MS ACCESS DB at runtime

    I have problem with my application that working properly at runtime( via visual studio ) and update data grid of windows form .net . But after publish the application and run this then , I am getting following error as shown in image. Please help me

  • I can't see my library in iTunes for WindowsXP

    For quite a while now (over 3 months) I've been unable to get iTunes to see my library of ripped audio tracks. I tell it they're on D:\music but it won't list them. I can't find the setting to bring them back in. It displayed them fine when I first i

  • [SOLVED]amdcccle won't start

    Hi all, before I explain my problem, I have spent the last 6 hours searching google and these forums for the answer, so I apologize if I have missed the solution somewhere. Its 1:38pm here in Australia, and since I woke up today I have been trying to

  • Human Task in jDeveloper 11g users list not available

    I have the problem, I defined SQL authenticator in wenlogic, and I want to do assignment at human task. But, human task only see jazn users, alhough I see the users defined in db at weblogic console Caused By: ORABPEL-10509 User not found. User "bpmu

  • A.out apps on Solaris 8

    I'm doing some development work on the kernel, and was curious to know if anybody knows of any old a.out apps that are currently being run on Solaris 8 boxes. I need to know in order to decide if it's worth the effort to support a.out, or if it's suc