Looping recorded data (project specific)

Hi everyone,
I've recently got logic studio and absolutely loving it - it's great.
I've got this project that I started quite recently and whenever I record in it (be it audio or MIDI) as soon as you hit the space bar to stop recording your region gets infinitely looped to the end marker (as it would if you dragged the top right corner). There is nothing destructive about this it's just a pain and it's not what I got the software to do! The weirdest thing about it is that it only does it in this project, and closing and reopening doesn't work. Anyone know of something project specific like a setting that I could have changed which would cause this, it's extremely irritating!
Alex
(Logic Pro 8 - v 8.0.2)

Sounds strange. Could you maybe upload the session and link to it so that I or someone else could have a look and see if there's something you're doing wrong?
It's hard to say what you should look at. It could also be simply a corrupted session...

Similar Messages

  • How can I do a multiple record data merge, but specify that a specific text frame with variable data only merges on the first record?

    I'm doing a multiple record data merge, I have 2 frames both with variable data placed inside.
    I would like to specify that one of the text frames only merges once(first record) and the other frame multiple times for each record in the data file.
    Is it possible?
    I thought that perhaps if I place the text frame that must merge once on the master page, it would work.  But you are not allowed to place variable text on the master and on the document page.
    I'm going to try it through scripting next, but thought that perhaps there is an easier way that I'm not aware of.
    Thanks,
    Suzanne

    Suzanne,
    If you were trying to post a screen shot, you would need to return to the forum and post it using the "camera" icon at the top of the post editing windows.
    I use a plug-in from Em Software called InData. One of the benefits for what I do is there are no individual frames on a page to deal with post-merge. Individual frames are great for simple merges (address labels, post cards, etc.). But I typically do more other types of merges.
    That said, there is a drawback--one needs to come to an understanding of writing expressions that actually parse the incoming data. So in the spice price list example, that looks like:
    It's reasonably easy once one does it a few times. And it can be far more complicated. The above is from Em Software's samples that has been tweaked. The best thing I can recommend would be to download the trial and see for yourself. They are good at responding to specific questions if you get stumped.
    I imagine this all could be scripted somehow in ID. But I have no idea how and the plug-in just lets me keep working.
    Mike

  • How to assign project specific task with the newly created projects ?

    Hi All,
    I need help. I need to assign project specific tasks (which i will be taking from staging table) other than the default task which are assigned during project creation. How do I proceed with this within same package. I am attaching the code of my package below...
    CREATE OR REPLACE PACKAGE body xxpa_proj_conv_pkg as
    PROCEDURE xxpa_create_project_proc(O_ERRBUF OUT VARCHAR2,O_RETCODE OUT VARCHAR2)
    is
    variables need to derive global parameters
    v_responsibility_id NUMBER; --- PA Supervisor responsibility id
    v_user_id NUMBER;
    deriving global parameters-
    -- Variables needed for API standard parameters
    v_api_version_number NUMBER := 1.0;
    v_commit VARCHAR2(1) := 'F';
    v_return_status VARCHAR2(1);
    v_init_msg_list VARCHAR2(1) := 'F';
    v_msg_count NUMBER;
    v_msg_index_out NUMBER;
    v_msg_data VARCHAR2(2000);
    v_data VARCHAR2(2000);
    v_workflow_started VARCHAR2(1) := 'Y';
    v_pm_product_code VARCHAR2(10);
    ---variables for catching errors---
    v_error_flag number:=0;
    -- Predefined Composite data types
    v_project_in PA_PROJECT_PUB.PROJECT_IN_REC_TYPE;
    v_project_out PA_PROJECT_PUB.PROJECT_OUT_REC_TYPE;
    v_key_members PA_PROJECT_PUB.PROJECT_ROLE_TBL_TYPE;
    v_class_categories PA_PROJECT_PUB.CLASS_CATEGORY_TBL_TYPE;
    v_tasks_in_rec PA_PROJECT_PUB.TASK_IN_REC_TYPE;
    v_tasks_in PA_PROJECT_PUB.TASK_IN_TBL_TYPE;
    v_tasks_out_rec PA_PROJECT_PUB.TASK_OUT_REC_TYPE;
    v_tasks_out PA_PROJECT_PUB.TASK_OUT_TBL_TYPE;
    v_CREATED_FROM_PROJECT_ID varchar2(20);
    v_CARRYING_OUT_ORGANIZATION_ID varchar2(20);
    v_person_id NUMBER;
    v_project_role_type VARCHAR2(20);
    API_ERROR EXCEPTION;
    v_a NUMBER;
    cursor for project in data
    CURSOR cur_project_in_data IS SELECT * FROM XXPA_PROJECT_IN_STG;
    cursor for task data
    CURSOR cur_task_in_data IS SELECT * FROM XXPA_TASK_IN_STG;
    ------------------------Cursors used for validations----------------------------------
    cursor for product code used for validation
    cursor cprc is select distinct PROJECT_RELATIONSHIP_CODE from PA_PROJECT_CUSTOMERS;
    cursor for distribution rule-
    cursor cdr is select DISTRIBUTION_RULE from PA_DISTRIBUTION_RULES;
    cursor for project status code
    cursor cpsc is SELECT PROJECT_STATUS_CODE, PROJECT_STATUS_NAME FROM PA_PROJECT_STATUSES WHERE STATUS_TYPE = 'PROJECT';
    cursor for template/created from project id
    cursor ccpid is select project_id from pa_projects where template_flag='Y';
    BEGIN
    select user_id, responsibility_id into v_user_id, v_responsibility_id
    from PA_USER_RESP_V
    where user_name like 'amit_kumar%'
    and responsibility_name like'PA SupervisorS';
    -- --Fnd_global.apps_initialize(user_id,resp_id, resp_appl_id);
    -- Fnd_global.apps_initialize(v_user_id,v_responsibility_id,275);
    -- -------calling global parameters---
    pa_interface_utils_pub.set_global_info
    p_api_version_number =>v_api_version_number,
    p_responsibility_id =>v_responsibility_id,
    p_user_id =>v_user_id,
    p_msg_count =>v_msg_count,
    p_msg_data =>v_msg_data,
    p_return_status =>v_return_status
    dbms_output.put_line ('Set Global status ->' || v_return_status);
    ----Cursor for PRODUCT RELATED DATA-----------
    FOR REC IN cur_project_in_data LOOP
    -----PASSING VALUES TO THE COMPOSITE DATA TYPE(PROJECT_IN_REC_TYPE)-------
    ----retrieving product code-----
    select lookup_code into v_pm_product_code
    from pa_lookups
    where lookup_type = 'PM_PRODUCT_CODE'
    and meaning = 'Oracle Project Manufacturing';
    -----retrieving and validating created from project id----
    BEGIN
    select project_id
    into v_CREATED_FROM_PROJECT_ID
    from pa_projects_all
    where name=rec.created_from_project_name;
    EXCEPTION
    when others then
    O_Retcode := '1';
    O_Errbuf :='Incorrent CREATED_FROM_PROJECT_NAME';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where created_from_project_name = rec.CREATED_FROM_PROJECT_NAME;
    END;
    -----retrieving & validating carrying out organization id-----
    BEGIN
    select distinct(CARRYING_OUT_ORGANIZATION_ID)
    into v_CARRYING_OUT_ORGANIZATION_ID
    from pa_projects_prm_v
    where CARRYING_OUT_ORGANIZATION_NAME=rec.carrying_out_organization_name;
    EXCEPTION
    when others then
    O_Retcode := '1';
    O_Errbuf :='Incorrent Carrying Out Organization name';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where carrying_out_organization_name = rec.carrying_out_organization_name;
    END ;
    v_project_in.pm_project_reference := rec.segment1;
    v_project_in.project_name := rec.PROJECT_NAME;
    v_project_in.created_from_project_id := v_CREATED_FROM_PROJECT_ID;
    v_project_in.carrying_out_organization_id := v_CARRYING_OUT_ORGANIZATION_ID;
    v_project_in.project_status_code := rec.PROJECT_STATUS_CODE;
    v_project_in.description := rec.PROJECT_DESCRIPTION;
    v_project_in.start_date := rec.PROJECT_START_DATE;
    v_project_in.completion_date := rec.PROJECT_COMPLETION_DATE;
    v_project_in.distribution_rule := rec.DISTRIBUTION_RULE;
    v_project_in.project_relationship_code := rec.PROJECT_RELATIONSHIP_CODE;
    -------------------------Validation of incoming project data--------------------------------
    v_error_flag := 1;
    project relationship code validation
    BEGIN
    for prc in cprc
    loop
    if (rec.PROJECT_RELATIONSHIP_CODE=prc.PROJECT_RELATIONSHIP_CODE) or (rec.PROJECT_RELATIONSHIP_CODE is null)--can be overridden from template
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    project distribution rule validation
    BEGIN
    for dr in cdr
    loop
    if (rec.DISTRIBUTION_RULE=dr.DISTRIBUTION_RULE) or (rec.DISTRIBUTION_RULE is null) null since the value can be taken from template too
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    project status code validation
    BEGIN
    for sc in cpsc
    loop
    if (rec.PROJECT_STATUS_CODE=sc.PROJECT_STATUS_CODE) or (rec.PROJECT_STATUS_CODE is null) null since the value can be taken from template too
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    dbms_output.put_line ('Error at PROJECT_STATUS_CODE>' ||v_error_flag);
    validation logic for project start date
    BEGIN
    if TRUNC(rec.PROJECT_START_DATE) >= TRUNC(rec.PROJECT_COMPLETION_DATE)
    THEN
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='Project start date cannnot be greater than completion date';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    END IF;
    END;
    validation logic for project completion date
    BEGIN
    if (TRUNC(rec.PROJECT_COMPLETION_DATE)<=TRUNC(rec.PROJECT_START_DATE))
    then
    if ( rec.PROJECT_STATUS_CODE='CLOSED' and rec.PROJECT_COMPLETION_DATE>sysdate)
    THEN
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='completion date cannot be greater than sysdate for closed projects';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    END IF;
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='Project closed date cannot be less than start date';
    end if;
    END;
    --------Update staging table for the error records--------
    BEGIN
    if v_error_flag =1
    then
    O_Retcode := '1';
    O_Errbuf :='Incorrect project relationship code';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where PROJECT_RELATIONSHIP_CODE = rec.PROJECT_RELATIONSHIP_CODE;
    end if;
    END;
    -----------------------End of validation of incoming project data----------------------------------
    ---------------Project Task DATA-----------------
    v_a:=0;
    FOR tsk IN cur_task_in_data LOOP
    v_tasks_in_rec.pm_task_reference :=tsk.task_reference ;
    v_tasks_in_rec.task_name :=tsk.task_name;
    v_tasks_in_rec.pm_parent_task_reference :=tsk.parent_task_reference ;
    v_tasks_in_rec.task_start_date :=tsk.task_start_date ;
    v_tasks_in_rec.task_completion_date :=tsk.task_completion_date ;
    v_tasks_in(v_a) := v_tasks_in_rec;
    v_a:=v_a+1;
    end loop;
    ---------------end of task details------------------
    --INIT_CREATE_PROJECT
    pa_project_pub.init_project;
    ---------------------CREATE_PROJECT--------------------------
    pa_project_pub.create_project(
    p_api_version_number=> v_api_version_number,
    p_commit => v_commit,
    p_init_msg_list => v_init_msg_list,
    p_msg_count => v_msg_count,
    p_msg_data => v_msg_data,
    p_return_status => v_return_status,
    p_workflow_started => v_workflow_started,
    p_pm_product_code => v_pm_product_code,
    p_project_in => v_project_in,
    p_project_out => v_project_out,
    p_key_members => v_key_members,
    p_class_categories => v_class_categories,
    p_tasks_in => v_tasks_in,
    p_tasks_out => v_tasks_out);
    if v_return_status = 'S'
    then
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET INTERFACE_STATUS ='Success' where segment1 = v_project_out.pa_project_number; ---P->pending & S-> Success
    dbms_output.put_line('New Project Id: ' || v_project_out.pa_project_id);
    dbms_output.put_line('New Project Number: ' || v_project_out.pa_project_number);
    else
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET INTERFACE_STATUS ='Pending' where segment1 = v_project_out.pa_project_number;
    raise API_ERROR;
    end if;
    END LOOP;
    Commit;
    ------Handling Exception--------
    EXCEPTION
    WHEN api_error THEN
    dbms_output.put_line('An error occured during project creation');
    IF (v_msg_count > 0 ) THEN
    FOR i IN 1..v_msg_count LOOP
    apps.PA_INTERFACE_UTILS_PUB.get_messages(
    p_msg_count => v_msg_count,
    p_encoded => 'F',
    p_msg_index => i,
    p_msg_data => v_msg_data,
    p_data => v_data,
    p_msg_index_out => v_msg_index_out);
    dbms_output.put_line('Error message v_data ->'||v_data);
    dbms_output.put_line('Error message v_msg_data ->'||v_msg_data);
    dbms_output.put_line('Error message v_msg_index_out ->'||v_msg_index_out);
    dbms_output.put_line('Error message p_msg_index ->'||i);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
    END LOOP;
    END IF;
    WHEN OTHERS THEN
    dbms_output.put_line('An error occured during conversion, SQLCODE ->'|| SQLERRM);
    IF (v_msg_count >=1 ) THEN
    FOR i IN 1..v_msg_count LOOP
    PA_INTERFACE_UTILS_PUB.get_messages(
    p_msg_count => v_msg_count,
    p_msg_index => i,
    p_encoded => 'F',
    p_msg_data => v_msg_data,
    p_data => v_data,
    p_msg_index_out => v_msg_index_out);
    dbms_output.put_line('Error message ->'||v_data);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
    END LOOP;
    END IF;
    end; --end procedure
    END xxpa_proj_conv_pkg;
    * Please tell me how to assign project specific task with the newly created projects??? *
    Also please tell me how to assign multiple * Project_Relationship_Code * (ex: END CLIENT, GENERAL CONTRACTOR, PRIMARY) for a particular project during project creation?

    Are you not storing the project number in the staging table designed for storing the task data? You can use create_project API to create the project and tasks at the same time with one single call. You may want to try that option

  • Problem In Update Statement In Multiple Record Data Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count <> 0 THEN
    LOOP
    IF :SYSTEM.last_record <> 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
         VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
              :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;These update statements are without where clause, so it will update all records.
    If it is specific to oracle forms then u may get better help at Forms section.

  • Can I run a Unix shell when insert some record on a specific table?

    Can I run a Unix shell when insert some record on a specific table?
    I need to run a Unix shell when a record be insert on a table. Is there a way in order to do that?
    THanks,
    Carlos.

    1. Make a backup of the extproc.c file in the c:\orant\rdbms80\extproc
    directory.
    2. Create a file called extern.c in the c:\orant\rdbms80\extproc directory.
    The "extern.c" file :
    #include <oci.h>
    #define NullValue -1
    #include<stdio.h>
    #include<string.h>
    long __declspec(dllexport) OutputString(context ,
                             path , path_ind ,
                             message , message_ind,
                             filemode , filemode_ind ,
                             len , len_ind )
    char *path;
    char *message; 
    char *filemode;
    int len;
    OCIExtProcContext *context;
    short path_ind;
    short message_ind;
    short filemode_ind;
    short len_ind;
    FILE *file_handle;
    int i ;
    char str[3];
    int value;
    /* Check whether any parameter passing is null */
    if (path_ind == OCI_IND_NULL || message_ind == OCI_IND_NULL ||
    filemode_ind == OCI_IND_NULL || len_ind == OCI_IND_NULL ) {
    text initial_msg = (text )"One of the Parameters Has a Null Value!!! ";
    text *error_msg;
    /* Allocate space for the error message text, and set it up.
    We do not have to free this memory - PL/SQL will do that automatically. */
    error_msg = OCIExtProcAllocCallMemory(context,
    strlen(path) + strlen(initial_msg) + 1);
    strcpy((char *)error_msg, (char *)initial_msg);
    /*strcat((char *)error_msg, path); */
    OCIExtProcRaiseExcpWithMsg(context, 20001, error_msg, 0);
    /* OCIExtProcRaiseExcp(context, 6502); */
    return 0;
    /* Open the file for writing. */
    file_handle = fopen(path, filemode);
    /* Check for success. If not, raise an error. */
    if (!file_handle) {
    text initial_msg = (text )"Cannot Create file ";
    text *error_msg ;
    /* Allocate space for the error message text, and set it up.
    We do not have to free this memory - PL/SQL will do that automatically. */
    error_msg = OCIExtProcAllocCallMemory(context,
    strlen(path) + strlen(initial_msg) + 1);
    strcpy((char *)error_msg, (char *)initial_msg);
    strcat((char *)error_msg, path);
    OCIExtProcRaiseExcpWithMsg(context, 20001, error_msg, 0);
    return 0;
    i = 0;
    while (i < len)
    /* Read the hexadecimal value(1). */
    str[0] = message;
         i++;
    /* Read the hexadecimal value(2). */
    str[1] = message[i];
    /* Convert the first byte to the binary value. */
    if (str[0] > 64 && str[0] < 71)
    str[0] = str[0] - 55;
    else
    str[0] = str[0] - 48;
    /* Convert the second byte to the binary value. */
    if (str[1] > 64 && str[1] < 71)
    str[1] = str[1] - 55;
    else
    str[1] = str[1] - 48;
    /* Convert the hex value to binary (first & second byte). */
    value = str[0] * 16 + str[1];
    /* Write the binary data to the binary file. */
    fprintf(file_handle,"%c",value);
              i++;
    /* Output the string followed by a newline. */
    /* fwrite(message,len,1,file_handle); */
    /* Close the file. */
    fclose(file_handle);
    3. Use the make.bat available in the c:\orant\rdbms80\extproc directory. You
    need to run vcvars32.bat file before running this batch file. This will
    create a dll file.
    4. Configure the tnsnames.ora and the listener.ora files.
    The tnsnames.ora should contain the following entries.
    extproc_connection_data.world =
    (DESCRIPTION =
    (ADDRESS =
    (PROTOCOL = IPC)
    (KEY = ORCL)
    (CONNECT_DATA = (SID = extproc)
    The listener.ora should contain the following entries.
    # P:\ORANT\NET80\ADMIN\LISTENER.ORA Configuration File:p:\orant\net80\admin\listener.ora
    # Generated by Oracle Net8 Assistant
    LISTENER8 =
    (ADDRESS = (PROTOCOL = TCP)(HOST = winnt_nsc)(PORT = 1521))
    SID_LIST_LISTENER8=
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = winnt_nsc)
    (SID_NAME = ORCL)
    (SID_DESC =
    (SID_NAME = extproc)
    (PROGRAM = extproc)
    5. Login from sqlplus and issue the following statements.
    create library externProcedures as 'C:\orant\RDBMS80\EXTPROC\extern.dll';
    Create or replace PROCEDURE OutputString(
    p_Path IN VARCHAR2,
    p_Message IN VARCHAR2,
    p_mode in VARCHAR2,
    p_NumLines IN BINARY_INTEGER) AS EXTERNAL
    LIBRARY externProcedures
    NAME "OutputString"
    With context
    PARAMETERS (CONTEXT,
    p_Path STRING,
    p_path INDICATOR,
    p_Message STRING,
    p_message INDICATOR,
    p_mode STRING,
    p_mode INDICATOR,
    p_NumLines INT,
    p_numlines INDICATOR);
    This is the pl/sql block used to write the contents of the BLOB into a file.
    Set serveroutput on before running it.
    SQL> desc lob_tab;
    Name Null? Type
    C1 NUMBER
    C2 BLOB
    lob_tab is the table which contains the blob data.
    declare
    i1 blob;
    len number;
    my_vr raw(10000);
    i2 number;
    i3 number := 10000;
    begin
    -- get the blob locator
    SELECT c2 INTO i1 FROM lob_tab WHERE c1 = 2;
    -- find the length of the blob column
    len := DBMS_LOB.GETLENGTH(i1);
    dbms_output.put_line('Length of the Column : ' || to_char(len));
    -- Read 10000 bytes at a time
    i2 := 1;
    if len < 10000 then
    -- If the col length is < 10000
    DBMS_LOB.READ(i1,len,i2,my_vr);
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'wb',2*len);
    -- You have to convert the data to rawtohex format. Directly sending the buffer
    -- data will not work
    -- That is the reason why we are sending the length as the double the size of the data read
    dbms_output.put_line('Read ' || to_char(len) || 'Bytes');
    else
    -- If the col length is > 10000
    DBMS_LOB.READ(i1,i3,i2,my_vr);
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'wb',2*i3);
    dbms_output.put_line('Read ' || to_char(i3) || ' Bytes ');
    end if;
    i2 := i2 + 10000;
    while (i2 < len ) loop
    -- loop till entire data is fetched
    DBMS_LOB.READ(i1,i3,i2,my_vr);
    dbms_output.put_line('Read ' || to_char(i3+i2-1) || ' Bytes ');
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'ab',2*i3);
    i2 := i2 + 10000 ;
    end loop;
    end;

  • How can I record data from 2 devices synchronously

    Hi,
    I've been working on this VI for some time now and I've already recieved some prior help from these forums, so I hope I can get this problem solved.
    I have a DAQpad 6020e, a hot wire thermo anemometer, and Labview 7.1.  I need to take voltage measurements from the DAQpad at a scan rate I specify (I have it set to 1000 in the screenshot), while simultaneously taking readings from the anemometer.  However, the anemometer only takes readings every 1.6 seconds, which it sends to the serial port in ASCII.
    I have tried many iterations of this vi to try to get the data to come out synchronously.  By synchronously, I just mean I want both measurements to START at the EXACT same time.  Obvisously the scan rates are drastically different so I will have far more measurements from the DAQpad, but that is ok so long as both measurements start at the same time.  I cannot control when the anemometer makes its reading, so what I have attempted to do is as follows:
    1.  VI starts, both reads initialize, then DAQpad scan begins.
    2.  If Scan Rate and "Scans to read" are equal, it takes one second for measurements to start being recorded from the DAQpad.
    3.  In an attempt to synchronize the measurements, I attempted to tell the anemometer WHILE loop (serial) to wait until the first measurement has been recorded from the DAQpad.  (**Note, I have also tried using the "number read" lead off of the AI read command).
    4.  Because I only get 1 reading from my anemometer per 1.6 seconds, I can't predict when the next reading will be.  But I want my measurements to be corrolated in time, so I have attempted to start the measurement file as soon as the case structure starts.  This way, even if the very first reading is invalid, the rest of the readings will be valid and will be taken at times that directly correlate with the DAQpad measurements.
    I have run this vi many times, with different results.  I have gotten it to run sucessfully many times, meaning that both measurement files started recording data at the exact same instant, even if the anemometer reading wasn't available yet (I know this because the second measurement was taken at a time earlier than 1.6 seconds, meaning that the file did not wait for a measurement to be obtained in order to assign a value at 0 time).  HOWEVER, other times, this vi does not run correctly.  Sometimes the anemometer readings begin before the DAQpad readings, sometimes after.  In every case where the vi does not work, it appears that the anemometer measurement has waited for its first measurement to be recorded at time 0 instead of starting the measurement file when the DAQpad starts.
    I need to know why this vi doesn't run consistently.  I can see it do what I want it to do over and over again, but I can't use this vi if it is not 100% consistent.
    Thank you,
    Jake
    Attachments:
    LabVIEW Synchronization Attempt.pdf ‏78 KB

    For future reference, just post the actual VI.  It is easier to troubleshoot than a print as a PDF.
    Given the software complexities of separate threads and serial bus versus PCI bus, I don't see how you can say that the measurements actually start at the same time.  The only way you can say that the measurements started together was if you were using a hardware trigger.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Recording data at particular iterations and writing to text file

    Hi all,
    this is my first time posting on the NI boards. I'm running into a couple problems I can't seem to figure out how to fix.
    I'm collecting data using a LabJack U3-HV daq. I've taken one of the out-of-the-box streaming functions that comes with the LabJack and modified it for my purposes. I am attempting to simply save the recorded data to a text file in columns, one for each of my 4 analog strain gauge inputs, and one for time. For some reason when the 'write to measurement file.vi' executes it is puts everything in rows, and the data is unintelligible.
    The 2nd issue I am facing, which is not currently visible in my vi, is that I am running my test for 60,000 cycles, which generates a ton of data. I'm measuring creep/fatigue with my strain gages so I don't need data for every cycle, probably for the first 1000, then the 2k, 4k, 6k, 8k, 10k, 20k, etc. More of an exponential curve. I tried using some max/min functions and then matching the 'write to measurement file.vi' with a case structure that only permitted it to write for particular iterations, but can't seem to get it to work.
    Thanks in advance for any help!
    Attachments:
    3.5LCP strain gages v2.vi ‏66 KB

    Hey carfreak,
    I've attached a screenshot that shows three different ways of trying to keep track of incrementing data and/or time in a while loop. The top loop just shows a program that demonstrates how shift registers can be used to transfer data between loops. This code just writes the iteration value to the array using the Build Array function.
    The first loop counts iterations in an extremely round-about way... the second shows that really you can just build the array directly using the iteration count (the blue "i" in the while loop is just an iteration counter).
    The final loop shows how you can use a time stamp to actually keep track of the relative time when a loop executes.
    Please note that these three should not actually be implemented together in one VI. I just built them in one BD for simplicity's sake for the screenshot. As described above, the producer-consumer architecture should be used when running parallel loops.
    Does that answer your question?
    Chris G
    Applications Engineer
    National Instruments
    Attachments:
    While Loops and Iterations.JPG ‏83 KB

  • Some question on IDOC (Control Record/Data Record/Status Record)

    Dear all,
    I am new in this area, and would like to enquire some question on this topic.
    When I view a IDOC via WE02, each of the IDOC record will consist of Control Record/Data Record/Status Record).
    Questions:
    I notice that the data records consists of many segment (i.e. E1EDK01, etc) which are use to store application data.
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Thanks.
    Tuff

    Hi Tuff,
    As everything in SAP, with IDOCs too there are
    1) Standard IDOCs
    2) Standard IDOCs(Extending - Enhancement to an IDOC, to accomodate for custom values)
    3) Custom IDOCs
    And every IDOC has,
    Control record - EDIDC Structure - This mostly reflects the partner profile information, along with few more details which are used for IDOC extension, Sequencing etc
    Data Records - EDID4 Structure - These records contain the actual business data of the document in concern. So for ORDERS05 it would contain order details, INVOIC02 - Invoice details so on...
    Status Records - These records capture the status of an IDOC from the time it is received/sent from your system and a corresponding business document is created/changed. So this will have messages like "IDOC sent to the port OK" etc which are status from the communication layer(ALE) to application specific messages like "Sales Order XXX created" or "Invalid Material" etc.
    You would have noticed something called as Process code in the partner profile, this is associated with a FM(or work flow task etc) which has the business logic coded in.
    So in case of an Inbound IDOC, the sending system updates the IDOC - Control and Data records, and sends it to the receiving system. On the receiving system the IDOC's control record is validated against the partner profiles set, if an entry is found then using the process code it finds the associated FM which will decode the data from the IDOC data records as per the IDOC type and then use it to post data into SAP (VIA BDC, Batch Input, BAPI etc).
    And all this while the Status records are being updated accordingly.
    So with the above context will try to answer your questions,
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    In case of a custom IDOC, yes you will have  to.
    In case of a standard IDOC, you wouldn't have you just have set up the necessary configuration (Partner Profile, Process code etc)
    In case of a standard IDOC extended to accommodate for some custom values(for which there are no fields in standard IDOC - Let us say you have added some new fields on VA01) - In this case you can still use the standard Process code and Standard FM associated with it, SAP provides several Function exits in these FM's which you can leverage to add your custom logic.
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    There are several documents available on the net and on SDN detailing step by step approach for all the above three cases,
    just search for step by step guide for IDOCS - sap.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Again it depends, in case of using a standard IDOC you wouldn't have to. But in case you have some customizations/enhancements then you might have to.
    For Ex: updating the control record accordingly for indicating that you have extended the standard IDOC. Or append custom messages to the status record as per the business logic.
    Try out the examples you find on the net and post any specific questions you might have.
    Regards,
    Chen

  • Need to record data for 4 hrs at a rate of every 30s

    Hello,
    I'm fairly new to LabVIEW and need assistance. I have this VI that manually records torque and temperature by hitting a button. I want to alter it so that when I run the program  I can automatically collect data every 30 sec for 4 hrs and then the program stops. Any help would be appreciated. I have attached the VI. 

    Bob_Schor wrote:
    One of the most difficult things for people new to LabVIEW to avoid is the temptation to "just start coding" -- as often as not, you end up with a bunch of (often Express) VIs wired together that do something, but rarely what you want it to do.
    I recommend starting with thinking about the overall design, asking yourself "What do I want to do?".  In your case, it sounds like "Record data (not yet defined) every 30 seconds for 4 hours".  Now break this down -- what does "record data" mean?  How much data?  How many channels?  What data rate?  What do you want to do with the data?
    This might be a "unit" of your code, that is, this "Data Recording Block" might, in some ways, stand alone.  One way this could happen would be if you recorded, say, 5 seconds of data, wrote the data to a uniquely-named file, then stopped recording.  "Aha!", I (don't) hear you saying, "this should be written as a sub-VI called "Save Some Data" that I put in my main program and call every 30 seconds until 4 hours have gone by".
    What is this isn't your model?  Maybe you want to start data acquisition, keep it running, and every 30 seconds save some aliquot of the data to a file.  Fine, but that's another Design Decision that you should make before starting to code.  This kind of model sounds liek it might be a Producer (continuous data acquisition)/Consumer (periodic saving of the data) design, with the Consumer "worrying" about saving, say, 5 second aliquots of data every 30 seconds for 4 hours.  This last bit (namely getting the Consumer to "do its thing" properly) might be handled by a State Machine design ("Save to File", "Wait for next Sample Time", "Count Elapsed Time").
    Here is a piece of Good Advice -- never put an "Abort LabVIEW" command in your program!  Notice you have a Stop button to stop the loop, and can OR wire the output now going to the Abort to the same Stop indicator.  Use Abort in the rare instance where failure to instantly kill the program will result in someone's death or injury -- you're not yet ready to code at this level.
    Bob Schor
    To expand on this idea, I usually write up at least a "casual" requirements document - even if it's just a few paragraphs - and code each "requirement" as a subVI.

  • Recording Dates in Results Recording

    Hi.
    I have an inspection with a task list.  Several samples will be tested each time an inspection lot is created.  I have a number of MICs that are quantitative / calculated to determine results of lab testing - this is all working great.  The problem is that for each of my samples I need to be able to document general information about the sample.  The types of information that needs to be documented are, for example, dates and sample numbers (not serialized using SAP). 
    Primarily these dates need to be used to generate date range specific reports of the lab results.   It is for this reason that I do not want the users documenting dates in the inspection description field in results recording.
    Does anyone know if using the QM_INPUT_PROCEDURE BAdI can the result field of a quantitative MIC be formatted as a date?  Or has anyone had a similar problem that they have been able to solve?  Is Sample Management / Physical Samples the direction to take?
    Thank you very much in advance,
    Cristin

    Ok.  Here's one way around this.
    You can read this post: 
    http://sapfans.com/forums/viewtopic.php?f=27&t=14682&p=43885&hilit=datecharacteristicinspectionlot#p43885
    But basically you use numeric MIC and the date is recorded in the form yyyymmdd. So for today it would be 2010622.  You can even set a spec range at the begining of each year.  So the range would be 20100101 to 20101231.  This could help cut down on typos as well.
    This number then gets copied to the batch record to a linked hidden numeric characteristic.  A dependency is used to convert the number to the appropriate date.  The dependency then updates a second characteristic with the date.  It is this second date characteristic then that you can use in your reports.  If you want to make sure the date formatted characteristic is changed due to additional testing or sampling you can include an  IF NULL or an IF INITIAL statement in the dependency so once the characteristic has a value, it wouldn't be updated if the dependency was called again.
    I am guessing each blood donation is being set up as a separate batch number.
    FF

  • Project Specific Calendar

    Hi Experts,
       My requirement is to fetch certain data for an associate based on his working hours in a project . For this i would require a project specific calendar . I have gone through SCAL & RZ23N which give me standard country specific calendars. This would not suffice my need as all projects in my organization donot have the same freedays or holidays,so please suggest me a way where by i could obtain project specific calendars.
    Thanks In Advance,
    Chaitanya.

    Hi,
    Below are the 2 function modules
    BARC_ADD_CALENDAR
    SALP_UI_CALENDAR_SCHEMAS
    Thanks
    Vikranth

  • First WBS Record in Project

    I got all wbs record from P6 for specific project except
    first wbs record
    I found in Primavera
    Integraation API that for WBSObject of project it does not
    allow to load that wbs record? How to get first wbs record
    for Project in P6?I am tried load it may way like using
    Primavera Integration API classes like Enterprise laod
    manager,Project contains method LoadAllWBS which are not
    loading WBS record. How should I get First Wbs record for
    specific project?

    Hello,
    Your question would be
    answered best by our Support Team. Support can be
    accessed at
    http://primavera.com/customer/support.asp<br
    />
    Have a great day,
    Justin

  • Workflow SedMail Fails with Project Data:Project Owner Email

    Hi Forum,
    I've been using Project Server 2013 for while now and I've been tasked with setting up workflows.
    The workflow SendEmail facility is useful but I've noticed something strange.
    If I put the Recipient as: "Project Data:Project Owner Email" then the Workflow will fail, and in the WFInstanceDatabase the error is http - bad request.
    If I change the Reciepient to a named user, the workflow passes.
    What's even stranger, when running the workflow the Project Owner is the same AD User.
    I'm running in Project Server Permissions Mode, but it does suggest a permissions or lack of some sort of Synchronization going on, as the the AD user has the email field setup and is also listed in the AD Synchronization Pool screen (if the PWA Settings
    area).
    If this problem rings any bells, your help would be appreciated.  I've spent a few weekends, going through process of elimnation, Workflow Setup, SMTP setup, setting up very simple workflows, so I've managed to get this specific difference.
    Many Thanks
    Regards
    Mark

    Hi Kiran,
    I've changed the email template in SPD2013 to set the To: to a named user (synced via AD) and in the body I've added ProjectData:ProjectOwnerEmail and on running the creating a new project, I am getting the email, and also in the body, it's showing the email
    address.
    So it indicates that emailing does work, the property is available,  but it seems to point to whether something more fundamental is missing. I'm hoping there's something else to check?
    Mark

  • How do I initialize a DVD to prepare for recording data?

    Using an S5150t pavilion, LightScribe drive.  How do I initialize a DVD to prepare for recording data?  The HP Digital Media program only addresses pictures and video.

    Bill, here is a guide to using CyberLink DVD Suite 6.  This is the program that the Product Specifications page states is on your computer.
    Please let us know if this solves your problem or not.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • Query WHERE statement to compare db record date

    Hello
    I can't get this where statement to work. I have it now so it is not throwing any errors, but it also isn't doing what it is supposed to.
    I am trying to match records date in my table with the actual calendar date, if there is a match, my cfif will take that match, and make it a link in the proper date. (it is a small calendar with the month, and the days of week with dates, each date will be normal, accept if there is a record for that date, it makes a link.
    This is my code, like I said, It doesn't throw an error, but it is not working either.
    My Query:
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate >= #CreateODBCDate("07/12/2005")# AND eventDate = #Days#
    </cfquery>
    This is the cfif statement:
    <cfoutput query="CaleventRec">
    <cfif Days EQ '#eventdate#'>
    <a href = "detail.cfm?id=#ID#">#Days#</a>
    </cfif>
    </cfoutput>
    this is all the code together:
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate >= #CreateODBCDate("07/12/2005")# AND eventDate = #Days#
    </cfquery>
                            <!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
                            <cfset ThisDay = 0>
                            <!--- Loop through until the number of days in the month is reached. --->
                            <cfloop condition = "ThisDay LTE Days">
                                <tr>
                                <!--- Loop though each day of the week. --->
                                <cfloop from = "1" to = "7" index = "LoopDay">
                                <!--- This turns each day into a hyperlink if it is a current or future date --->
                                   <cfoutput query="CaleventRec">
              <cfif Days EQ '#eventdate#'>
                                   <a href = "detail.cfm?id=#ID#">#Days#</a>
                                   </cfif>
              </cfoutput>
                                <!---
                                    If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
                                    If the values match, set ThisDay to 1.
                                    Otherwise, the value will remain 0 until the correct day of the week is found.
                                --->
                                    <cfif ThisDay IS 0>
                                        <cfif DayOfWeek(ThisMonthYear) IS LoopDay>
                                            <cfset ThisDay = 1>
                                        </cfif>
                                    </cfif>
                                <!---
                                    If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
                                    the day of the mnth and increment the value.
                                --->
                                        <cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
                                        <cfoutput>
                                        <!--- I choose to highlight the current day of the year using an IF-ELSE. --->
                                            <cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
                                                <td align = "center" bgcolor="##FFFF99">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                                                    <font class = "calendartoday">#ThisDay#</font>
                                                </td>
                                            <cfelse>
                                                <td align = "center">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                                                    <font class = "calendar">#ThisDay#</font>
                                                </td>
                                            </cfif>
                                        </cfoutput>
                                        <cfset ThisDay = ThisDay + 1>
                                        <cfelse>
                                            <td></td>
                                    </cfif>
                                </cfloop>
                                </tr>
                        </cfloop>
    I know my where statement is incorrect, I am also not sure if my cfif statement is correct either. Can anyone help me figure this out?
    thank you!
    CFmonger

    All the rest of the code works. The only part of this that doesn't work is the trying to make a link part.
    Let me  show you where I am, and what I did, then maybe you will see I am closer to the solution... I think. I made this calendar so you can cycle through the months. So if you are looking at June, you see Sun - Sat and the dates for each day of the week in the month of june. You can then choose to click the next button that will bring up the month of july, and you can keep on going as long as you want.
    That is one function and it working as of right now. This Calendar also shows what day of the week we are on. If it is June 16th then June 16 is yellow. This also works.NOw, what I need to do it to have my query, not only filter out the records for the month, (if we are in June, then the Query separates out the records for June, the date in my DB is set to mm/dd/yyyy) This query also needs to match it to a number, the days of the month. So, if there is a record on the 25th of June, then the 25th of June will be a link to another page using it's ID in the address line. If you go to July and there are lets say 3 records for that month, then all 3 dates will become a link to the same other page using it's ID in the url.
    This is what I have now. I tied the Query into the next / prev function so it filters the month, so far it seems to work, I can do a cfdump up to the point of my cfif statement and get the proper number from the date, my cfif is not firing so If I do a dump after it, it doesn't dump anyhting.
    I will post JUST the query code, then post the whole calander code so you can see it all together.
    The Query / link code:
    <!--- This is part of the next / prev nav to cycle through the months --->
    <cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
    <cfset NextMonth = DatePart('m', NextMonthYear)>
    <!--- My Query --->
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate Between #NextMonthYear# and #NextMonth#
    </cfquery>
    <!--- my output / cfif stement --->
    <cfoutput query="CaleventRec">
    <cfset comparison = DateCompare('#dateFormat(eventDate, 'dd')#', '#Days#', 'd')>
    <!--- When I do a cfdump here, I get the number of the first record with a day date in the DB for the month of june
    <cfdump var="#dateFormat(eventDate, 'dd')#">
                                   <cfabort>--->
    <cfif #Days# EQ ('#dateFormat(eventDate, 'dd')#')>
    <!--- When I do a dump here, I do not get anyhting, no numbers it doesn't fire
    <cfdump var="#eventDate#">
    <cfabort>--->
    <a href = "detail.cfm?id=#ID#">#Days#</a>
    </cfif>
    </cfoutput>
    ok, now that is the part to stream in the DB info into the calander.
    Here is all the code, like I said, it all works, just not making each day a link that has a record in the DB.
    <!--- Declaration of the variables --->
           <cfparam name = "month" default = "#DatePart('m', Now())#">
    <cfparam name = "year" default = "#DatePart('yyyy', Now())#">
    <cfparam name = "currentday" default = "#DatePart('d', Now())#">
    <cfparam name = "startmonth" default = "#DatePart('m', Now())#">
    <cfparam name = "startyear" default = "#DatePart('yyyy', Now())#">
    <!--- Set a requested (or current) month/year date and determine the number of days in the month. --->
    <cfset ThisMonthYear = CreateDate(year, month, '1')>
    <cfset Days = DaysInMonth(ThisMonthYear)>
    <!--- Set the values for the previous and next months for the back/next links.--->
    <cfset LastMonthYear = DateAdd('m', -1, ThisMonthYear)>
    <cfset LastMonth = DatePart('m', LastMonthYear)>
    <cfset LastYear = DatePart('yyyy', LastMonthYear)>
    <cfset NextMonthYear = DateAdd('m', 1, ThisMonthYear)>
    <cfset NextMonth = DatePart('m', NextMonthYear)>
    <cfset NextYear = DatePart('yyyy', NextMonthYear)>
    <cfset PreviousDay = DateAdd('d', -1, ThisMonthYear)>
    <cfset CurrentYear = DatePart('yyyy', Now())>
    <table border="0" width="100%" bgcolor ="#ffffff">
                <tr>
                    <td align = "center" valign="top">
                        <table border="0" width="100%" height="100%">
       <tr>
          <th align="center" colspan="7" bgcolor="#2b4e6e">
       <cfoutput>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="15%" align="left" valign="middle">
      <cfif (LastYear lt CurrentYear) OR (LastYear lte CurrentYear AND LastMonth lt startmonth)>
    <cfelse>
      <a href ="index.cfm?month=#LastMonth#&year=#LastYear#" class="calNav">Prev</a></cfif></td>
            <td width="72%" align="center" valign="middle"><FONT SIZE="3" face="Arial, Helvetica, sans-serif" color="##ffffff">#MonthAsString(month)# #year#</FONT></td>
            <td width="13%" align="right" valign="middle">
      <cfif (NextYear lt CurrentYear) OR (NextYear lte CurrentYear AND NextMonth lt startmonth)>
    <cfelse>
    <a href = "index.cfm?month=#NextMonth#&year=#NextYear#" class="calNav">Next</a>  </cfif></td>
          </tr>
        </table></cfoutput></th>
       </tr>
       <tr>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sun</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Mon</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Tue</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Wed</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Thu</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Fri</FONT></td>
        <td><FONT SIZE="2" face="Arial, Helvetica, sans-serif" color="#333366">Sat</FONT></td>
       </tr>
    <cfquery name="CaleventRec" datasource="#APPLICATION.dataSource#">
    SELECT events.eventDate, events.ID AS ID
    FROM events
    WHERE eventDate Between #NextMonthYear# and #NextMonth#
    </cfquery>
                            <!--- Set the ThisDay variable to 0. This value will remain 0 until the day of the week on which the first day of the month falls on is reached. --->
                            <cfset ThisDay = 0>
                            <!--- Loop through until the number of days in the month is reached. --->
                            <cfloop condition = "ThisDay LTE Days">
                                <tr>
                                <!--- Loop though each day of the week. --->
                                <cfloop from = "1" to = "7" index = "LoopDay">
                                <!--- This turns each day into a hyperlink if it is a current or future date --->
             <cfoutput query="CaleventRec">
             <cfset comparison = DateCompare('#dateFormat(eventDate, 'dd')#', '#Days#', 'd')>
              <cfdump var="#dateFormat(eventDate, 'dd')#">
                                   <cfabort>
              <cfif #Days# EQ ('#dateFormat(eventDate, 'dd')#')>
              <cfdump var="#eventDate#">
                                   <cfabort>
                                   <a href = "detail.cfm?id=#ID#">#Days#</a>
                                   </cfif>
              </cfoutput>
                                <!---
                                    If ThisDay is still 0, check to see if the current day of the week in the loop matches the day of the week for the first day of the month.
                                    If the values match, set ThisDay to 1.
                                    Otherwise, the value will remain 0 until the correct day of the week is found.
                                --->
                                    <cfif ThisDay IS 0>
                                        <cfif DayOfWeek(ThisMonthYear) IS LoopDay>
                                            <cfset ThisDay = 1>
                                        </cfif>
                                    </cfif>
                                <!---
                                    If the ThisDay value is still 0, or is greater than the number of days in the month, display nothing in the column. Otherwise, dispplay
                                    the day of the mnth and increment the value.
                                --->
                                        <cfif (ThisDay IS NOT 0) AND (ThisDay LTE Days)>
                                        <cfoutput>
                                        <!--- I choose to highlight the current day of the year using an IF-ELSE. --->
                                            <cfif (#ThisDay# EQ #currentday#) AND (#month# EQ #startmonth#) AND (#year# EQ #startyear#)>
                                                <td align = "center" bgcolor="##FFFF99">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendartoday">#ThisDay#</font>
                                                </td>
                                            <cfelse>
                                                <td align = "center">
                                                    <cfset dayview = #dateformat(createdate(#year#, #month#, #thisday#), "mm/dd/yyyy")#>
                <font class = "calendar">#ThisDay#</font>
                                                </td>
                                            </cfif>
                                        </cfoutput>
                                        <cfset ThisDay = ThisDay + 1>
                                        <cfelse>
                                            <td></td>
                                    </cfif>
                                </cfloop>
                                </tr>
                        </cfloop>
                        </table>
                    </td>
                </tr>
            </table>
    It is kind of complicated and this is why I need help. Maybe I am wrong in the variables I am pulling, but like I say in my comments, so far I pulled the day part of the month I am in out of the records up until my cfif stement.Can this be done with what I have done so far? No need to rewrite the whole calander, just the part with the query if I miss what you are saying.

Maybe you are looking for

  • Digital Voice Suddenly Not Working

    I recently moved into a new home and had FiOS installed. Everything worked well for about a month, but then my landline seemed to stop functioning. I can't get a dial tone on either of the phones I've tried (they'll display "No Line" or occasionally

  • How to change label font

    i am in the final stages of making an iphone app in xcode. i am now working on changing the font of each of the labels in my app. i have gone to interface builder and selected each label. then, in the inspector, i changed the font to the one i wanted

  • How to optimize xquery expression ?

    hi, i got berkeley db xml database with containers: dicom.dbxml and instancemetadata.dbxml. dicom.dbxml contains documents as follow: <?xml version="1.0" encoding="UTF-8"?> <instance docid="dicom_1009">      <dicom_item>           <dicom_header>     

  • How can I sync my itouch and iPad calendars?

    My calendar is not syncing between the two devices.  It used to and suddenly they're not.

  • TS4002 Having upgraded to 10.8 some emails are disappearing before I can read them.

    Having upgraded to 10.8 some emails are disappearing before I can read them. They are present for about a second, display as notified, but are not going to junk or Trash. The problem doesn't affect all emails and seems to be restricted to some sender