sql - procedure to take information from one table and write to another table -


ive got question stumped on. reads follows:

write import stored procedure take information table (source) , write table (target).

im guessing following:

create procedure add_data(@name, @surname) begin  select name, surname  cardholder  insert new_table values (name, surname) 

is logic correct or missing it?

you there. since directly copying 1 table another, can use insert ... select ... idiom, so:

create procedure add_data  @name varchar(100)  @surname varchar(100) begin    insert new_table(name,surname)  select name, surname   cardholder  end 

note 2 changes made:

  1. how declare parameters sp
  2. the values clause should consist of actual values being inserted. since inserting data retrieved table rather fixed values, use select query instead.

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -