Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Run sql query inside a stored procedure

Run sql query inside a stored procedure

Scheduled Pinned Locked Moved Database
databasehelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13172714
    wrote on last edited by
    #1

    Hi.. Please help me in running below sql query by creating and calling a stored procedure. Query: $incidentQuery = "SELECT * FROM pki_incidents pi LEFT JOIN pki_tickets pt ON pt.ticket_no = pi.hosp_ticket WHERE pt.ticket_no = '" . $_REQUEST['hosp_ticket'] . "'";

    Z Kornfeld Eliyahu PeterK Richard DeemingR 3 Replies Last reply
    0
    • U User 13172714

      Hi.. Please help me in running below sql query by creating and calling a stored procedure. Query: $incidentQuery = "SELECT * FROM pki_incidents pi LEFT JOIN pki_tickets pt ON pt.ticket_no = pi.hosp_ticket WHERE pt.ticket_no = '" . $_REQUEST['hosp_ticket'] . "'";

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      What is your question?

      There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      • U User 13172714

        Hi.. Please help me in running below sql query by creating and calling a stored procedure. Query: $incidentQuery = "SELECT * FROM pki_incidents pi LEFT JOIN pki_tickets pt ON pt.ticket_no = pi.hosp_ticket WHERE pt.ticket_no = '" . $_REQUEST['hosp_ticket'] . "'";

        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu Peter
        wrote on last edited by
        #3

        How to: Create a Stored Procedure (SQL Server Management Studio)[^] Create a Stored Procedure | Microsoft Docs[^] Sql Server - How To Write a Stored Procedure in SQL Server[^] And an other 3 million answers using Google...

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

        1 Reply Last reply
        0
        • U User 13172714

          Hi.. Please help me in running below sql query by creating and calling a stored procedure. Query: $incidentQuery = "SELECT * FROM pki_incidents pi LEFT JOIN pki_tickets pt ON pt.ticket_no = pi.hosp_ticket WHERE pt.ticket_no = '" . $_REQUEST['hosp_ticket'] . "'";

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query. Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^] How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^] Query Parameterization Cheat Sheet | OWASP[^]


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups