Initial value and value in the database

Hello world ,
i want to add initial value with value in the database depend on the date
for example i have initial value for 30/09/2009
i and to all it with value in the database in 31/12/2009
take a look what i did
PROCEDURE pkd_prem IS
cursor gr_pkd_prem is select
SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
SUM(DECODE(FMS,'01',LS,NS) b
from fr_treaty_profile ftp, fr_monthly_summary
where
(ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
AND (ftp.tpr_class = fr_monthly_summary.fms_class )
AND (ftp.tpr_type = fr_monthly_summary.fms_type )
AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
AND
(fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
(fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
(fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
(fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
AND (FMS_TYPE ='P')
AND FMS_SERIAL = '01'
AND (FMS_OFC_ID !='X')
and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
---Initial value
cursor base is select EO_GR_BKD_PREM from FR_EN
where
EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
EO_CLASS=:BLK1.EO_CLASS AND
EO_TREATY_TYPE=:BLK1.EO_TYPE AND
EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
EO_YEAR=:BLK1.EO_YEAR;
A number(18,3);
B number(18,3);
v_base number(18,3);
BEGIN
open base;
open gr_pkd_prem;
fetch gr_pkd_prem into a,b;
fetch base into v_base;
:BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
close gr_pkd_prem;
close base;
END;
the proceudre is correct and the values come as i want
but here
FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
suppose i will add from 6 to 9
the value will come down to add with base value
but next time i want from 10 to 12
it will add value 10 to 12 with the base for just period 10 to 12
i want to keep adding
if i start from 6 to 9
then shoud be
add the value of 6 to 9 to 10 to 12
but

look ..
i created a form and let's say there is one field called Base ..
and i inert value on that field and saved .
then
i created cursor to fetch value from another table
that value which i fetched from another table must add to past value
take this scenario
i started with value 6
then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
first action
6+33
then
i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
the result of first action must add with the last value which is 2
(6+33) from first action plus(+) 2 and display the result on the secreen

Similar Messages

  • How to insert the Formatted date value and insert into the database

    Hi All,
    I am having requirement of inserting the date value in to the datbase. I'm already getting the value from file as MM-DD-YYYY. Getting exception while transforming the values through the transform activity. I'm using format fate function but it is inserting null value in to the database.
    Any help from anyone would bve appreciated.
    Thanks,
    CH

    Hi,
    your input date format is fixed right? So, in the transform you can split each your date, which is in 'MM-DD-YYYY' format ... extract day, month, year.
    After that ... just put these values in order acording to the format of 'xsd:date' data type which is '[-]CCYY-MM-DDZ'.
    XPath function 'xp20:format-dateTime()' works only with 'xsd:dateTime' data type, which has format '[-]CCYY-MM-DDThh:mm:ssZ'.
    So, in your case it could be:
    <xsl:variable name="day" select="substring($inputDate,4,2)"/>
    <xsl:variable name="month" select="substring($inputDate,1,2)"/>
    <xsl:variable name="day" select="substring($inputDate,7,4)"/>
    <xsl:variable name="outputDate">
    <xsl:value-of select="$year"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$month"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$day"/>
    </xsl:variable>
    Regards,
    Martin.

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • Error in fetching the data from textfield and inserting to the database..

    I'm using Java Swing as front end and MySQL as backend using the netbeans ide..I am trying to fetch the data from the textfiled in the form and insert to the database table.i've skipped the generated code..In the following code i get the erro cannot find symbol "stmt" in the actionPerformed method..
    mport java.awt.event.*;
    import java.sql.*;
    public class BarcodeReader extends JFrame implements ActionListener {
    public BarcodeReader() {
    initComponents();
    nb.addActionListener(this);
    public void jdbcConnect(){
    Connection con=null;
    String url = "jdbc:mysql://localhost:3306/";
    String db = "mynewdatabase";
    String driver = "com.mysql.jdbc.Driver";
    String user = "usrname";
    String pass = "pwd";
    try{
    String s=newtxt.getText();
    con=DriverManager.getConnection(url + db, user, pass);
    Statement stmt=con.createStatement();
    Class.forName(driver);
    public void actionPerformed(ActionEvent e){
    try{
    jdbcConnect();
    stmt.executeUpdate("INSERT into machine(mname) values '"+jTextField1.getText()+"'");
    }}catch (Exception ex) {
    System.out.println(ex);
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new BarcodeReader().setVisible(true);
    }

    There are far too many errors to try and clear.
    For one, the exception references the actionPerformed method (according to your text), so why is that not shown here?
    For another you are performing, possible time-consuming, actions, and even worse IO actions, on the event thread, which is a huge no-no.
    You are not closeing your resources properly, if at all, which is another huge no-no.
    You are completely mixing your "view" (the gui), and your "model" (the data related classes), which is another huge no-no.
    etc, etc, etc.

  • Limiting entry in a JTextField to numeric value and "%" value

    Hi,
    I want to allow the user to enter numeric value and % value
    How can I limit the user to make such a entry in JTextField

    Use the code given below to make your textfield accept only numeric values. You can modify itto include % values too.
    textField.setDocument( new TextFieldVerifier() );     
    class TextFieldVerifier extends PlainDocument {
    public void insertString( int offset, String str, AttributeSet attSet ) throws BadLocationException {           
    boolean valid = false;          
    if ( str == null ) {
    return;
    String old = getText( 0, getLength() );
    /* insert the new string at the given offset, into the old string */     
    String newStr = old.substring( 0, offset ) + str + old.substring( offset );
    try {
    /* check if the new string is a valid integer */
    Integer.parseInt( newStr );               
    valid = true;
    } catch ( NumberFormatException ne ) {          
    /* invalid, if not an integer */
    valid = false;
    Toolkit.getDefaultToolkit().beep();           
    if ( valid ) {
    super.insertString( offset, str, attSet );
    }

  • Where we use Conversions? like Fixed Value and Value mapping? and use of th

    where we use Conversions? like Fixed Value and Value mapping?
    and what is the use of that....

    Hi
    Have a Look at this
    /people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
    Value mapping is used to map different representations of an object to each other.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    You can do value mapping both in IR and ID
    IR: Message Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    ID: Tools --> Value Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/content.htm
    Value mapping replication: For uploading data from tables, excel sheet etc. into XI
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
    Value mapping
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Thanks

  • Where we use Conversions like Fixed Value and Value mapping?

    where we use Conversions? like Fixed Value and Value mapping?

    Mostly say when u have a scenario like converting a value in the source to a another in
    target. Say in source it might me KM but in target u might need Kilometers and u hav multiple entries like this.
    Ref:
    http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
    https://www.sdn.sap.com/irj/sdn/xi-elearning

  • How to change the default password file's name and path when the database created?

    how to change the default password file's name and path when the database created?
    null

    Usage: orapwd file=<fname> password=<password> entries=<users>
    where
    file - name of password file (mand),
    password - password for SYS and INTERNAL (mand),
    entries - maximum number of distinct DBA and OPERs (opt),
    There are no spaces around the equal-to (=) character.

  • I moved from an old macbook to a new one.  I copied all my files onto a hard drive.  On trying to setup my mail, i went into documents, microsoft user identities, office 2011 and it shows the database but wont let me select it.  Urgent help pls

    I moved from an old macbook to a new one.  I have installed Office for Mac 2011. I copied all my files from my old notebook onto a hard drive.  On trying to setup my mail, i went into my hard drive and accessed microsoft user identities, office 2011 and it shows the database but wont let me select it.  Its almost as if the file is there but not accessable.  I desperately need to access my old mail.  How do I do this?  I am fairly confident that I copied all files off my old notebook.  Is there a way for me to search for the Database file?  Maybe I copied it to a different location?  Urgent help please.

    Hello mafrerichs and welcome to Apple Support Communities,
    Simplest way is to use Target Disk mode:
    How to use and troubleshoot FireWire target disk mode - Apple Support
    and hook to another Mac and use CCC or SuperDuper and clone your HD to another drive.
    You could also pull the drive out of your MBP and use an external USB case or SATA - USB dongle to hook it to another Mac.
    "MacBook Pro (15-inch Late 2011),... have a 15" 2012 Macbook pro with 2gb of ram, i7 processor"
    That's a little confusing?

  • 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.

  • Because when clicking in the in a button and to read the Database

    Because when clicking in the in a button and to read the Database
    is the checkbox false:?
      if (sociosDataProvider1.cursorFirst())
                   if (checkbox1.isChecked())
                        body1.setOnLoad("alert('Cadastro realizado com sucesso'); document.forms[0].elements[0].focus()");                       }
           while (sociosDataProvider1.cursorNext())
            if (checkbox1.isChecked())
                            body1.setOnLoad("alert('Cadastro realizado com sucesso'); document.forms[0].elements[0].focus()");               
      

    Do I need to read the column or the checkbox?
    Help, Help .. hehehehehe
    Please hehehehe

  • How I can change ipad mini mobile number I initially requested and to place the wrong number

    how I can change ipad mini mobile number I initially requested and to place the wrong number

    If you're refering to your uphone number thats set up to be used with imessage on your ipad, then that is associated with your apple id and has to be changed there first.
    My Apple ID
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Then on your ipad, sign out of messages. Go to settings/messages/tap on send and receive/tap on apple id/sign out
    Then sign out of messages on phone and then back in.
    Then sign into messages on ipad again, number should appear
    http://support.apple.com/kb/HT5538

  • How to get value and name of the n'th parameter in a pl/sql funct./proced.

    procedure test(name varchar2, birthdate date, zip number, country varchar2);
    in procedure x I do
    test('Michael Postmann', to_date('03.01.1983', 'DD.MM.YYYY'), 7461, 'AUSTRIA');
    And this should htp.print the following:
    test: name=Michael Postmann,birthdate=1983/01/03,zip=7461,country=AUSTRIA
    In procedure test I want to know:
    *) What is the name of myself (the procedure)
    *) Optionally: Am I a procedure or a function?
    *) How many Parameters do I have?
    *) What are the values of them?
    *) What are the names of them?
    *) Optionally: What are the types of them?
    What I actually want to do is:
    I have a procedure for logging errors. So in my program I call this function frequently and I want it to log the current time, a string passed to the logging function, the client's ip, etc.... but it should also log a list of the parametrs and values of the procedure/function where the error occoured.
    Is there any way to do this (I think in C this is done by argc and argv, but a string containing all the information (as you get it from the WebDb when something goes wrong) would be enough)?
    Thx in advance,
    Nomike aka Michael Postmann

    Name of procedure or function can be retrieved using DBMS_UTILITY.FORMAT_CALL_STACK:
    CREATE OR REPLACE FUNCTION fn_whoami (v_in varchar2)
    RETURN varchar2
    AS
    v_stack varchar2(1000) DEFAULT DBMS_UTILITY.FORMAT_CALL_STACK;
    v_job varchar2(500);
    v_name varchar2(100);
    BEGIN
    v_job := SUBSTR(v_stack,INSTR(v_stack,'function'),256);
    v_name := SUBSTR(v_job,1,INSTR(v_job,CHR(10))-1);
    return v_name;
    END fn_whoami;
    select fn_whoami('1') from dual;
    CREATE OR REPLACE PROCEDURE pr_whoami
    AS
    v_stack varchar2(1000) DEFAULT DBMS_UTILITY.FORMAT_CALL_STACK;
    v_job varchar2(500);
    v_name varchar2(100);
    BEGIN
    v_job := SUBSTR(v_stack,INSTR(v_stack,'procedure'),256);
    v_name := SUBSTR(v_job,1,INSTR(v_job,CHR(10))-1);
    dbms_output.put_line(v_name);
    END pr_whoami;
    exec pr_whoami;

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • No net value and quantity in the DSO

    Hi Gurus,
    I would like to ask questions related to SRM Data sources. In the SRM data source 0BBP_TD_SC_1 related to shopping carts, we have the concept of GUID.
    Here for main SC number there is a GUID, but for item level there is a different GUID. While uploading the data into DSO what is happening is that the net value and quantity value is coming as zero, since it is picking value from SC GUID which has the SC qty and Value as zero instead of Item GUID which actually has this data....
    I am not sure whether anyone has faced this issue and how it can resolved. I have already in rule details of transformation made the Summation as the criteria..
    Thanks and Regards
    Abhi

    You must be moving somewhere in between a character type 1,000.00 to a numeric type variable and hence the error because of the ','. Check this.

Maybe you are looking for

  • Downloaded a trial Light room and got "An error occurred when attempting to change modules." Macinto

    Downloaded a trial Lightroom and got "An error occurred when attempting to change modules." Macintosh. Created another user and it works. WIll this happen if I make a full purchase? I want to use my administrator user.

  • PPRoHeadless has encountered an error on Media Encoder

    When I try to export media using Media Encoder CS6, I keep getting this error about half way through.  However I am able to export the same video directly from Premiere without any issues.  Each time encoder errors out I was not able to close encoder

  • I need information about how to build a XSS file, please.

    Hi, I want to create a XSS file for defining the styles of my application, but I have not been able to find information about the properties names and properties possible values of the style elements of the XSS file. For example, where is said that t

  • To add a process name in ABAP code

    hi experts, I have a requirement where my code is sending only  "unsuccessfull" message on a process failure. Now i need to add a name also in the mail. I m using a ABAP code to send the mail. Can u suGgest a way to do so? thanks.

  • Problem: loading SQL Server 'image' data

    Source database: SQL Server 2000 OS: Windows 2003 (SP1) Oracle: 10g (R2) Datatype Mapping: SQL Server 'image' to oracle 'BLOB' With the help of OMWB, I created the oracle database schema for a SQL Server DB (offline capture). I have problems when I t