Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2013
    Posts
    12

    Unanswered: store procedure help

    hi everyone, i am new in sql programming ,i need help


    I have one query about storeprocedure, i want to create 1) cheque amount 2)cheque date 3)cheque no,
    and validation
    using with cursor and checking true or false ,if value is giving wrong display error it will store error code and try catch also using with storeprocedure.

    give some sample coding which will helpful for me

    pls....

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What have you tried so far?
    I'm afraid your question doesn't make a whole lot of sense to me! Perhaps some sample data and desired output would help illustrate.
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    If anyone read the FAQs, then those questions would no longer be Frequently Asked.

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I thought the A stood for Answered
    George
    Home | Blog

  6. #6
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Geez, you guys are so hard on new people...
    don't see how this will help, but here is somple sample code.


    Code:
    DECLARE @student_id INT 
    DECLARE @getid CURSOR 
    DECLARE @Student_db_id INT 
    
    SET @Student_db_id = 11 
    SET @getid= CURSOR FOR 
    SELECT student_id 
    FROM student_tbl 
    WHERE Student_db_id = @Student_db_id
    
    OPEN @getid 
    FETCH NEXT 
    FROM @getid INTO @student_id
    WHILE @@FETCH_STATUS = 0 
    BEGIN 
    EXEC purge_by_student @student_id, @Student_db_id 
    FETCH NEXT 
    FROM @getid INTO @student_id
    END 
    
    CLOSE @getid 
    DEALLOCATE @getid 
    
    DELETE FROM STUDENT_IMPORT_FAILURE WHERE Student_db_id = @Student_db_id 
    DELETE FROM student_tbl WHERE Student_db_id = @Student_db_id

  7. #7
    Join Date
    Oct 2013
    Posts
    12
    thank u so much dav

    much useful for me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •