Click here to Skip to main content
15,890,557 members
Home / Discussions / Database
   

Database

 
QuestionRe: Check the database for existency. [modified] Pin
T.RATHA KRISHNAN28-Oct-10 0:14
T.RATHA KRISHNAN28-Oct-10 0:14 
AnswerRe: Check the database for existency. Pin
jschell28-Oct-10 8:22
jschell28-Oct-10 8:22 
Questionparameter with the In function Pin
Tamimi - Code26-Oct-10 22:55
Tamimi - Code26-Oct-10 22:55 
AnswerRe: parameter with the In function Pin
Blue_Boy26-Oct-10 23:11
Blue_Boy26-Oct-10 23:11 
GeneralRe: parameter with the In function Pin
Tamimi - Code26-Oct-10 23:47
Tamimi - Code26-Oct-10 23:47 
GeneralRe: parameter with the In function Pin
Blue_Boy26-Oct-10 23:50
Blue_Boy26-Oct-10 23:50 
GeneralRe: parameter with the In function Pin
Tamimi - Code27-Oct-10 0:05
Tamimi - Code27-Oct-10 0:05 
GeneralRe: parameter with the In function Pin
jschell28-Oct-10 8:29
jschell28-Oct-10 8:29 
Tamimi - Code wrote:
then how you can pass the selected ids to a stored procedure ??


Presuming that you really did mean stored procedure then...

First step, determine based on to create the stored procedure in the language supported by the database. Options that I have used for variable argument lists.
- Arrays
- Varchar with values as a comma separated values in that list.
- Proc with up to X args and of which can be null.
- Several procs each one with an increasing number of parameters: first has 5, second has 10, etc.
- dynamic SQL, run in a proc (only suitable for situations where input is known to be secure.)

Once you do in fact have a proc then you write code which populates the parameters dependent on the type of proc that actually exists.

Conversely without a proc, and just using SQL, one creates the SQL from scratch using code (for loops, string concatenation, etc) with the appropriate number of bind variables. Then one populates the bind variables. Then you run it.

To my mind the last option is easier than any solution with procs.
AnswerRe: parameter with the In function Pin
John Gathogo27-Oct-10 0:01
John Gathogo27-Oct-10 0:01 
GeneralRe: parameter with the In function Pin
Tamimi - Code27-Oct-10 0:18
Tamimi - Code27-Oct-10 0:18 
GeneralRe: parameter with the In function Pin
David Mujica27-Oct-10 3:26
David Mujica27-Oct-10 3:26 
GeneralRe: parameter with the In function Pin
jschell28-Oct-10 8:42
jschell28-Oct-10 8:42 
AnswerRe: parameter with the In function Pin
Goutam Patra27-Oct-10 1:47
professionalGoutam Patra27-Oct-10 1:47 
GeneralRe: parameter with the In function Pin
Tamimi - Code27-Oct-10 2:42
Tamimi - Code27-Oct-10 2:42 
QuestionOracle to SQL porting [modified] Pin
Arudya26-Oct-10 17:54
Arudya26-Oct-10 17:54 
AnswerRe: Oracle to SQL porting Pin
Chris Meech27-Oct-10 3:14
Chris Meech27-Oct-10 3:14 
QuestionInserting in Multi table With one Store Procedure Pin
future383926-Oct-10 12:29
future383926-Oct-10 12:29 
AnswerRe: Inserting in Multi table With one Store Procedure Pin
PIEBALDconsult26-Oct-10 15:07
mvePIEBALDconsult26-Oct-10 15:07 
AnswerRe: Inserting in Multi table With one Store Procedure Pin
Mycroft Holmes26-Oct-10 20:13
professionalMycroft Holmes26-Oct-10 20:13 
QuestionOfficial PostgreSQL forum Pin
Jassim Rahma26-Oct-10 4:51
Jassim Rahma26-Oct-10 4:51 
AnswerRe: Official PostgreSQL forum Pin
Mycroft Holmes26-Oct-10 12:24
professionalMycroft Holmes26-Oct-10 12:24 
GeneralRe: Official PostgreSQL forum Pin
Corporal Agarn27-Oct-10 0:56
professionalCorporal Agarn27-Oct-10 0:56 
GeneralRe: Official PostgreSQL forum Pin
Mycroft Holmes27-Oct-10 1:13
professionalMycroft Holmes27-Oct-10 1:13 
Questiondeploy PostgreSQL database Pin
Jassim Rahma26-Oct-10 3:56
Jassim Rahma26-Oct-10 3:56 
Questioncreate script for entire database in PostgreSQL Pin
Jassim Rahma26-Oct-10 3:55
Jassim Rahma26-Oct-10 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.