Loading ...
Sorry, an error occurred while loading the content.

Re: [SQLQueriesNoCode] Stored Procedure Help

Expand Messages
  • Joe Fawcett
    Not sure what that s supposed to do. What is the point of testing @criteria and then not acting on the result in a meaningful way? Joe http://joe.fawcett.name/
    Message 1 of 10 , May 6 2:31 PM
    • 0 Attachment
      Not sure what that's supposed to do. What is the point of testing @criteria
      and then not acting on the result in a meaningful way?

      Joe
      http://joe.fawcett.name/

      --------------------------------------------------
      From: "Farhan Ahmed" <engr.farhan_ssuet@...>
      Sent: Thursday, May 06, 2010 10:28 PM
      To: <sqlqueriesnocode@yahoogroups.com>
      Subject: RE: [SQLQueriesNoCode] Stored Procedure Help

      >
      > CREATE PROCEDURE [dbo].[amhs_pap_merc_dx]
      > AS
      > BEGIN
      >
      > DECLARE @Criteria VARCHAR(10)
      >
      > SELECT @Criteria = ICD9CM_Code_Id FROM Patient_Diagnosis
      > If @Criteria= '272.0' THEN 'True'
      > ELSE 'False'
      > END
      >
      > END
      > GO
      >
      > Thanks
      > Farhan Ahmed
      >
      > Programmer Analyst
      >
      > The Shams Group
      >
      >
      >
      >
      >
      >
      >
      >
      > To: SQLQueriesNoCode@yahoogroups.com
      > From: diana@...
      > Date: Thu, 6 May 2010 19:02:54 +0000
      > Subject: [SQLQueriesNoCode] Stored Procedure Help
      >
      >
      >
      >
      >
      > Ok so I am creating a stored procedure (basic knowledge of sps on my part)
      > and when I try to execute this sp I get an error message. I'm not sure
      > what is wrong with it and how to fix it. Any idea's anyone?
      >
      > create PROCEDURE [dbo].[amhs_pap_merc_dx]
      > As
      > BEGIN
      > DECLARE
      > @Criteria VARCHAR(10)
      > If patient_diagnosis.icd9cm_code_id = '272.0'
      > Set @Criteria = 'True'
      > Else
      > Set @Criteria = 'False'
      > End
      >
      > select * from patient_diagnosis
      >
      > Msg 4104, Level 16, State 1, Procedure amhs_pap_merc_dx, Line 6
      > The multi-part identifier "patient_diagnosis_.icd9cm_code_id" could not be
      > bound.
      >
      > Diana Adams
      > Template Developer/Consultant
      > EMR Template Experts
      > phone (920) 342-8265
      > diana@...
      > www.emrtemplateexperts.com
      >
      >
      >
      >
      >
      > _________________________________________________________________
      > Hotmail: Powerful Free email with security by Microsoft.
      > https://signup.live.com/signup.aspx?id=60969
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Farhan Ahmed
      Correction!!!!!!!!!!!!!!!1 CREATE PROCEDURE [dbo].[amhs_pap_merc_dx] AS BEGIN DECLARE @Criteria VARCHAR(10) SELECT @Criteria = Cast(ICD9CM_Code_Id as
      Message 2 of 10 , May 6 2:32 PM
      • 0 Attachment
        Correction!!!!!!!!!!!!!!!1

        CREATE PROCEDURE [dbo].[amhs_pap_merc_dx]
        AS
        BEGIN

        DECLARE @Criteria VARCHAR(10)

        SELECT @Criteria = Cast(ICD9CM_Code_Id as Varchar(10)) FROM Patient_Diagnosis
        If @Criteria= '272.0' THEN

        Select 'True'
        ELSE

        Select 'False'
        END

        END
        GO

        Thanks
        Farhan Ahmed
        Programmer Analyst
        The Shams Group




        > To: sqlqueriesnocode@yahoogroups.com
        > From: engr.farhan_ssuet@...
        > Date: Fri, 7 May 2010 03:28:15 +0600
        > Subject: RE: [SQLQueriesNoCode] Stored Procedure Help
        >
        >
        > CREATE PROCEDURE [dbo].[amhs_pap_merc_dx]
        > AS
        > BEGIN
        >
        > DECLARE @Criteria VARCHAR(10)
        >
        > SELECT @Criteria = ICD9CM_Code_Id FROM Patient_Diagnosis
        > If @Criteria= '272.0' THEN 'True'
        > ELSE 'False'
        > END
        >
        > END
        > GO
        >
        > Thanks
        > Farhan Ahmed
        >
        > Programmer Analyst
        >
        > The Shams Group
        >
        >
        >
        >
        >
        >
        >
        >
        > To: SQLQueriesNoCode@yahoogroups.com
        > From: diana@...
        > Date: Thu, 6 May 2010 19:02:54 +0000
        > Subject: [SQLQueriesNoCode] Stored Procedure Help
        >
        >
        >
        >
        >
        > Ok so I am creating a stored procedure (basic knowledge of sps on my part) and when I try to execute this sp I get an error message. I'm not sure what is wrong with it and how to fix it. Any idea's anyone?
        >
        > create PROCEDURE [dbo].[amhs_pap_merc_dx]
        > As
        > BEGIN
        > DECLARE
        > @Criteria VARCHAR(10)
        > If patient_diagnosis.icd9cm_code_id = '272.0'
        > Set @Criteria = 'True'
        > Else
        > Set @Criteria = 'False'
        > End
        >
        > select * from patient_diagnosis
        >
        > Msg 4104, Level 16, State 1, Procedure amhs_pap_merc_dx, Line 6
        > The multi-part identifier "patient_diagnosis_.icd9cm_code_id" could not be bound.
        >
        > Diana Adams
        > Template Developer/Consultant
        > EMR Template Experts
        > phone (9...
        > diana@...
        > www.emrtemplateexperts.com
        >
        >
        >
        >
        >
        > _________________________________________________________________
        > Hotmail: Powerful Free email with security by Microsoft.
        > https://signup.live.com/signup.aspx?id=60969
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >

        _________________________________________________________________
        Hotmail: Free, trusted and rich email service.
        https://signup.live.com/signup.aspx?id=60969

        [Non-text portions of this message have been removed]
      • Rob Richardson
        Setting aside the mystery of what you are trying to accomplish, why do you expect to use a value before the select statement that puts the data into the value?
        Message 3 of 10 , May 7 10:01 AM
        • 0 Attachment
          Setting aside the mystery of what you are trying to accomplish, why do
          you expect to use a value before the select statement that puts the data
          into the value? Put your select statement on top of the if statement.

          RobR
        • Rashmi Soni
          what is difference between sql and sqliplus????????? ________________________________ From: Rob Richardson To:
          Message 4 of 10 , May 21 4:31 PM
          • 0 Attachment
            what is difference between sql and sqliplus?????????



            ________________________________
            From: Rob Richardson <Rob.Richardson@...>
            To: SQLQueriesNoCode@yahoogroups.com
            Sent: Fri, 7 May, 2010 10:31:57 PM
            Subject: RE: [SQLQueriesNoCode] Stored Procedure Help


            Setting aside the mystery of what you are trying to accomplish, why do
            you expect to use a value before the select statement that puts the data
            into the value? Put your select statement on top of the if statement.

            RobR





            [Non-text portions of this message have been removed]
          • arun aarun
            SQL is a Database Language SQLPlus is an Oracle Tool to Acess the SQL. ... From: Rashmi Soni Subject: Re: [SQLQueriesNoCode] Stored
            Message 5 of 10 , May 23 9:48 AM
            • 0 Attachment
              SQL is a Database Language SQLPlus is an Oracle Tool to Acess the SQL.
              --- On Sat, 22/5/10, Rashmi Soni <rashmi.soni42@...> wrote:

              From: Rashmi Soni <rashmi.soni42@...>
              Subject: Re: [SQLQueriesNoCode] Stored Procedure Help
              To: SQLQueriesNoCode@yahoogroups.com
              Date: Saturday, 22 May, 2010, 5:01 AM
















               









              what is difference between sql and sqliplus?????????



              ________________________________

              From: Rob Richardson <Rob.Richardson@...>

              To: SQLQueriesNoCode@yahoogroups.com

              Sent: Fri, 7 May, 2010 10:31:57 PM

              Subject: RE: [SQLQueriesNoCode] Stored Procedure Help



              Setting aside the mystery of what you are trying to accomplish, why do

              you expect to use a value before the select statement that puts the data

              into the value? Put your select statement on top of the if statement.



              RobR



              [Non-text portions of this message have been removed]





























              [Non-text portions of this message have been removed]
            • Chirag Mewada
              @ sign represents parameter and you are creating varialble so first of all remove @ sing bofore the name of variable and if you are using paramenter then find
              Message 6 of 10 , Jun 22, 2011
              • 0 Attachment
                @ sign represents parameter and you are creating varialble
                so first of all remove @ sing bofore the name of variable
                and if you are using paramenter then find from google or w3cschool
                that how to use parameteres in stored procedures


                On 5/23/10, arun aarun <saarun_emf@...> wrote:
                >
                > SQL is a Database Language SQLPlus is an Oracle Tool to Acess the SQL.
                > --- On Sat, 22/5/10, Rashmi Soni <rashmi.soni42@...> wrote:
                >
                > From: Rashmi Soni <rashmi.soni42@...>
                > Subject: Re: [SQLQueriesNoCode] Stored Procedure Help
                > To: SQLQueriesNoCode@yahoogroups.com
                > Date: Saturday, 22 May, 2010, 5:01 AM
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > what is difference between sql and sqliplus?????????
                >
                >
                >
                > ________________________________
                >
                > From: Rob Richardson <Rob.Richardson@...>
                >
                > To: SQLQueriesNoCode@yahoogroups.com
                >
                > Sent: Fri, 7 May, 2010 10:31:57 PM
                >
                > Subject: RE: [SQLQueriesNoCode] Stored Procedure Help
                >
                >
                >
                > Setting aside the mystery of what you are trying to accomplish, why do
                >
                > you expect to use a value before the select statement that puts the data
                >
                > into the value? Put your select statement on top of the if statement.
                >
                >
                >
                > RobR
                >
                >
                >
                > [Non-text portions of this message have been removed]
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > [Non-text portions of this message have been removed]
                >
                >


                --
                Chirag A Mewada
                =======================================
                (Assistant Professor)
                NaranLala College of Professional & Applied Sciences
                Navsari.
                =======================================

                ".....IF IT WAS EASY, EVERYBODY WOULD BE DOING IT....."
              Your message has been successfully submitted and would be delivered to recipients shortly.