Hello, I'm trying to insert identities to foreign keys. Here's my code:
WITH p AS (SELECT id FROM tbl_place WHERE txt_place = "Place 1")
INSERT INTO tbl_sheet(txt_rep_no, txt_song_name, id_place, id_source_by, id_compiled_by, id_notation_by, id_type, blob_sheet1)
VALUES("1", "Song Name 1", p.id, 1, 1, 1, "", "")
This gives me error
No such column p.id
How can I select and insert to foreign key?.
Edit:
Here's my code so far:
INSERT INTO "tbl_sheet" (
txt_rep_no,
txt_song_name,
id_place,
id_source_by,
id_compiled_by,
id_notation_by,
id_type,
blob_sheet1,
blob_sheet2
)
SELECT
"1",
"Song 1",
p.id,
so.id,
c.id,
n.id,
t.id,
"iVBORw0KGgoAAAANSUhEUgAAAy8AAADSCAIAAADMq2g9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACLlSURBVHhe7d3/T9z3fcDx/U8nNbGsSEiWrUQWkh3ZuKUzZSHuUQ8z6p7jmoS60IRcrjNExh4tPRdCrjU4ppdc63NGyVydvNHbqICNXhVNTNOYqglNK9I0oWqKutf783693/e5Lzh4vfscJM+XHj+Q9/sD3B2Ye+pzH8if/IFhGIZhGIZp3VBjDMMwDMMwrZxyjZ2tmcWPP/G+1PllXXWT39j1u+e/8pKuusmt7vjd7pd7ddVN9u+3/e7LX+vXVTfv/e2/+93e/iu66ubuL/7F7/Z941VddfPuz3/jdwe+Oayrbmby6373G0Nv6qqb9Af/4Hevjozpqpvv3X/sd19985auurk19zd+9/p3p3TVzdvvfuh3R95+R1fd3PjhB3539PZdXXXz1vff87upqQVddfPGrR/53bHpn+mqm+Hxab97M7Ooq26GUt/zu7fnf6GrbgbfuOl3v/+Tv9NVN698+y/97p2f/kpX3Vx+9Q2/+86H/6Srbvpfue53f/TRx7rq5s+/fs3vzhX+VVfdxPsu+937y7/VVTc98T6/+/7Kf+qqm6+89FW/+7P1/9ZVN18+3+13Pyz9XlfdfPGLX/K7ouPcOd1w89e/+V+/2/mn53XVz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xGlxYYNQYAABAxG11aYNQYAABAxGx0aYFRYwAAABGz0aUFRo0BAABEzEaXFhg1BgAAEDEbXVpg4RqrOg4AAADNowVGjQEAALSEFhg1BgAA0BJaYNQYAABAS2iBcRU/AABAxGx0aYFRYwAAABGz0aUFRo0BAABEzEaXFhg1BgAAEDEbXVpg1BgAAEDEbHRpgVFjAAAAEbPRpQUWrrGq4wAAANA8WmDUGAAAQEtogVFjAAAALaEFRo0BAAC0hBYYV/EDAABEzEaXFhg1BgAAEDEbXVpg1BgAAEDEbHRpgVFjAAAAEbPRpQVWW2PhCb/blzq/rKtu8hu7fvf8V17SVTe51R2/2/1yr666yf79tt99+Wv9uurmvb/9d7/b239FV93c/cW/+N2+b7yqq27e/flv/O7AN4d11c1Mft3vfmPoTV11k/7gH/zu1ZExXXXzvfuP/e6rb97SVTe35v7G717/7pSuunn73Q/97sjb7+iqmxs//MDvjt6+q6tu3vr+e343NbWgq27euPUjvzs2/TNddTM8Pu13b2YWddXNUOp7fvf2/C901c3gGzf97vd/8ne66uaVb/+l373z01/pqpvLr77hd9/58J901U3/K9f97o8++lhX3fz516/53bnCv+qqm3jfZb97f/m3uuqmJ97nd99f+U9ddfOVl77qd3+2/t+66ubL57v97oel3+uqmy9+8Ut+V3ScO6cbbv76N//rdzv/9Lyuunnwj//jd7v+7GVddfPBr/7L77701Yu66mah+B9+98LFAV11c+/xv/ndr/3FVV118+NH/+x3LyWGdNXN7OKv/e7Xr31HV9388MGq373yrZSuupl6/5d+95vfeVtX3Uy+V/C7ryX/yi76mfjxkt/99o20rroZfyfvd1+/+a6uuvluOut3k5Pzuurmzcl5vytH6qob+Wh+Vz6LrrqRW+J35Rbqqhu5F3538r2CXfQjj4DfnXq/qKturnzrLb8rj6quupFH3u/KV0RX3chXze/KV1NX3chX3O/Kd4KuupHvFr8r30W66ualCxf9rnwH6qob+S71u/Ldq6tu5Dvc78p3vq66kX8dflfIvx3dcPOw9Hu/K//udNWN/Nv0u/JvVlfdyL9rvyv/3nXVjfxM8Lvys0JX3cjPE78rP2d01Y38LPK78jNKV93IzzG/Kz/fdNWN/Az0u/KzUVfdyM9Pvys/V3XVjfzs9bvyM1lX3cjPbb8rP8911c3Y9E/9rjwX6Kobeb7wu/I8oqtu5LnG78pzkK66kecpvyvPX7rqRp7j/K489+mqm1dHb/lded7UVTfy3Op35TlXV93I87LfledrXXUjz+l+V57rddWN9IDflU7QVTe9/Qm/K42hq26kQ/yu9ImuupGG8bvSNrrqRvrH70oX6aobaSe/K3Q1NFpg1Fh4qLHwUGPh+dzX2Fu66kaaw+8enBqTFb9LjVFjuuqGGgsPNRaeg1VjDMMwDMMwTPRDjTEMwzAMw7Ru/vCH/wPqoyQYexfR+wAAAABJRU5ErkJggg==",
""
FROM "tbl_sheet" s
LEFT JOIN "tbl_place" p
ON p.id = s.id_place
LEFT JOIN "tbl_person" so
ON so.id = s.id_source_by
LEFT JOIN "tbl_person" c
ON c.id = s.id_compiled_by
LEFT JOIN "tbl_person" n
ON n.id = s.id_notation_by
LEFT JOIN "tbl_type" t
ON t.id = s.id_type
WHERE
p.txt_place = "Place 1"
AND
so.txt_person = "Person 1"
AND
c.txt_person = "Person 1"
AND
n.txt_person = "Person 1"
AND
t.txt_type = "Type 1"
This gives no error but doesn't insert record